Skip to content

Commit

Permalink
Fix visual studio warnings for signed/unsigned comparison and unused …
Browse files Browse the repository at this point in the history
…variable
  • Loading branch information
NWilson committed Jul 13, 2017
1 parent 79822c8 commit f8267e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions libspeexdsp/resample.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,10 @@ static int update_filter(SpeexResamplerState *st)
spx_uint32_t i;
for (i=0;i<st->den_rate;i++)
{
spx_int32_t j;
spx_uint32_t j;
for (j=0;j<st->filt_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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions libspeexdsp/resample_sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<len;i+=8)
Expand All @@ -55,7 +55,7 @@ static inline float inner_product_single(const float *a, const float *b, unsigne

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

static inline double inner_product_double(const float *a, const float *b, unsigned int len)
{
int i;
unsigned int i;
double ret;
__m128d sum = _mm_setzero_pd();
__m128 t;
Expand All @@ -98,7 +98,7 @@ static inline double inner_product_double(const float *a, const float *b, unsign

#define OVERRIDE_INTERPOLATE_PRODUCT_DOUBLE
static inline double interpolate_product_double(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
int i;
unsigned int i;
double ret;
__m128d sum;
__m128d sum1 = _mm_setzero_pd();
Expand Down

0 comments on commit f8267e8

Please sign in to comment.