Changeset 5270:e25346c13638 in roaraudio


Ignore:
Timestamp:
11/17/11 18:20:12 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some gcc -Wextra warnings

Files:
96 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/basic.h

    r5240 r5270  
    5858 unsigned int stream; 
    5959 uint32_t pos; 
    60  int datalen; 
     60 size_t datalen; 
    6161 char data[LIBROAR_BUFFER_MSGDATA]; 
    6262 int16_t seq; 
  • include/libroar/config.h

    r5202 r5270  
    7070 
    7171struct roar_libroar_config_codec { 
    72  unsigned int codec; // Codec ID 
     72 uint32_t codec; // Codec ID 
    7373 
    7474 // parameters which are set: 
  • include/libroar/ltm.h

    r4708 r5270  
    140140 * result set was collected in the server. 
    141141 */ 
    142 int roar_ltm_get_numchans(struct roar_ltm_result * res, int streamidx); 
     142int roar_ltm_get_numchans(struct roar_ltm_result * res, size_t streamidx); 
    143143 
    144144/* Extract a single value from the result. 
     
    160160 * (channels are counted from zero to N-1, not from 1 to N) 
    161161 */ 
    162 int64_t roar_ltm_extract(struct roar_ltm_result * res, int mt, int streamidx, int channel); 
     162int64_t roar_ltm_extract(struct roar_ltm_result * res, int mt, size_t streamidx, int channel); 
    163163 
    164164#endif 
  • include/libroar/stream.h

    r5238 r5270  
    9696int roar_stream_m2s     (struct roar_stream * s, struct roar_message * m); 
    9797 
    98 int    roar_str2codec (const char * codec) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
    99 const char * roar_codec2str (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     98int32_t      roar_str2codec (const char  * codec) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     99const char * roar_codec2str (const uint32_t codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    100100 
    101 int    roar_mime2codec (const char * mime) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
    102 const char * roar_codec2mime (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     101int32_t      roar_mime2codec (const char  * mime) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     102const char * roar_codec2mime (const uint32_t codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    103103 
    104104int32_t roar_str2rate(const char * rate) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
  • include/libroardsp/amp.h

    r4708 r5270  
    4242int roar_amp_pcm_8bit  (int8_t  * output, int8_t  * input, int samples, int channels, struct roar_mixer_settings * set); 
    4343int roar_amp_pcm_16bit (int16_t * output, int16_t * input, int samples, int channels, struct roar_mixer_settings * set); 
    44 int roar_amp_pcm_24bit (void    * output, void    * input, int samples, int channels, struct roar_mixer_settings * set); 
    4544int roar_amp_pcm_32bit (int32_t * output, int32_t * input, int samples, int channels, struct roar_mixer_settings * set); 
    4645 
  • include/libroardsp/fader.h

    r4708 r5270  
    4343struct roar_fader_state { 
    4444 int     rate; 
    45  size_t pcmoffset; 
     45 ssize_t pcmoffset; 
    4646 ssize_t start; 
    4747 ssize_t stop; 
  • include/libroardsp/mixer.h

    r4708 r5270  
    4242int roar_mix_pcm_8bit  (int8_t  * output, int8_t  ** input, int samples); 
    4343int roar_mix_pcm_16bit (int16_t * output, int16_t ** input, int samples); 
    44 int roar_mix_pcm_24bit (void    * output, void    ** input, int samples); 
    4544int roar_mix_pcm_32bit (int32_t * output, int32_t ** input, int samples); 
    4645 
  • libroar/Makefile

    r5220 r5270  
    1717INCLUDE = -I../include -I../include/libroar 
    1818CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    19 LDFLAGS+= -g $(SHARED) $(LDPATH) 
     19LDFLAGS+= -g -Wall $(SHARED) $(LDPATH) 
    2020LIBS    = $(LIBROAR_NS) 
    2121 
  • libroar/acl.c

    r4708 r5270  
    4444  return 0; 
    4545 
    46  if ( rule->addr && !addr ) 
     46 if ( rule->addr && addr != NULL ) 
    4747  return 0; 
    4848 
  • libroar/authfile.c

    r4973 r5270  
    223223    if ( roar_vio_lseek(&(authfile->vio), 0, SEEK_SET) != 0 ) 
    224224     return -1; 
    225     if ( roar_vio_write(&(authfile->vio), key->data, key->len) != key->len ) 
     225    if ( roar_vio_write(&(authfile->vio), key->data, key->len) != (ssize_t)key->len ) 
    226226     return -1; 
    227227    if ( roar_authfile_unlock(authfile) == -1 ) 
  • libroar/config.c

    r5202 r5270  
    3737 
    3838static struct roar_libroar_config_codec * 
    39            roar_libroar_config_codec_get_conf(int codec, int create, struct roar_libroar_config * config); 
     39           roar_libroar_config_codec_get_conf(uint32_t codec, int create, struct roar_libroar_config * config); 
    4040 
    4141 
     
    318318 
    319319static struct roar_libroar_config_codec * 
    320            roar_libroar_config_codec_get_conf(int codec, int create, struct roar_libroar_config * config) { 
    321  int i; 
     320           roar_libroar_config_codec_get_conf(uint32_t codec, int create, struct roar_libroar_config * config) { 
     321 size_t i; 
    322322 int need_new = 1; 
    323323 
     
    337337   if ( config->codecs.codec[i].codec == codec ) 
    338338    return &(config->codecs.codec[i]); 
    339    if ( config->codecs.codec[i].codec == -1 ) 
     339   if ( config->codecs.codec[i].codec == (uint32_t)-1 ) 
    340340    need_new = 0; 
    341341  } 
     
    349349 if ( !need_new ) { 
    350350  for (i = 0; i < config->codecs.num; i++) { 
    351    if ( config->codecs.codec[i].codec == -1 ) { 
     351   if ( config->codecs.codec[i].codec == (uint32_t)-1 ) { 
    352352    memset(&(config->codecs.codec[i]), 0, sizeof(struct roar_libroar_config_codec)); 
    353353    config->codecs.codec[i].codec = codec; 
     
    368368 memset(&(config->codecs.codec[config->codecs.num]), 0, 16); 
    369369 for (i = config->codecs.num; i < (config->codecs.num+16); i++) { 
    370   config->codecs.codec[i].codec = -1; 
     370  config->codecs.codec[i].codec = (uint32_t)-1; 
    371371 } 
    372372 
  • libroar/debug.c

    r5201 r5270  
    184184 ret = snprintf(buf, sizeof(buf), "(%s: %s:%lu): %s: ", prefix, file, line, typename); 
    185185 
    186  if ( ret > 0 && ret < sizeof(buf) ) { 
     186 if ( ret > 0 && ret < (int)sizeof(buf) ) { 
    187187  bufp += ret; 
    188188 } else { 
  • libroar/enumdev.c

    r5238 r5270  
    101101 int i; 
    102102#endif 
     103 
     104 (void)flags, (void)dir, (void)socktype; 
    103105 
    104106 if ( maxlen < 10 ) 
     
    207209 }; 
    208210 
     211 (void)flags, (void)dir, (void)socktype; 
     212 
    209213 for (f = &(files[0]); f->file != NULL; f++) { 
    210214  if ( (inp = fopen(f->file, "r")) == NULL ) 
  • libroar/env.c

    r5008 r5270  
    6060const char * roar_env_get_home(int level) { 
    6161 const char * home = getenv("HOME"); 
     62 
     63 (void)level; 
    6264 
    6365 return home; 
  • libroar/error.c

    r5252 r5270  
    918918 static char buf[1024] = ""; 
    919919 int num[8]; 
    920  int i; 
     920 size_t i; 
    921921 int _ra_err = roar_error; 
    922922 int _sys_err = errno; 
  • libroar/hash.c

    r5188 r5270  
    146146 int i; 
    147147 
    148  for (i = 0; _libroar_hashes[i].id != -1; i++) 
     148 for (i = 0; _libroar_hashes[i].id != (uint_least32_t)-1; i++) 
    149149  if ( _libroar_hashes[i].id == ht ) 
    150150   return _libroar_hashes[i].name; 
     
    157157 int i; 
    158158 
    159  for (i = 0; _libroar_hashes[i].id != -1; i++) 
     159 for (i = 0; _libroar_hashes[i].id != (uint_least32_t)-1; i++) 
    160160  if ( !strcasecmp(_libroar_hashes[i].name, ht) ) 
    161161   return _libroar_hashes[i].id; 
     
    168168 int i; 
    169169 
    170  for (i = 0; _libroar_hashes[i].id != -1; i++) 
     170 for (i = 0; _libroar_hashes[i].id != (uint_least32_t)-1; i++) 
    171171  if ( _libroar_hashes[i].id == ht ) 
    172172   return _libroar_hashes[i].dlen; 
  • libroar/hash_tiger.c

    r4721 r5270  
    580580 
    581581int roar_hash_tiger_uninit(struct roar_hash_tiger * state) { 
     582 (void)state; 
    582583 return 0; 
    583584} 
     
    667668 
    668669ssize_t roar_hash_tiger_statelen(struct roar_hash_tiger * state) { 
     670 (void)state; 
    669671 return PSTATE_LEN; 
    670672} 
     
    827829 
    828830ssize_t roar_hash_tiger_blocklen(struct roar_hash_tiger * state) { 
     831 (void)state; 
    829832 return BLOCK_LEN; 
    830833} 
  • libroar/libroar.c

    r5020 r5270  
    216216//#define ROAR_ERR(format, args...)  roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, __LINE__, __FILE__, ROAR_DBG_PREFIX, format, ## args) 
    217217 
     218 // we do not support info-text at the moment. 
     219 (void)info; 
     220 
    218221 if ( func == NULL ) 
    219222  func = "<unknown>"; 
  • libroar/ltm.c

    r5145 r5270  
    175175 char * buf = NULL; 
    176176 int    ret; 
    177  int    i; 
     177 size_t i; 
    178178 
    179179 if ( con == NULL ) { 
     
    260260} 
    261261 
    262 static int64_t * roar_ltm_get_streamptr(struct roar_ltm_result * res, int streamidx) { 
     262static int64_t * roar_ltm_get_streamptr(struct roar_ltm_result * res, size_t streamidx) { 
    263263 int64_t * ptr; 
    264264 int numchans; 
    265  int i; 
     265 size_t i; 
    266266 
    267267 ROAR_DBG("roar_ltm_get_streamptr(res=%p, streamidx=%i) = ?", res, streamidx); 
     
    289289} 
    290290 
    291 int roar_ltm_get_numchans(struct roar_ltm_result * res, int streamidx) { 
     291int roar_ltm_get_numchans(struct roar_ltm_result * res, size_t streamidx) { 
    292292 int64_t * ptr = roar_ltm_get_streamptr(res, streamidx); 
    293293 
     
    298298} 
    299299 
    300 int64_t roar_ltm_extract(struct roar_ltm_result * res, int mt, int streamidx, int channel) { 
     300int64_t roar_ltm_extract(struct roar_ltm_result * res, int mt, size_t streamidx, int channel) { 
    301301 int64_t * ptr = roar_ltm_get_streamptr(res, streamidx); 
    302302 int numchans; 
  • libroar/memmgr.c

    r5010 r5270  
    366366  memcpy(dst+dlen, src, slen); 
    367367  dst[dlen+slen] = 0; 
    368  } else if ( dlen != size ) { 
     368 } else if ( dlen != (ssize_t)size ) { 
    369369  memcpy(dst+dlen, src, size-dlen-1); 
    370370  dst[size-1] = 0; 
  • libroar/meta.c

    r5054 r5270  
    520520 
    521521int roar_stream_meta_list (struct roar_connection * con, struct roar_stream * s, int * types, size_t len) { 
    522  int i; 
     522 size_t i; 
    523523 struct roar_message m; 
    524524 
  • libroar/pinentry.c

    r5016 r5270  
    177177 len = strlen(cmd); 
    178178 
    179  if ( write(pe->out, cmd, len) != len ) 
     179 if ( write(pe->out, cmd, len) != (ssize_t)len ) 
    180180  return -1; 
    181181 
     
    186186  len = strlen(args); 
    187187 
    188   if ( write(pe->out, args, len) != len ) 
     188  if ( write(pe->out, args, len) != (ssize_t)len ) 
    189189   return -1; 
    190190 } 
  • libroar/proto.c

    r5216 r5270  
    111111 } 
    112112 
    113  if ( roar_vio_write(vio, buf, headerlen) != headerlen ) { 
     113 if ( roar_vio_write(vio, buf, headerlen) != (ssize_t)headerlen ) { 
    114114  return -1; 
    115115 } 
    116116 
    117117 if ( mes->datalen != 0 ) { 
    118   if ( roar_vio_write(vio, data == NULL ? mes->data : data, mes->datalen) != mes->datalen ) { 
     118  if ( roar_vio_write(vio, data == NULL ? mes->data : data, mes->datalen) != (ssize_t)mes->datalen ) { 
    119119   return -1; 
    120120  } 
     
    122122 
    123123 if ( crclen != 0 ) { 
    124   if ( roar_vio_write(vio, crc, crclen) != crclen ) { 
     124  if ( roar_vio_write(vio, crc, crclen) != (ssize_t)crclen ) { 
    125125   return -1; 
    126126  } 
     
    253253 
    254254 if ( mes->datalen <= LIBROAR_BUFFER_MSGDATA ) { 
    255   if ( roar_vio_read(vio, mes->data, mes->datalen) == mes->datalen ) { 
     255  if ( roar_vio_read(vio, mes->data, mes->datalen) == (ssize_t)mes->datalen ) { 
    256256   ROAR_DBG("roar_vrecv_message2(*): Got data!"); 
    257257   roar_err_clear(); 
     
    285285  } 
    286286 
    287   if ( roar_vio_read(vio, *data, mes->datalen) == mes->datalen ) { 
     287  if ( roar_vio_read(vio, *data, mes->datalen) == (ssize_t)mes->datalen ) { 
    288288   ROAR_DBG("roar_vrecv_message2(*): Got data!"); 
    289289 
  • libroar/roardl.c

    r5008 r5270  
    119119 void * ret = dlsym(_roardl2ldl(lhandle), sym); 
    120120 
     121 (void)type; 
     122 
    121123 ROAR_DBG("roar_dl_getsym(lhandle=%p, sym='%s', type=%i) = %p", lhandle, sym, type, ret); 
    122124 
     
    181183char *                   roar_dl_errstr(struct roar_dl_lhandle * lhandle) { 
    182184#if defined(ROAR_HAVE_LIBDL) 
     185 (void)lhandle; 
    183186 return dlerror(); 
    184187#else 
  • libroar/serverinfo.c

    r4708 r5270  
    155155 struct roar_server_info * ret = NULL; 
    156156 uint16_t * d16, * dptr; 
    157  int idx; 
    158  int i; 
     157 size_t idx; 
     158 size_t i; 
    159159 size_t needlen = 4; 
    160160 char * textpart; 
  • libroar/slp.c

    r4805 r5270  
    4848 struct roar_slp_cookie * self = cookie; 
    4949 
     50 (void)hslp; 
     51 
    5052 ROAR_DBG("roar_slp_url_callback(*) = ?"); 
    5153 
  • libroar/socket.c

    r5261 r5270  
    10881088 
    10891089 if ( app_len > 0 ) 
    1090   if ( write(fh, app, app_len) != app_len ) 
     1090  if ( write(fh, app, app_len) != (ssize_t)app_len ) 
    10911091   return -1; 
    10921092 
  • libroar/stream.c

    r5240 r5270  
    510510 } 
    511511 
    512  if ( data[1] != ROAR_STREAM_PARA_NAME ) { 
     512 if ( data[1] != (uint16_t)ROAR_STREAM_PARA_NAME ) { 
    513513  roar_err_set(ROAR_ERROR_TYPEMM); 
    514514  return -1; 
     
    815815*/ 
    816816 
    817 static struct { 
     817static const struct { 
    818818 int    dir; 
    819819 const char * name; 
     
    870870*/ 
    871871 
    872 static struct { 
    873  int    codec; 
    874  const char * name; 
    875  const char * mime; 
     872static const struct { 
     873 const uint32_t codec; 
     874 const char   * name; 
     875 const char   * mime; 
    876876} _libroar_codec[] = { 
    877877 // PCM: 
     
    975975}; 
    976976 
    977 int roar_str2codec(const char * codec) { 
    978  int i; 
     977int32_t roar_str2codec(const char * codec) { 
     978 size_t i; 
    979979 int guess; 
    980980 
     
    985985  return guess; 
    986986 
    987  for (i = 0; _libroar_codec[i].codec != -1; i++) 
     987 for (i = 0; _libroar_codec[i].codec != (uint32_t)-1; i++) 
    988988  if ( strcasecmp(_libroar_codec[i].name, codec) == 0 ) 
    989989   return _libroar_codec[i].codec; 
     
    994994 
    995995 
    996 const char * roar_codec2str (const int codec) { 
     996const char * roar_codec2str (const uint32_t codec) { 
    997997 int i; 
    998998 
    999  for (i = 0; _libroar_codec[i].codec != -1; i++) 
     999 for (i = 0; _libroar_codec[i].codec != (uint32_t)-1; i++) 
    10001000  if ( _libroar_codec[i].codec == codec ) 
    10011001   return _libroar_codec[i].name; 
     
    10041004} 
    10051005 
    1006 int    roar_mime2codec (const char * mime) { 
    1007  int i; 
     1006int32_t  roar_mime2codec (const char * mime) { 
     1007 size_t i; 
    10081008 
    10091009 if ( mime == NULL ) { 
     
    10171017 } 
    10181018 
    1019  for (i = 0; _libroar_codec[i].codec != -1; i++) 
     1019 for (i = 0; _libroar_codec[i].codec != (uint32_t)-1; i++) 
    10201020  if ( _libroar_codec[i].mime != NULL ) 
    10211021   if ( strcasecmp(_libroar_codec[i].mime, mime) == 0 ) 
     
    10261026} 
    10271027 
    1028 const char * roar_codec2mime (const int    codec) { 
    1029  int i; 
    1030  
    1031  for (i = 0; _libroar_codec[i].codec != -1; i++) 
     1028const char * roar_codec2mime (const uint32_t   codec) { 
     1029 size_t i; 
     1030 
     1031 for (i = 0; _libroar_codec[i].codec != (uint32_t)-1; i++) 
    10321032  if ( _libroar_codec[i].codec == codec ) 
    10331033   return _libroar_codec[i].mime; 
     
    11101110} 
    11111111 
    1112 static struct { 
     1112static const struct { 
    11131113 int    role; 
    11141114 const char * name; 
     
    12091209} 
    12101210 
    1211 static struct { 
     1211static const struct { 
    12121212 const char * name; 
    12131213 struct roar_audio_info info; 
  • libroar/trap.c

    r4784 r5270  
    5454 size_t i; 
    5555 
    56  for (i = 0; i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != -1; i++); 
     56 for (i = 0; 
     57      i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != (unsigned int)-1; 
     58      i++); 
    5759 if ( i == (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) ) 
    5860  return -1; 
     
    6870 size_t i; 
    6971 
    70  for (i = 0; i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != -1; i++) { 
     72 for (i = 0; 
     73      i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != (unsigned int)-1; 
     74      i++) { 
    7175  if ( _libroar_trap_groups[i].id == group ) 
    7276   return _libroar_trap_groups[i].name; 
     
    7983 size_t i; 
    8084 
    81  for (i = 0; i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != -1; i++) { 
     85 for (i = 0; 
     86      i < (sizeof(_libroar_trap_groups)/sizeof(*_libroar_trap_groups)) && _libroar_trap_groups[i].id != (unsigned int)-1; 
     87      i++) { 
    8288  if ( !strcasecmp(_libroar_trap_groups[i].name, name) ) 
    8389   return _libroar_trap_groups[i].id; 
     
    128134 } 
    129135#else 
     136 (void)group, (void)name, (void)line, (void)file, (void)prefix; 
    130137 return; 
    131138#endif 
  • libroar/vio.c

    r5260 r5270  
    686686// null 
    687687ssize_t roar_vio_null_rw    (struct roar_vio_calls * vio, void *buf, size_t count) { 
     688 (void)count; 
     689 
    688690 if ( vio == NULL || buf == NULL ) { 
    689691  roar_err_set(ROAR_ERROR_FAULT); 
     
    695697 
    696698int     roar_vio_null_sync    (struct roar_vio_calls * vio) { 
     699 (void)vio; 
    697700 return 0; 
    698701} 
  • libroar/vio_dstr.c

    r5257 r5270  
    3737 
    3838#ifndef ROAR_WITHOUT_VIO_DSTR 
    39 struct _roar_vio_dstr_type { 
     39static struct _roar_vio_dstr_type { 
    4040 const int    id; 
    4141 const char * name; 
  • libroar/vio_jumbo.c

    r4708 r5270  
    147147 
    148148 // TODO: do this a bit more intelergent (RE?) 
    149  if ( roar_vio_write(self->backend, data, self->pos) != self->pos ) 
     149 if ( roar_vio_write(self->backend, data, self->pos) != (ssize_t)self->pos ) 
    150150  return -1; 
    151151 
  • libroar/vio_misc.c

    r4876 r5270  
    5555 
    5656static off_t   roar_vio_misc_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) { 
     57 (void)vio, (void)offset, (void)whence; 
    5758 return 0; 
    5859} 
     
    7172 
    7273static int     roar_vio_misc_sync    (struct roar_vio_calls * vio) { 
     74 (void)vio; 
    7375 return 0; 
    7476} 
     
    98100 
    99101static int     roar_vio_misc_close   (struct roar_vio_calls * vio) { 
     102 (void)vio; 
    100103 return 0; 
    101104} 
     
    119122 
    120123static ssize_t roar_vio_misc_op_return_len (void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) { 
     124 (void)buf, (void)vio, (void)callbacks; 
    121125 return len; 
    122126} 
    123127 
    124128static ssize_t roar_vio_misc_op_return_zero(void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) { 
     129 (void)buf, (void)len, (void)vio, (void)callbacks; 
    125130 return 0; 
    126131} 
    127132 
    128133static ssize_t roar_vio_misc_op_zero(void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) { 
     134 (void)vio, (void)callbacks; 
    129135 memset(buf, 0, len); 
    130136 return len; 
     
    133139static ssize_t roar_vio_misc_op_full(void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) 
    134140{ 
     141 (void)buf, (void)len, (void)vio, (void)callbacks; 
    135142 roar_err_set(ROAR_ERROR_NOSPC); 
    136143 return -1; 
     
    138145 
    139146static ssize_t roar_vio_misc_op_random_nonce(void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) { 
     147 (void)vio, (void)callbacks; 
     148 
    140149 if ( roar_random_gen_nonce(buf, len) == -1 ) 
    141150  return -1; 
     
    145154 
    146155static ssize_t roar_vio_misc_op_random_salt_nonce(void * buf, size_t len, struct roar_vio_calls * vio, struct roar_vio_misc * callbacks) { 
     156 (void)vio, (void)callbacks; 
     157 
    147158 if ( roar_random_salt_nonce(buf, len) == -1 ) 
    148159  return -1; 
  • libroar/vio_pipe.c

    r4708 r5270  
    215215 // we may add fdatasync() calls here depending on the type 
    216216 // but in general they should not be needed on pipes. 
     217 (void)vio; 
    217218 return 0; 
    218219} 
  • libroar/vio_stdio.c

    r5088 r5270  
    6262#endif 
    6363 
     64 // (void)flags is the the individual sections because later added APIs 
     65 // may require those flags. 
     66 
    6467 if ( calls == NULL ) 
    6568  return NULL; 
    6669 
    6770#if defined(ROAR_HAVE_FOPENCOOKIE) 
     71 (void)flags; 
     72 
    6873 memset(&foc_funcs, 0, sizeof(cookie_io_functions_t)); 
    6974 
     
    7479 return fopencookie((void*) calls, "rw", foc_funcs); 
    7580#elif defined(ROAR_HAVE_FUNOPEN) 
     81 (void)flags; 
     82 
    7683 return funopen((void*) calls, roar_vio_to_stdio_read,  roar_vio_to_stdio_write, 
    7784                               roar_vio_to_stdio_lseek, roar_vio_to_stdio_close); 
  • libroar/vio_tantalos.c

    r5028 r5270  
    6262 time_t now = time(NULL); 
    6363 
     64 (void)dst; 
     65 
    6466 if ( (cookie = roar_vio_open_get_cookie(0)) == NULL ) 
    6567  return -1; 
  • libroar/vio_zlib.c

    r4956 r5270  
    5151 
    5252static void * _zalloc(voidpf opaque, uInt items, uInt size) { 
     53 (void)opaque; 
    5354 return roar_mm_calloc(items, size); 
    5455} 
    5556 
    5657static void _zfree(voidpf opaque, voidpf address) { 
     58 (void)opaque; 
    5759 roar_mm_free(address); 
    5860} 
     
    220222  count -= len; 
    221223 
    222   if ( len == buflen ) { 
     224  if ( len == (ssize_t)buflen ) { 
    223225   ret = roar_buffer_next(&(self->inbuf)); 
    224226  } else { 
     
    342344  if ( len == -1 ) { 
    343345   return -1; 
    344   } else if ( len == buflen ) { 
     346  } else if ( len == (ssize_t)buflen ) { 
    345347   if ( roar_buffer_next(&(self->outbuf)) == -1 ) { 
    346348    roar_err_set((self->compressor_error = ROAR_ERROR_LOSTSYNC)); 
     
    389391   len = roar_vio_write(self->next, outbuf, outlen); 
    390392 
    391    if ( len < outlen ) { 
     393   if ( len < (ssize_t)outlen ) { 
    392394    if ( roar_buffer_new_data(&leftbuf, outlen - len, &leftbufdata) == -1 ) { 
    393395     roar_err_set((self->compressor_error = ROAR_ERROR_LOSTSYNC)); 
     
    428430 
    429431static off_t   roar_vio_zlib_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) { 
     432 (void)vio, (void)offset, (void)whence; 
    430433 roar_err_set(ROAR_ERROR_NOSYS); 
    431434 return (off_t)-1; 
  • libroar/vs.c

    r5262 r5270  
    160160 ssize_t offset; 
    161161 int cmd, subcmd; 
    162  int i; 
     162 size_t i; 
    163163 
    164164 if ( roar_recv_message(vss->con, &mes, &data) == -1 ) { 
     
    11541154 } 
    11551155 
    1156  if ( channels != oldchannels ) 
     1156 if ( channels != (size_t)oldchannels ) 
    11571157  mode = ROAR_SET_VOL_UNMAPPED; 
    11581158 
  • libroararts/Makefile

    r4748 r5270  
    88#DEFINES        = -DDEBUG 
    99INCLUDE = -I../include -I../include/libroarpulse 
    10 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    11 LDFLAGS+= -g $(LDPATH) -L../lib/ 
     10CFLAGS += -g -Wall $(Wextra) $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
     11LDFLAGS+= -g -Wall $(Wextra) $(LDPATH) -L../lib/ 
    1212LIBS    = $(LIBROAR) 
    1313 
  • libroardsp/Makefile

    r5269 r5270  
    1717INCLUDE = -I../include -I../include/libroardsp 
    1818CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    19 LDFLAGS+= -g $(SHARED) -L../lib/ $(LDPATH) 
     19LDFLAGS+= -g -Wall $(SHARED) -L../lib/ $(LDPATH) 
    2020 
    2121LIBS      = $(LIBROARDSP_NS) 
  • libroardsp/alaw.c

    r5210 r5270  
    5858 
    5959#ifdef ROAR_SUPPORT_ALAW 
    60 int16_t _roardsp_alaw2pcm16[] = { 
     60static const int16_t _roardsp_alaw2pcm16[] = { 
    6161/* -------- SUN -------- */ 
    6262     -5504,   -5248,   -6016,   -5760,   -4480,   -4224,   -4992, 
     
    101101 
    102102#ifdef ROAR_SUPPORT_ALAW_RW 
    103 int8_t _roardsp_pcm132alaw[] = { 
     103static const int8_t _roardsp_pcm132alaw[] = { 
    104104/* -------- SUN -------- */ 
    105105   0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 
  • libroardsp/amp.c

    r4708 r5270  
    3030  case  8: return roar_amp_pcm_8bit (output, input, samples, channels, set); break; 
    3131  case 16: return roar_amp_pcm_16bit(output, input, samples, channels, set); break; 
    32   case 24: return roar_amp_pcm_24bit(output, input, samples, channels, set); break; 
    3332  case 32: return roar_amp_pcm_32bit(output, input, samples, channels, set); break; 
    3433  default: return -1; 
     
    8887} 
    8988 
    90 int roar_amp_pcm_24bit (void    * output, void    * input, int samples, int channels, struct roar_mixer_settings * set) { 
    91  return -1; 
    92 } 
    93  
    9489int roar_amp_pcm_32bit (int32_t * output, int32_t * input, int samples, int channels, struct roar_mixer_settings * set) { 
    9590#ifdef ROAR_NATIVE_INT64 
  • libroardsp/channels.c

    r4708 r5270  
    9393 
    9494int    roardsp_chanlist2str(char * list, size_t len, char * str, size_t strlen) { 
     95 size_t i; 
    9596 char * name; 
    96  int i; 
    9797 
    9898 if ( list == NULL && len > 0 ) 
  • libroardsp/filter.c

    r5269 r5270  
    2626#include "libroardsp.h" 
    2727 
    28 struct _roardsp_filterlist { 
     28static struct _roardsp_filterlist { 
    2929 int id; 
    3030 char * name; 
  • libroardsp/filter_agc.c

    r4708 r5270  
    2828int roardsp_agc_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
    2929 struct roardsp_agc * self = roar_mm_malloc(sizeof(struct roardsp_agc)); 
     30 
     31 (void)id; 
    3032 
    3133 if ( self == NULL ) 
  • libroardsp/filter_amp.c

    r5181 r5270  
    2828int roardsp_amp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
    2929 struct roardsp_amp * self = roar_mm_malloc(sizeof(struct roardsp_amp)); 
     30 
     31 (void)stream, (void)id; 
    3032 
    3133 if ( self == NULL ) 
  • libroardsp/filter_clip.c

    r5177 r5270  
    2727 
    2828int roardsp_clip_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
     29 (void)stream, (void)id; 
     30 
    2931 if ( (filter->inst = roar_mm_malloc(sizeof(struct roardsp_clip))) == NULL ) 
    3032  return -1; 
  • libroardsp/filter_dcblock.c

    r4708 r5270  
    2929 struct roardsp_dcblock * inst = roar_mm_malloc(sizeof(struct roardsp_dcblock)); 
    3030// roardsp_downmix_ctl(filter, ROARDSP_FCTL_MODE, &mode); 
     31 
     32 (void)stream, (void)id; 
    3133 
    3234 if ( inst == NULL ) { 
  • libroardsp/filter_highp.c

    r5181 r5270  
    3131 struct roardsp_highp * self = roar_mm_malloc(sizeof(struct roardsp_highp)); 
    3232 
     33 (void)stream, (void)id; 
     34 
    3335 if ( self == NULL ) 
    3436  return -1; 
     
    5254 int##bits##_t * samp = (int##bits##_t *) data; \ 
    5355 register int##twobits##_t s, h; \ 
    54  int i, c; \ 
    55  int channels = filter->channels; \ 
     56 size_t i, c; \ 
     57 size_t channels = filter->channels; \ 
    5658\ 
    5759 if ( channels > ROAR_MAX_CHANNELS ) \ 
  • libroardsp/filter_lowp.c

    r5181 r5270  
    3131 struct roardsp_lowp * self = roar_mm_malloc(sizeof(struct roardsp_lowp)); 
    3232 
     33 (void)stream, (void)id; 
     34 
    3335 ROAR_DBG("roardsp_lowp_init(*): self=%p", self); 
    3436 
     
    5355 int##bits##_t * samp = (int##bits##_t *) data; \ 
    5456 register int##twobits##_t s; \ 
    55  int i, c; \ 
    56  int channels = filter->channels; \ 
     57 size_t i, c; \ 
     58 size_t channels = filter->channels; \ 
    5759\ 
    5860 if ( channels > ROAR_MAX_CHANNELS ) \ 
  • libroardsp/filter_quantify.c

    r5181 r5270  
    2727 
    2828int roardsp_quantify_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
     29 
     30 (void)stream, (void)id; 
    2931 
    3032 roardsp_filter_reset(filter, ROARDSP_RESET_FULL); 
  • libroardsp/filter_responsecurve.c

    r5269 r5270  
    2929 struct roardsp_responsecurve * self = roar_mm_malloc(sizeof(struct roardsp_responsecurve)); 
    3030 
     31 (void)stream, (void)id; 
     32 
    3133 ROAR_DBG("roardsp_responsecurve_init(filter=%p, stream=%p, id=%i) = ?", filter, stream, id); 
    3234 
     
    5052 
    5153static double __func_pass(double i, double N) { 
     54 (void)N; 
    5255 return i; 
    5356} 
     
    7073 
    7174static double __func_cos(double i, double N) { 
     75 (void)N; 
    7276 return 0.5 - cos(i * M_PI)/2.; 
    7377} 
    7478 
    7579static double __func_icos(double i, double N) { 
     80 (void)N; 
    7681 return 2.*i - 0.5 + cos(i * M_PI)/2.; 
    7782} 
  • libroardsp/filter_swap.c

    r5181 r5270  
    2828int roardsp_swap_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
    2929 struct roardsp_swap * inst = roar_mm_malloc(sizeof(struct roardsp_swap)); 
     30 
     31 (void)stream, (void)id; 
    3032 
    3133 ROAR_DBG("roardsp_swap_init(*): inst=%p", inst); 
     
    6062 size_t i; \ 
    6163\ 
     64 (void)filter; \ 
     65\ 
    6266 for (i = 0; i < samples; i += 2) { \ 
    6367  ROAR_DBG("roardsp_swap_calc*2(*): d[i]=%i, d[i+1]=%i", d[i], d[i+1]); \ 
     
    7579 
    7680int roardsp_swap_ctl    (struct roardsp_filter * filter, int cmd, void * data) { 
     81 (void)filter, (void)cmd, (void)data; 
     82 roar_err_set(ROAR_ERROR_NOSYS); 
    7783 return -1; 
    7884} 
  • libroardsp/interleave.c

    r4708 r5270  
    2727 
    2828int roar_interl_init  (struct roar_interleave * state, size_t channels, size_t bits) { 
    29  if ( state == NULL ) 
     29 if ( state == NULL ) { 
     30  roar_err_set(ROAR_ERROR_FAULT); 
    3031  return -1; 
     32 } 
    3133 
    3234 // we can currently only hanle full bytes: 
     
    3537 
    3638 // currently we have a channel limit 
    37  if ( channels > ROAR_INTERLEAVE_MAX_CHANNELS ) 
     39 if ( channels > ROAR_INTERLEAVE_MAX_CHANNELS ) { 
     40  roar_err_set(ROAR_ERROR_RANGE); 
    3841  return -1; 
     42 } 
    3943 
    4044 memset(state, 0, sizeof(struct roar_interleave)); 
     
    4751 
    4852int roar_interl_uninit(struct roar_interleave * state) { 
    49  if ( state == NULL ) 
     53 if ( state == NULL ) { 
     54  roar_err_set(ROAR_ERROR_FAULT); 
    5055  return -1; 
     56 } 
    5157 
    5258 memset(state, 0, sizeof(struct roar_interleave)); 
     
    5662 
    5763int roar_interl_ctl   (struct roar_interleave * state, int cmd, void * data) { 
    58  if ( state == NULL ) 
     64 if ( state == NULL ) { 
     65  roar_err_set(ROAR_ERROR_FAULT); 
    5966  return -1; 
     67 } 
    6068 
     69 (void)state, (void)cmd, (void)data; 
     70 
     71 roar_err_set(ROAR_ERROR_NOSYS); 
    6172 return -1; 
    6273} 
     
    6879 char   * ip[ROAR_INTERLEAVE_MAX_CHANNELS]; // output pointer 
    6980 
    70  if ( state == NULL ) 
     81 if ( state == NULL ) { 
     82  roar_err_set(ROAR_ERROR_FAULT); 
    7183  return -1; 
     84 } 
    7285 
    73  if ( in == NULL || out == NULL ) 
     86 if ( in == NULL || out == NULL ) { 
     87  roar_err_set(ROAR_ERROR_FAULT); 
    7488  return -1; 
     89 } 
    7590 
    7691 if ( len == 0 ) 
  • libroardsp/mixer.c

    r4708 r5270  
    3030  case  8: return roar_mix_pcm_8bit (output, (int8_t  **)input, samples); break; 
    3131  case 16: return roar_mix_pcm_16bit(output, (int16_t **)input, samples); break; 
    32   case 24: return roar_mix_pcm_24bit(output, input, samples); break; 
    3332  case 32: return roar_mix_pcm_32bit(output, (int32_t **)input, samples); break; 
    3433  default: return -1; 
     
    8281} 
    8382 
    84 int roar_mix_pcm_24bit (void    * output, void    ** input, int samples) { 
    85  return -1; 
    86 } 
    87  
    8883int roar_mix_pcm_32bit (int32_t * output, int32_t ** input, int samples) { 
    8984#ifdef ROAR_NATIVE_INT64 
  • libroardsp/mulaw.c

    r4708 r5270  
    5858 
    5959#ifdef ROAR_SUPPORT_MULAW 
    60 int16_t _roardsp_mulaw2pcm16[] = { 
     60static const int16_t _roardsp_mulaw2pcm16[] = { 
    6161/* -------- SUN -------- */ 
    6262    -32124,  -31100,  -30076,  -29052,  -28028,  -27004,  -25980, 
     
    101101 
    102102#ifdef ROAR_SUPPORT_MULAW_RW 
    103 int8_t _roardsp_pcm142mulaw[] = { 
     103static const int8_t _roardsp_pcm142mulaw[] = { 
    104104/* -------- SUN -------- */ 
    105105   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  • libroardsp/poly.c

    r4881 r5270  
    102102 
    103103int roar_math_mkpoly_5x5 (float * poly, float * data) { 
     104 roar_err_set(ROAR_ERROR_NOSYS); 
    104105 return -1; 
    105106} 
  • libroardsp/synth.c

    r4708 r5270  
    9696 float cv0, cv1; 
    9797#endif 
    98  int i; 
     98 size_t i; 
    9999 
    100100 _CHECK_PCMOUT(); 
     
    133133// basic SINFs: 
    134134float roar_synth_synf_rect (float t, struct roar_synth_state * state) { 
     135 (void)state; 
     136 
    135137 t /= 2*M_PI; 
    136138 t -= (int)t; 
     
    143145 
    144146float roar_synth_synf_saw  (float t, struct roar_synth_state * state) { 
     147 (void)state; 
     148 
    145149 t /= 2*M_PI; 
    146150 t -= (int)t; 
     
    150154 
    151155float roar_synth_synf_tri  (float t, struct roar_synth_state * state) { 
     156 (void)state; 
     157 
    152158 t /= 2*M_PI; 
    153159 t -= (int)t; 
     
    160166 
    161167float roar_synth_synf_trap (float t, struct roar_synth_state * state) { 
     168 (void)state; 
     169 
    162170 t /= 2*M_PI; 
    163171 t -= (int)t; 
     
    176184#ifdef ROAR_HAVE_LIBM 
    177185float roar_synth_synf_s2s  (float t, struct roar_synth_state * state) { 
     186 (void)state; 
     187 
    178188 float sin2 = sinf(t/1.2); 
    179189 
  • libroardsp/transcode.c

    r4708 r5270  
    264264   } 
    265265 
    266    while ( ringstats.bytes > state->packet_len ) { 
     266   while ( (ssize_t)ringstats.bytes > state->packet_len ) { 
    267267    curlen = state->packet_len; 
    268268    if ( roar_buffer_shift_out(&(state->iobuffer), bufdata, &curlen) == -1 ) { 
     
    421421// dummy functions used by some de/encoders: 
    422422int roar_xcoder_dummy_inituninit(struct roar_xcoder * state) { 
     423 (void)state; 
    423424 return 0; 
    424425} 
     
    426427int roar_xcoder_dummy_packet_size_any(struct roar_xcoder * state, int samples) { 
    427428 // the case samples=-1/samples!=-1 based things are done in the general func 
     429 (void)state, (void)samples; 
    428430 return 0; 
    429431} 
    430432 
    431433int roar_xcoder_dummy_proc_header(struct roar_xcoder * state) { 
     434 (void)state; 
    432435 return 0; 
    433436} 
  • libroardsp/transcode_mualaw.c

    r4708 r5270  
    3636                         return -1; 
    3737 
    38 #define _SEND_RETURN()  if ( roar_vio_write(state->backend, iobuf, outbyte) != outbyte ) \ 
     38#define _SEND_RETURN()  if ( roar_vio_write(state->backend, iobuf, outbyte) != (ssize_t)outbyte ) \ 
    3939                         return -1; \ 
    4040                        return 0; 
    4141 
    42 #define _READ()         if ( roar_vio_read(state->backend, iobuf, outbyte) != outbyte ) \ 
     42#define _READ()         if ( roar_vio_read(state->backend, iobuf, outbyte) != (ssize_t)outbyte ) \ 
    4343                         return -1; 
    4444 
  • libroardsp/vio_transcode.c

    r4708 r5270  
    7676 return !ret ? count : -1; 
    7777#else 
    78  return !roar_xcoder_proc(vio->inst, buf, count) ? count : -1; 
     78 return !roar_xcoder_proc(vio->inst, buf, count) ? (ssize_t)count : -1; 
    7979#endif 
    8080} 
     
    137137  return -1; 
    138138 
    139  return !roar_bixcoder_read(vio->inst, buf, count) ? count : -1; 
     139 return !roar_bixcoder_read(vio->inst, buf, count) ? (ssize_t)count : -1; 
    140140} 
    141141 
     
    148148  return -1; 
    149149 
    150  return !roar_bixcoder_write(vio->inst, buf, count) ? count : -1; 
     150 return !roar_bixcoder_write(vio->inst, buf, count) ? (ssize_t)count : -1; 
    151151} 
    152152 
  • libroareio/Makefile

    r4748 r5270  
    1111#DEFINES        = -DDEBUG 
    1212INCLUDE = -I../include -I../include/libroareio 
    13 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    14 LDFLAGS+= -g $(SHARED) -L../lib/ $(LDPATH) 
     13CFLAGS += -g -Wall $(Wextra) $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
     14LDFLAGS+= -g -Wall $(Wextra) $(SHARED) -L../lib/ $(LDPATH) 
    1515LIBS    = $(LIBROAREIO_NS) 
    1616 
  • libroareio/driver.c

    r5242 r5270  
    3434int roar_cdriver_null(struct roar_vio_calls * calls, const char * name, const char * dev, struct roar_audio_info * info, int dir) { 
    3535 ROAR_DBG("roar_cdriver_null(calls=%p, name='%s', dev='%s', info=%p{...}, dir=%i(?)) = ?", calls, name, dev, info, dir); 
     36 
     37 (void)name, (void)dev, (void)info, (void)dir; 
    3638 
    3739 memset(calls, 0, sizeof(struct roar_vio_calls)); 
  • libroareio/driver_oss.c

    r5250 r5270  
    4141 int blocksizes[] = {11, 12, 13}; 
    4242 int blocks[]     = {4, 5, 6, 3, 7, 2, 8}; 
    43  int bs, b; 
     43 size_t bs, b; 
    4444 int tmp; 
    4545 
     
    6363 struct roar_vio_sysio_ioctl ctl; 
    6464 int tmp, ctmp; 
     65 
     66 (void)name; 
    6567 
    6668 // preinit ctl struct, we always pass ints in tmp. 
     
    113115 } 
    114116 
    115  if ( tmp != info->channels ) { 
     117 if ( tmp != (int)info->channels ) { 
    116118  _err(); 
    117119 } 
     
    182184 } 
    183185 
    184  if ( tmp != info->rate ) { 
     186 if ( tmp != (int)info->rate ) { 
    185187  _err(); 
    186188 } 
  • libroareio/driver_roar.c

    r5242 r5270  
    2828 
    2929int roar_cdriver_roar(struct roar_vio_calls * calls, const char * name, const char * dev, struct roar_audio_info * info, int dir) { 
     30 (void)name; 
    3031 return roar_vio_simple_stream(calls, info->rate, info->channels, info->bits, info->codec, dev, dir, "libroareio client"); 
    3132} 
  • libroareio/ff_ssdp.c

    r4708 r5270  
    9292 return 0; 
    9393} 
     94 
    9495int  roar_ff_ssdp_read (struct roar_vio_calls * vio, struct roar_ff_ssdp * c) { 
     96 roar_err_set(ROAR_ERROR_NOSYS); 
    9597 return -1; 
    9698} 
  • libroaresd/Makefile

    r4748 r5270  
    1111INCLUDE = -I../include -I../include/libroaresd 
    1212CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    13 LDFLAGS+= -g $(SHARED) $(LDPATH) -L../lib/ 
     13LDFLAGS+= -g -Wall $(SHARED) $(LDPATH) -L../lib/ 
    1414LIBS    = $(LIBROAR) 
    1515 
  • libroaresd/esdbasic.c

    r5226 r5270  
    6666/* send the authorization cookie, create one if needed */ 
    6767int esd_send_auth( int sock ) { 
     68 (void) sock; 
    6869 return 0; 
    6970} 
  • libroaresd/esdctl.c

    r5236 r5270  
    4545// so always return -1 
    4646int esd_lock( int esd ) { 
     47 (void)esd; 
     48 errno = ENOSYS; 
    4749 return -1; 
    4850} 
    4951int esd_unlock( int esd ) { 
     52 (void)esd; 
     53 errno = ENOSYS; 
    5054 return -1; 
    5155} 
     
    6670 
    6771 return roar_set_standby(&con, ROAR_STANDBY_INACTIVE); 
     72} 
     73 
     74static void _format2str(char * buf, size_t len, esd_format_t format) { 
     75 
     76 if ( (format & ESD_BITS16) == ESD_BITS16 ) { 
     77  roar_mm_strlcat(buf, "16 bit ", len); 
     78 } else { 
     79  roar_mm_strlcat(buf, "8 bit ", len); 
     80 } 
     81 
     82 if ( (format & ESD_STEREO) == ESD_STEREO ) { 
     83  roar_mm_strlcat(buf, "stereo ", len); 
     84 } else { 
     85  roar_mm_strlcat(buf, "mono ", len); 
     86 } 
    6887} 
    6988 
     
    7291 char buf[80] = ""; 
    7392 
    74  if ( server_info->format & ESD_BITS16 ) 
    75   strcat(buf, "16 bit "); 
    76  else 
    77   strcat(buf, "8 bit "); 
    78  
    79  if ( server_info->format & ESD_STEREO ) 
    80   strcat(buf, "stereo "); 
    81  else 
    82   strcat(buf, "mono "); 
     93 _format2str(buf, sizeof(buf), server_info->format); 
    8394 
    8495 printf("server version   = %i\n",        server_info->version); 
     
    8798} 
    8899 
    89  
    90100void esd_print_player_info( esd_player_info_t *player_info ) { 
    91101 char buf[80] = ""; 
    92102 
    93  if ( (player_info->format & ESD_BITS16) == ESD_BITS16 ) 
    94   strcat(buf, "16 bit "); 
    95  else 
    96   strcat(buf, "8 bit "); 
    97  
    98  if ( (player_info->format & ESD_STEREO) == ESD_STEREO ) 
    99   strcat(buf, "stereo "); 
    100  else 
    101   strcat(buf, "mono "); 
     103 _format2str(buf, sizeof(buf), player_info->format); 
    102104 
    103105 printf("player %i name    = %s\n",        player_info->source_id, player_info->name); 
     
    109111 
    110112void esd_print_sample_info( esd_sample_info_t *sample_info ) { 
     113 char buf[80] = ""; 
     114 
     115 _format2str(buf, sizeof(buf), sample_info->format); 
     116 
     117 printf("sample %i name    = %s\n",        sample_info->sample_id, sample_info->name); 
     118 printf("sample %i format  = 0x%08x %s\n", sample_info->sample_id, sample_info->format, buf); 
     119 printf("sample %i rate    = %i\n",        sample_info->sample_id, sample_info->rate); 
     120 printf("sample %i left    = %i\n",        sample_info->sample_id, sample_info->left_vol_scale); 
     121 printf("sample %i right   = %i\n",        sample_info->sample_id, sample_info->right_vol_scale); 
     122 printf("sample %i length  = %i\n",        sample_info->sample_id, sample_info->length); 
    111123} 
    112124 
     
    282294/* retrieve all information from server, and update until unsubsribed or closed */ 
    283295esd_info_t *esd_subscribe_all_info( int esd ) { 
     296 (void)esd; 
     297 errno = ENOSYS; 
    284298 return NULL; // Not yet implemented in upstream esd 
    285299} 
     
    288302esd_info_t *esd_update_info( int esd, esd_info_t *info, 
    289303                             esd_update_info_callbacks_t *callbacks ) { 
     304 (void)esd, (void)info, (void)callbacks; 
     305 errno = ENOSYS; 
    290306 return NULL; // Not yet implemented in upstream esd 
    291307} 
    292308 
    293309esd_info_t *esd_unsubscribe_info( int esd ) { 
     310 (void)esd; 
     311 errno = ENOSYS; 
    294312 return NULL; // Not yet implemented in upstream esd 
    295313} 
     
    362380int esd_set_default_sample_pan( int esd, int sample_id, 
    363381                                int left_scale, int right_scale ) { 
     382 // this is not yet implemented by the RA protocol. 
     383 (void)esd, (void)sample_id, (void)left_scale, (void)right_scale; 
     384 errno = ENOSYS; 
    364385 return -1; 
    365386} 
  • libroaresd/esdfile.c

    r4708 r5270  
    4747} 
    4848int esd_play_file( const char *name_prefix, const char *filename, int fallback ) { 
    49  // TODO: add support for fallback 
    50  return roar_simple_play_file((char*)filename, NULL, (char*)name_prefix) == -1 ? -1 : 0; 
     49 int ret = roar_simple_play_file(filename, NULL, name_prefix); 
     50 
     51 if ( ret != -1 ) 
     52  return 0; 
     53 
     54 if ( !fallback ) 
     55  return -1; 
     56 
     57 return roar_simple_play_file(filename, "+fork", name_prefix) == -1 ? -1 : 0; 
    5158} 
    5259int esd_file_cache( int esd, const char *name_prefix, const char *filename ) { 
  • libroarpulse/Makefile

    r4748 r5270  
    1414#DEFINES        = -DDEBUG 
    1515INCLUDE = -I../include -I../include/libroarpulse 
    16 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    17 LDFLAGS+= -g $(LDPATH) -L../lib/ -L. 
     16CFLAGS += -g -Wall $(Wextra) $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
     17LDFLAGS+= -g -Wall $(Wextra) $(LDPATH) -L../lib/ -L. 
    1818LIBS    = $(LIBROAR) 
    1919 
  • libroarpulse/context.c

    r4708 r5270  
    221221/** Return non-zero if some data is pending to be written to the connection */ 
    222222int pa_context_is_pending(pa_context *c) { 
     223 (void)c; 
    223224 return 0; 
    224225} 
     
    334335/** Return the protocol version of the library. \since 0.8 */ 
    335336uint32_t pa_context_get_protocol_version(pa_context *c) { 
     337 (void)c; 
    336338 return 0; 
    337339} 
     
    339341/** Return the protocol version of the connected server. \since 0.8 */ 
    340342uint32_t pa_context_get_server_protocol_version(pa_context *c) { 
     343 (void)c; 
    341344 return 0; 
    342345} 
  • libroarpulse/mainloop-signal.c

    r4708 r5270  
    7777 int sig; 
    7878 size_t ret; 
     79#endif 
    7980 
     81 (void)a, (void)e, (void)f, (void)userdata; 
     82 
     83#ifdef ROAR_HAVE_PIPE 
    8084 ret = read(fd, &sig, sizeof(sig)); 
    8185 
  • libroarpulse/mainloop.c

    r4708 r5270  
    273273 pa_io_event_flags_t events; 
    274274 int count = 0; 
    275  int i, h; 
     275 int h; 
     276 nfds_t i; 
    276277 
    277278 ROAR_DBG("pa_mainloop_dispatch(m=%p) = ?", m); 
  • libroarpulse/operation.c

    r4708 r5270  
    8989void pa_operation_cancel(pa_operation *o) { 
    9090 // we ignore this 
     91 (void)o; 
    9192} 
    9293 
  • libroarpulse/simple.c

    r5239 r5270  
    5959 int roar_dir; 
    6060 int err = ROAR_ERROR_NONE; 
     61 
     62 if ( dev != NULL || map != NULL || attr != NULL ) 
     63  return NULL; 
    6164 
    6265 if ( dir == PA_STREAM_PLAYBACK ) { 
  • libroarpulse/stream.c

    r5243 r5270  
    177177/** Return the device (sink input or source output) index this stream is connected to */ 
    178178uint32_t pa_stream_get_index(pa_stream *s) { 
     179 (void)s; 
    179180 return 0; 
    180181} 
     
    189190 void * data; 
    190191 size_t len; 
    191  size_t ret; 
     192 ssize_t ret; 
    192193 int bufret; 
     194 
     195 (void)fd, (void)events; 
    193196 
    194197 ROAR_DBG("_roar_pa_stream_ioecb(*) = ?"); 
     
    209212 
    210213     // TODO: handle errors 
    211      if ( ret == len ) { 
     214     if ( ret == (ssize_t)len ) { 
    212215      bufret = roar_buffer_next(&(s->iobuffer)); 
    213216     } else { 
     
    289292 volume = NULL; 
    290293 
    291  if ( attr != NULL || flags != 0 || volume != NULL || sync_stream != NULL ) { 
     294 if ( dev != NULL || attr != NULL || flags != 0 || volume != NULL || sync_stream != NULL ) { 
    292295  pa_stream_set_state(s, PA_STREAM_FAILED); 
    293296  return -1; 
  • libroarpulse/timeval.c

    r4708 r5270  
    6969 tv->tv_usec += v; 
    7070 
    71  while ( tv->tv_usec > 1000000LLU ) { 
    72   tv->tv_usec -= 1000000LLU; 
     71 while ( tv->tv_usec > 1000000LL ) { 
     72  tv->tv_usec -= 1000000LL; 
    7373  tv->tv_sec  += 1; 
    7474 } 
  • libroarpulse/volume.c

    r4708 r5270  
    6262/** Set the volume of all channels to the specified parameter */ 
    6363pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v) { 
    64  int i; 
     64 unsigned int i; 
    6565 
    6666 if ( a == NULL ) 
  • libroaryiff/Makefile

    r4748 r5270  
    77#DEFINES        = -DDEBUG 
    88INCLUDE = -I../include -I../include/libroaryiff 
    9 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    10 LDFLAGS+= -g $(SHARED) $(LDPATH) -L../lib/ 
     9CFLAGS += -g -Wall $(Wextra) $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
     10LDFLAGS+= -g -Wall $(Wextra) $(SHARED) $(LDPATH) -L../lib/ 
    1111LIBS    = $(LIBROAR) 
    1212 
  • libroaryiff/connection.c

    r5247 r5270  
    3939 YConnection * ycon = roar_mm_malloc(sizeof(YConnection)); 
    4040 struct roar_connection con; 
    41  char * server = (char *)con_arg; 
    42  char * name   = "libroaryiff client"; 
     41 const char * server = (char *)con_arg; 
     42 const char * name   = "libroaryiff client"; 
    4343 
    4444 memset(ycon, 0, sizeof(YConnection)); 
     
    7575 struct roar_vio_calls vio; 
    7676 
     77 // in case we started the server by using +fork we can not keep it running 
     78 // as it will terminate anyway. If there are any other clients (I guess 
     79 // this is what this option is about) it will keep running. 
     80 (void)no_shutdown; 
     81 
    7782 if ( connection == NULL ) 
    7883  return; 
  • libroaryiff/events.c

    r5035 r5270  
    3737 
    3838// RoarAudio isn't event based, so we need to trick a lot here 
     39// Maybe this can be overcome with the notify API 
    3940 
    4041int YGetNextEvent (YConnection *con, YEvent *event, Boolean block) { 
    4142 struct roar_connection rcon; 
    4243 struct roar_stream s; 
     44 
     45 (void)block; 
    4346 
    4447 if ( con == NULL || event == NULL ) 
  • libroaryiff/file.c

    r4708 r5270  
    3737 
    3838int YGetSoundObjectAttributes (YConnection *con, const char *path, YEventSoundObjectAttributes *buf) { 
     39 (void)con; 
     40 
    3941 if ( buf == NULL ) 
    4042  return -1; 
  • libroaryiff/stub.c

    r4708 r5270  
    3838// in here only some stub functions are delcared 
    3939 
    40 extern void YSyncAll(YConnection *con, Boolean block) { 
     40void YSyncAll(YConnection *con, Boolean block) { 
     41 (void)con, (void)block; 
    4142} 
    4243 
  • roard/Makefile

    r5242 r5270  
    1919INCLUDE   = -I../include -I./include 
    2020CFLAGS   += -g -Wall $(OPTI_O) $(DEFINES) $(PKGDEFINES) $(INCLUDE) $(INCPATH) 
    21 LDFLAGS  += -g -rdynamic -L../lib/ $(LDPATH) 
     21LDFLAGS  += -g -Wall -rdynamic -L../lib/ $(LDPATH) 
    2222DRVLIBS   = $(lib_esd) $(lib_ossaudio) $(lib_ao) $(lib_shout) $(lib_sndio) $(lib_rsound) $(lib_portaudio) $(lib_pablio) $(lib_asound) $(lib_winmm) $(lib_pulse_simple) $(lib_pulse) $(lib_jack) $(lib_artsc) 
    2323CODEC_CELT= $(lib_celt) $(lib_celt0) 
  • roard/codecfilter_alaw.c

    r4957 r5270  
    3838 struct roar_stream * s = ROAR_STREAM(info); 
    3939 
     40 (void)codec, (void)filter; 
    4041 
    4142 *inst = (CODECFILTER_USERDATA_T) info; 
     
    4849 
    4950int cf_alaw_close(CODECFILTER_USERDATA_T   inst) { 
     51 (void)inst; 
    5052 return 0; 
    5153} 
  • roard/codecfilter_au.c

    r5210 r5270  
    3434 struct roar_stream * s = ROAR_STREAM(info); 
    3535 
    36  if ( !self ) 
     36 (void)codec, (void)filter; 
     37 
     38 if ( self == NULL ) 
    3739  return -1; 
    3840 
     
    99101    return -1; 
    100102 
    101    if ( stream_vio_s_read(self->stream, extra_header, header[1]) != header[1] ) { 
     103   if ( stream_vio_s_read(self->stream, extra_header, header[1]) != (ssize_t)header[1] ) { 
    102104    roar_mm_free(extra_header); 
    103105    return -1; 
     
    275277 int_least32_t type = cmd & ROAR_STREAM_CTL_TYPEMASK; 
    276278 
     279 (void)data; 
     280 
    277281 cmd -= type; 
    278282 
  • roard/codecfilter_celt.c

    r4957 r5270  
    3737 struct roar_stream * s = ROAR_STREAM(info); 
    3838 
    39  if ( !self ) 
     39 (void)codec, (void)filter; 
     40 
     41 if ( self == NULL ) 
    4042  return -1; 
    4143 
  • roard/codecfilter_mulaw.c

    r4957 r5270  
    3838 struct roar_stream * s = ROAR_STREAM(info); 
    3939 
     40 (void)codec, (void)filter; 
    4041 
    4142 *inst = (CODECFILTER_USERDATA_T) info; 
     
    4849 
    4950int cf_mulaw_close(CODECFILTER_USERDATA_T   inst) { 
     51 (void)inst; 
    5052 return 0; 
    5153} 
  • roard/codecfilter_sndfile.c

    r4957 r5270  
    3232                                            struct roar_codecfilter   * filter) { 
    3333 struct codecfilter_sndfile_inst * obj; 
     34 
     35 (void)codec, (void)filter; 
    3436 
    3537 if ( (obj = (struct codecfilter_sndfile_inst *) roar_mm_malloc(sizeof(struct codecfilter_sndfile_inst))) == NULL ) 
  • roard/codecfilter_vorbis.c

    r5218 r5270  
    7171 struct roar_stream * s = ROAR_STREAM(info); 
    7272 
    73  if ( !self ) 
     73 (void)codec, (void)filter; 
     74 
     75 if ( self == NULL ) 
    7476  return -1; 
    7577 
  • roard/emul_rsound.c

    r4739 r5270  
    3939  char c[16]; 
    4040 } buf; 
     41 
     42 (void)lsock; 
    4143 
    4244 // TODO: add error handling 
  • roard/signals.c

    r4708 r5270  
    3838 
    3939void on_sig_term (int signum) { 
     40 (void)signum; 
     41 
    4042 ROAR_INFO("got SIGTERM (or called by SIGINT handler)", ROAR_DBG_INFO_NOTICE); 
    4143 
     
    4547 
    4648void on_sig_chld (int signum) { 
     49 (void)signum; 
     50 
    4751 ROAR_INFO("got SIGCHLD", ROAR_DBG_INFO_NOTICE); 
    4852 
     
    5357 
    5458void on_sig_usr1 (int signum) { 
     59 (void)signum; 
     60 
    5561 ROAR_INFO("got SIGUSR1", ROAR_DBG_INFO_NOTICE); 
    5662 
  • roarfish/Makefile

    r4804 r5270  
    88#DEFINES        = -DDEBUG 
    99INCLUDE = -I../include -I./include 
    10 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) 
    11 LDFLAGS+= -g -L../lib/ $(LDPATH) 
     10CFLAGS += -g -Wall $(Wextra) $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) 
     11LDFLAGS+= -g -Wall $(Wextra) -L../lib/ $(LDPATH) 
    1212LIBS    = $(LIBROAR) $(lib_fishsound) $(lib_oggz) 
    1313 
  • roarfish/include/roarfish.h

    r4708 r5270  
    4242#include <sndfile.h> 
    4343 
    44 int play (char * file, char ** opts); 
     44int play (const char * file, char ** opts); 
    4545 
    4646#ifdef __USE_SVID 
  • roarfish/play.c

    r4908 r5270  
    6363 
    6464 
    65  roar_vs_write(inst->vss, (char*)data, frames * 2, NULL); 
     65 if ( roar_vs_write(inst->vss, (char*)data, frames * 2, NULL) != (ssize_t)(frames * 2) ) { 
     66  return -1; 
     67 } 
    6668 
    6769 
     
    7476 FishSound * fsound = (FishSound *)user_data; 
    7577 
    76  fish_sound_prepare_truncation (fsound, op->granulepos, op->e_o_s); 
    77  fish_sound_decode (fsound, op->packet, op->bytes); 
     78 (void)oggz, (void)serialno; 
     79 
     80 fish_sound_prepare_truncation(fsound, op->granulepos, op->e_o_s); 
     81 fish_sound_decode(fsound, op->packet, op->bytes); 
    7882 
    7983 return 0; 
    8084} 
    8185 
    82 int play (char * file, char ** opts) { 
     86int play (const char * file, char ** opts) { 
    8387 OGGZ * oggz; 
    8488 struct roarfish_play_inst inst; 
     89 
     90 (void)opts; 
    8591 
    8692 inst.vss    = NULL; 
Note: See TracChangeset for help on using the changeset viewer.