Changeset 5270:e25346c13638 in roaraudio for libroardsp


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

fixed some gcc -Wextra warnings

Location:
libroardsp
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.