From f8267e8c0beed6e8686dce69f8033942f5193ed8 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Thu, 13 Jul 2017 14:56:24 +0100 Subject: [PATCH] Fix visual studio warnings for signed/unsigned comparison and unused variable --- libspeexdsp/resample.c | 9 ++++----- libspeexdsp/resample_sse.h | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c index 9fbb5ddd..13911ea0 100644 --- a/libspeexdsp/resample.c +++ b/libspeexdsp/resample.c @@ -670,10 +670,10 @@ static int update_filter(SpeexResamplerState *st) spx_uint32_t i; for (i=0;iden_rate;i++) { - spx_int32_t j; + spx_uint32_t j; for (j=0;jfilt_len;j++) { - st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func); + st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,(((spx_int32_t)j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func); } } #ifdef FIXED_POINT @@ -798,7 +798,6 @@ EXPORT SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_u EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err) { - spx_uint32_t i; SpeexResamplerState *st; int filter_err; @@ -928,7 +927,7 @@ EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t cha EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len) #endif { - int j; + spx_uint32_t j; spx_uint32_t ilen = *in_len; spx_uint32_t olen = *out_len; spx_word16_t *x = st->mem + channel_index * st->mem_alloc_size; @@ -969,7 +968,7 @@ EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t c EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len) #endif { - int j; + spx_uint32_t j; const int istride_save = st->in_stride; const int ostride_save = st->out_stride; spx_uint32_t ilen = *in_len; diff --git a/libspeexdsp/resample_sse.h b/libspeexdsp/resample_sse.h index fed5b827..a3abd60b 100644 --- a/libspeexdsp/resample_sse.h +++ b/libspeexdsp/resample_sse.h @@ -39,7 +39,7 @@ #define OVERRIDE_INNER_PRODUCT_SINGLE static inline float inner_product_single(const float *a, const float *b, unsigned int len) { - int i; + unsigned int i; float ret; __m128 sum = _mm_setzero_ps(); for (i=0;i