Skip to content

Commit f8267e8

Browse files
committed
Fix visual studio warnings for signed/unsigned comparison and unused variable
1 parent 79822c8 commit f8267e8

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

libspeexdsp/resample.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,10 @@ static int update_filter(SpeexResamplerState *st)
670670
spx_uint32_t i;
671671
for (i=0;i<st->den_rate;i++)
672672
{
673-
spx_int32_t j;
673+
spx_uint32_t j;
674674
for (j=0;j<st->filt_len;j++)
675675
{
676-
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);
676+
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);
677677
}
678678
}
679679
#ifdef FIXED_POINT
@@ -798,7 +798,6 @@ EXPORT SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_u
798798

799799
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)
800800
{
801-
spx_uint32_t i;
802801
SpeexResamplerState *st;
803802
int filter_err;
804803

@@ -928,7 +927,7 @@ EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t cha
928927
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)
929928
#endif
930929
{
931-
int j;
930+
spx_uint32_t j;
932931
spx_uint32_t ilen = *in_len;
933932
spx_uint32_t olen = *out_len;
934933
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
969968
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)
970969
#endif
971970
{
972-
int j;
971+
spx_uint32_t j;
973972
const int istride_save = st->in_stride;
974973
const int ostride_save = st->out_stride;
975974
spx_uint32_t ilen = *in_len;

libspeexdsp/resample_sse.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#define OVERRIDE_INNER_PRODUCT_SINGLE
4040
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
4141
{
42-
int i;
42+
unsigned int i;
4343
float ret;
4444
__m128 sum = _mm_setzero_ps();
4545
for (i=0;i<len;i+=8)
@@ -55,7 +55,7 @@ static inline float inner_product_single(const float *a, const float *b, unsigne
5555

5656
#define OVERRIDE_INTERPOLATE_PRODUCT_SINGLE
5757
static inline float interpolate_product_single(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
58-
int i;
58+
unsigned int i;
5959
float ret;
6060
__m128 sum = _mm_setzero_ps();
6161
__m128 f = _mm_loadu_ps(frac);
@@ -77,7 +77,7 @@ static inline float interpolate_product_single(const float *a, const float *b, u
7777

7878
static inline double inner_product_double(const float *a, const float *b, unsigned int len)
7979
{
80-
int i;
80+
unsigned int i;
8181
double ret;
8282
__m128d sum = _mm_setzero_pd();
8383
__m128 t;
@@ -98,7 +98,7 @@ static inline double inner_product_double(const float *a, const float *b, unsign
9898

9999
#define OVERRIDE_INTERPOLATE_PRODUCT_DOUBLE
100100
static inline double interpolate_product_double(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
101-
int i;
101+
unsigned int i;
102102
double ret;
103103
__m128d sum;
104104
__m128d sum1 = _mm_setzero_pd();

0 commit comments

Comments
 (0)