Changeset 5210:8eb738dee9d4 in roaraudio


Ignore:
Timestamp:
11/01/11 12:23:05 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Updated ports to minimal, win32 and avr (pr2)

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5207 r5210  
    1414        * Updated filters to support 8 and 32 bit mode as well (pr1) 
    1515        * Re-wrote ALSA plugin (pr1) 
     16        * Updated ports to minimal, win32 and avr (pr2) 
    1617 
    1718v. 0.4rc0 - Mon Sep 05 2011 15:25 CEST 
  • configure

    r5133 r5210  
    670670 
    671671test_lib () { 
     672 _have_libs=false 
     673 _have_headers=false 
    672674 echo > $TF_C 
    673675 
     
    694696   '-'*) 
    695697    LIBS="$LIBS $1" 
     698    _have_libs=true 
    696699   ;; 
    697700   *) 
    698701    LIBS="$LIBS -l$1" 
     702    _have_libs=true 
    699703   ;; 
    700704  esac 
     
    718722  else 
    719723   echo "#include <$_h>"  >> $TF_C 
     724   _have_headers=true 
    720725  fi 
    721726 done 
    722727 
    723728 echo 'int main (void) { return 0; }' >> $TF_C 
     729 
     730 if [ "$_have_libs" = 'false' -a "$_have_headers" = 'false' ] 
     731 then 
     732  echo "no (nothing to test left)$_info" 
     733  echo "LIB($name) HAS NOTHING TO TEST" >&5 
     734  return 1 
     735 fi 
    724736 
    725737 echo "LIB($name) IS TESTED USING TEST CODE:" >&5 
  • include/roaraudio/caps.h

    r4708 r5210  
    3838 
    3939// standard vendors: 
    40 #define ROAR_STDV_ROARAUDIO      0 
    41 #define ROAR_STDV_PROTO          1 
    42 #define ROAR_STDV_RFC            2 
     40#define ROAR_STDV_ROARAUDIO      ((uint32_t)0) 
     41#define ROAR_STDV_PROTO          ((uint32_t)1) 
     42#define ROAR_STDV_RFC            ((uint32_t)2) 
    4343 
    4444// data macros for standards: 
    45 #define ROAR_STD_MASK_VENDOR     0xFF000000 
    46 #define ROAR_STD_MASK_STD        0x00FFFF00 
    47 #define ROAR_STD_MASK_VERSION    0x000000FF 
     45#define ROAR_STD_MASK_VENDOR     ((uint32_t)0xFF000000) 
     46#define ROAR_STD_MASK_STD        ((uint32_t)0x00FFFF00) 
     47#define ROAR_STD_MASK_VERSION    ((uint32_t)0x000000FF) 
    4848 
    49 #define ROAR_STD_MAKE(vendor,standard,version) ((((vendor)   & 0x00FF) << 24) | \ 
    50                                                 (((standard) & 0xFFFF) <<  8) | \ 
    51                                                  ((version)  & 0x00FF)        ) 
     49#define ROAR_STD_MAKE(vendor,standard,version) ((((uint32_t)(vendor)   & 0x00FF) << 24) | \ 
     50                                                (((uint32_t)(standard) & 0xFFFF) <<  8) | \ 
     51                                                 ((uint32_t)(version)  & 0x00FF)        ) 
    5252 
    5353#define ROAR_STD_MAKE_RFC(rfc) ROAR_STD_MAKE(ROAR_STDV_RFC, (rfc), 0) 
  • include/roaraudio/muconthacks.h

    r5015 r5210  
    4747#define O_NONBLOCK     0x04 
    4848#define O_CREAT        0x08 
     49#define O_TRUNC        0x10 
    4950 
    5051#define EAGAIN         11 
  • include/roaraudio/notify.h

    r4841 r5210  
    3434#define ROAR_EVENT_NETFLAG_PROXYEVENT  0x00000002 
    3535 
    36 #define ROAR_NOTIFY_SPECIAL       0xffffffff 
     36#define ROAR_NOTIFY_SPECIAL       (uint32_t)0xffffffff 
    3737 
    3838// protocol cmds: 
    39 #define ROAR_NOTIFY_OFFSET_CMD    0x00000000 
    40 #define ROAR_NOTIFY_MASK_CMD      0x000000ff 
     39#define ROAR_NOTIFY_OFFSET_CMD    (uint32_t)0x00000000 
     40#define ROAR_NOTIFY_MASK_CMD      (uint32_t)0x000000ff 
    4141 
    4242// event groups (AKA meta events): 
    43 #define ROAR_NOTIFY_OFFSET_EGRP    0x00010000 
    44 #define ROAR_NOTIFY_MASK_EGRP      0x0000ffff 
     43#define ROAR_NOTIFY_OFFSET_EGRP   (uint32_t)0x00010000 
     44#define ROAR_NOTIFY_MASK_EGRP     (uint32_t)0x0000ffff 
    4545 
    4646// object event: 
    47 #define ROAR_NOTIFY_OFFSET_OE    0x00020000 
    48 #define ROAR_NOTIFY_MASK_OE      0x0000ffff 
     47#define ROAR_NOTIFY_OFFSET_OE     (uint32_t)0x00020000 
     48#define ROAR_NOTIFY_MASK_OE       (uint32_t)0x0000ffff 
    4949 
    5050// user defined events: 
    51 #define ROAR_NOTIFY_OFFSET_USER   0x40000000 
    52 #define ROAR_NOTIFY_MASK_USER     0x3fffffff 
     51#define ROAR_NOTIFY_OFFSET_USER   (uint32_t)0x40000000 
     52#define ROAR_NOTIFY_MASK_USER     (uint32_t)0x3fffffff 
    5353 
    5454#define ROAR_NOTIFY_X2EVENT(x,offset,mask) ((x) == -1 ? ROAR_NOTIFY_SPECIAL : (((x) & (mask))+(offset))) 
  • include/roaraudio/units.h

    r4708 r5210  
    3535#define _ONE    1 
    3636#define _KILO   1000 
    37 #define _MEGA   (_KILO*_KILO) 
    38 #define _GIGA   (_KILO*_MEGA) 
    39 #define _TERA   (_KILO*_GIGA) 
     37#define _MEGA   ((int_least32_t)_KILO*(int_least32_t)_KILO) 
     38#define _GIGA   ((int_least32_t)_KILO*_MEGA) 
     39#define _TERA   ((int_least32_t)_KILO*_GIGA) 
    4040 
    4141 
     
    4343#ifndef _SEC 
    4444#if defined(_UNITS_T_BASE_MSEC) 
    45 #define _SEC  1000 
     45#define _SEC_TYPE int_least32_t 
     46#define _SEC  (_SEC_TYPE)1000 
    4647#elif defined(_UNITS_T_BASE_USEC) 
    47 #define _SEC  1000000 
     48#define _SEC_TYPE int_least32_t 
     49#define _SEC  (_SEC_TYPE)1000000 
    4850//#elif defined(_UNITS_T_BASE_SEC) 
    4951#else 
    5052#define _SEC  1 
     53#define _SEC_TYPE int 
    5154#endif 
    5255#endif 
    5356 
    54 #define _MIN  (60*_SEC) 
    55 #define _HOUR (60*_MIN) 
     57#ifndef _SEC_TYPE 
     58#define _SEC_TYPE int_least32_t 
     59#endif 
     60 
     61#define _MIN  ((_SEC_TYPE)60*_SEC) 
     62#define _HOUR ((_SEC_TYPE)60*_MIN) 
    5663 
    5764#define _MSEC (_SEC*_MILI) 
     
    6269#ifndef _METER 
    6370#if defined(_UNITS_D_BASE_MMETER) 
     71#define _METER_TYPE int 
    6472#define _METER 1000 
    6573#elif defined(_UNITS_D_BASE_UMETER) 
    66 #define _METER 1000000 
     74#define _METER_TYPE int_least32_t 
     75#define _METER (_METER_TYPE)1000000 
    6776//#elif defined(_UNITS_D_BASE_METER) 
    6877#else 
     78#define _METER_TYPE int 
    6979#define _METER 1 
    7080#endif 
    7181#endif 
    7282 
    73 #define _AE    (149597870691LL     *_METER) 
     83#ifndef _METER_TYPE 
     84#define _METER_TYPE int_least32_t 
     85#endif 
     86 
     87#define _AE    ((int_least64_t)149597870691LL     *_METER) 
    7488#define _LJ    (9460730472580800LL *_METER) 
    7589#define _PC    (30856804413117847LL*_METER) /* TODO: FIXME: get a more corret value */ 
  • libroar/socket.c

    r5203 r5210  
    168168 
    169169int roar_socket_set_tos(int fh) { 
    170 #ifndef ROAR_TARGET_WIN32 
     170#if defined(ROAR_HAVE_BSDSOCKETS) && !defined(ROAR_TARGET_WIN32) 
    171171 int opt = IPTOS_LOWDELAY; 
    172172 int ret; 
  • libroardsp/alaw.c

    r4758 r5210  
    839839   bits = 1; 
    840840 
    841   op = _roardsp_alaw2pcm16[(int)alaw] << 16; 
     841  op = (uint32_t)_roardsp_alaw2pcm16[(int)alaw] << 16; 
    842842//  out[i] |= extra << (11 + bits); 
    843843  out[i]  = op; 
  • roard/caps.c

    r4708 r5210  
    7171  version = ROAR_STD_VERSION(cap); 
    7272  if ( version == 0 ) { 
    73    snpret = snprintf(ret+off, len-off, "%i-%i,", ROAR_STD_VENDOR(cap), ROAR_STD_STD(cap)); 
     73   snpret = snprintf(ret+off, len-off, "%i-%i,", (int)ROAR_STD_VENDOR(cap), (int)ROAR_STD_STD(cap)); 
    7474  } else { 
    75    snpret = snprintf(ret+off, len-off, "%i-%i-%i,", ROAR_STD_VENDOR(cap), ROAR_STD_STD(cap), version); 
     75   snpret = snprintf(ret+off, len-off, "%i-%i-%i,", (int)ROAR_STD_VENDOR(cap), (int)ROAR_STD_STD(cap), (int)version); 
    7676  } 
    7777  if ( snpret > 0 ) { 
  • roard/codecfilter.c

    r4708 r5210  
    269269    strcpy(delay, "dyn"); 
    270270   } else { 
    271     snprintf(delay, 5, "%ims", d/1000); 
     271    snprintf(delay, 5, "%ims", (int)(d/(uint_least32_t)1000)); 
    272272   } 
    273273  } 
  • roard/codecfilter_au.c

    r4708 r5210  
    9393   header[1] -= ROAR_AU_MIN_HEADER_LEN; 
    9494 
    95    if ( header[1] > 32*1024 ) // do not allow more than 32KiB header... 
     95   if ( header[1] > (uint32_t)32768U ) // do not allow more than 32KiB header... 
    9696    return -1; 
    9797 
  • roard/hwmixer.c

    r4852 r5210  
    238238 int ret; 
    239239 int error = 0; 
     240 char * strtok_store; 
    240241//int hwmixer_open(int basestream, char * drv, char * dev, int fh, char * basename, char * subnames) { 
    241242 
     
    248249  k = NULL; 
    249250 } else { 
    250   k = strtok(opts, ","); 
     251  k = roar_mm_strtok_r(opts, ",", &strtok_store); 
    251252 } 
    252253 
     
    281282  } 
    282283 
    283   k = strtok(NULL, ","); 
     284  k = roar_mm_strtok_r(NULL, ",", &strtok_store); 
    284285 } 
    285286 
  • roard/include/light.h

    r5194 r5210  
    4343} g_light_mixer; 
    4444 
    45 int light_init  (unsigned int channels); 
     45int light_init  (uint32_t channels); 
    4646int light_free  (void); 
    4747 
  • roard/light.c

    r5194 r5210  
    3333// // 
    3434 
    35 int light_init  (unsigned int channels) { 
     35int light_init  (uint32_t channels) { 
    3636 struct roar_stream_server * ss; 
    3737 int i; 
     
    3939 g_light_state.channels = 0; 
    4040 
    41  if ( channels == 0 || channels > (512*512) ) /* unrealstic values */ 
     41 if ( channels == 0 || channels > ((uint32_t)512UL*(uint32_t)512UL) ) /* unrealstic values */ 
    4242  return -1; 
    4343 
  • roard/midi.c

    r5208 r5210  
    282282    switch (mes->kk) { 
    283283     case MIDI_CCE_MAIN_VOL: 
    284        if ( (516 * mes->vv) > 65100 ) { // max volume 
     284       if ( (516U * (unsigned int)mes->vv) > 65100 ) { // max volume 
    285285        ss->mixer.mixer[mes->channel] = 65535; 
    286286       } else { 
     
    611611      switch (mes->kk) { 
    612612       case MIDI_CCE_MAIN_VOL: 
    613          if ( 516 * mes->vv > 65100 ) { // max volume 
     613         if ( 516U * (unsigned int)mes->vv > 65100 ) { // max volume 
    614614          ss->mixer.mixer[mes->channel] = 65535; 
    615615         } else { 
  • roard/output.c

    r5192 r5210  
    189189 uint16_t tu16; 
    190190 float q = -32e6; 
     191 char * strtok_store; 
    191192 
    192193 ROAR_INFO("add_output(drv='%s', dev='%s', opts='%s', prim=%i, count=%i): trying to add output driver", ROAR_DBG_INFO_INFO, drv, dev, opts, prim, count); 
     
    244245  k = NULL; 
    245246 } else { 
    246   k = strtok(opts, ","); 
     247  k = roar_mm_strtok_r(opts, ",", &strtok_store); 
    247248 } 
    248249 
     
    375376  } 
    376377 
    377   k = strtok(NULL, ","); 
     378  k = roar_mm_strtok_r(NULL, ",", &strtok_store); 
    378379 } 
    379380 
  • roard/roard.c

    r5194 r5210  
    119119 } else if ( ROAR_NOTIFY_IS_CMD(ev) ) { 
    120120  if ( command_get_name(ROAR_NOTIFY_EVENT2CMD(ev), &ttname) == -1 ) { 
    121    snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_CMD2EVENT(%i) */", ROAR_NOTIFY_EVENT2CMD(ev)); 
     121   snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_CMD2EVENT(%lu) */", (long unsigned int)ROAR_NOTIFY_EVENT2CMD(ev)); 
    122122  } else { 
    123123   snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_CMD2EVENT(ROAR_CMD_%s) */", ttname); 
     
    127127  } 
    128128 } else if ( ROAR_NOTIFY_IS_EGRP(ev) ) { 
    129   snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_EGRP2EVENT(%i) */", ROAR_NOTIFY_EVENT2EGRP(ev)); 
     129  snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_EGRP2EVENT(%lu) */", (long unsigned int)ROAR_NOTIFY_EVENT2EGRP(ev)); 
    130130 } else if ( ROAR_NOTIFY_IS_OE(ev) ) { 
    131131  switch (ev) { 
     
    155155   // OE Default: 
    156156   default: 
    157      snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_OE2EVENT(%i) */", ROAR_NOTIFY_EVENT2OE(ev)); 
     157     snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_OE2EVENT(%lu) */", (long unsigned int)ROAR_NOTIFY_EVENT2OE(ev)); 
    158158    break; 
    159159  } 
    160160 } else if ( ROAR_NOTIFY_IS_USER(ev) ) { 
    161   snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_USER2EVENT(%i) */", ROAR_NOTIFY_EVENT2USER(ev)); 
     161  snprintf(estr, sizeof(estr)-1, "/* ROAR_NOTIFY_USER2EVENT(%lu) */", (long unsigned int)ROAR_NOTIFY_EVENT2USER(ev)); 
    162162 } 
    163163 
     
    959959#endif 
    960960 
     961#ifdef ROAR_HAVE_MAIN_ARGS 
    961962static void list_aiprofiles (void) { 
    962963 struct roar_audio_info info; 
     
    990991 } 
    991992} 
     993#endif 
    992994 
    993995int update_stream_flags (char * str) { 
     
    13651367 char * k; 
    13661368 enum output_format print_format = FORMAT_NATIVE; 
     1369 const struct rolestack * rolestack; 
    13671370#endif 
    13681371#if defined(ROAR_SUPPORT_LISTEN) && defined(ROAR_HAVE_GETUID) 
     
    13711374 struct roar_audio_info sa, max_sa; 
    13721375 struct roard_config config; 
    1373  const struct rolestack * rolestack; 
    13741376#if defined(ROAR_HAVE_FORK) || defined(ROAR_TARGET_WIN32) 
    13751377 int    daemon       = 0; 
     
    14121414 enum roard_client_acclev af_acclev    = ACCLEV_ALL; 
    14131415#ifndef ROAR_WITHOUT_DCOMP_LIGHT 
    1414  int    light_channels = LIGHT_CHANNELS_DEFAULT; 
     1416 uint32_t light_channels = LIGHT_CHANNELS_DEFAULT; 
    14151417#endif 
    14161418#ifdef ROAR_DEFAULT_SOCKGRP 
     
    26062608 ROAR_INFO("Shuting down complete", ROAR_DBG_INFO_INFO); 
    26072609 
     2610#ifdef ROAR_HAVE_SYSTEM 
    26082611 if ( g_config->scripts.post_shutdown != NULL ) 
    26092612  system(g_config->scripts.post_shutdown); 
     2613#endif 
    26102614 
    26112615 ROAR_INFO("Exiting, no error", ROAR_DBG_INFO_INFO); 
     
    26982702 ROAR_INFO("Shuting down complete", ROAR_DBG_INFO_INFO); 
    26992703 
     2704#ifdef ROAR_HAVE_SYSTEM 
    27002705 if ( g_config->scripts.post_shutdown != NULL ) 
    27012706  system(g_config->scripts.post_shutdown); 
     2707#endif 
    27022708 
    27032709 ROAR_INFO("Exiting, no error", ROAR_DBG_INFO_INFO); 
  • roard/sources.c

    r5194 r5210  
    140140 int f_sync = 0, f_mmap = 0; 
    141141 int codec; 
     142 char * strtok_store; 
    142143 
    143144 if ( source == NULL ) 
     
    166167 s->pos_rel_id = -1; 
    167168 
    168  k = strtok(options, ","); 
     169 k = roar_mm_strtok_r(options, ",", &strtok_store); 
    169170 while (k != NULL) { 
    170171  if ( (v = strstr(k, "=")) != NULL ) { 
     
    214215  } 
    215216 
    216   k = strtok(NULL, ","); 
     217  k = roar_mm_strtok_r(NULL, ",", &strtok_store); 
    217218 } 
    218219 
Note: See TracChangeset for help on using the changeset viewer.