Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visual studio warnings for signed/unsigned comparison and unused variable #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libspeexdsp/jitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
jitter->packets[i].data = packet->data;
} else {
jitter->packets[i].data=(char*)speex_alloc(packet->len);
for (j=0;j<packet->len;j++)
for (j=0;j<(int)packet->len;j++)
jitter->packets[i].data[j]=packet->data[j];
}
jitter->packets[i].timestamp=packet->timestamp;
Expand Down Expand Up @@ -689,7 +689,7 @@ EXPORT int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *p
{
packet->data = jitter->packets[i].data;
} else {
for (j=0;j<packet->len;j++)
for (j=0;j<(int)packet->len;j++)
packet->data[j] = jitter->packets[i].data[j];
/* Remove packet */
speex_free(jitter->packets[i].data);
Expand Down
10 changes: 5 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;
for (j=0;j<st->filt_len;j++)
spx_int32_t j, filt_len = (spx_int32_t)st->filt_len;
for (j=0;j<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,((j-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 @@ -927,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 @@ -968,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 @@ -42,7 +42,7 @@ static inline float inner_product_single(const float *a, const float *b, unsigne
int i;
float ret;
__m128 sum = _mm_setzero_ps();
for (i=0;i<len;i+=8)
for (i=0;i<(int)len;i+=8)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i+4), _mm_loadu_ps(b+i+4)));
Expand All @@ -59,7 +59,7 @@ static inline float interpolate_product_single(const float *a, const float *b, u
float ret;
__m128 sum = _mm_setzero_ps();
__m128 f = _mm_loadu_ps(frac);
for(i=0;i<len;i+=2)
for(i=0;i<(int)len;i+=2)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i+1), _mm_loadu_ps(b+(i+1)*oversample)));
Expand All @@ -81,7 +81,7 @@ static inline double inner_product_double(const float *a, const float *b, unsign
double ret;
__m128d sum = _mm_setzero_pd();
__m128 t;
for (i=0;i<len;i+=8)
for (i=0;i<(int)len;i+=8)
{
t = _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i));
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
Expand All @@ -107,7 +107,7 @@ static inline double interpolate_product_double(const float *a, const float *b,
__m128d f1 = _mm_cvtps_pd(f);
__m128d f2 = _mm_cvtps_pd(_mm_movehl_ps(f,f));
__m128 t;
for(i=0;i<len;i+=2)
for(i=0;i<(int)len;i+=2)
{
t = _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample));
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
Expand Down
2 changes: 1 addition & 1 deletion libspeexdsp/testjitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void jitterFill(JitterBuffer *jb) {
if (jitter_buffer_get(jb, &out, 10, NULL) != JITTER_BUFFER_OK) {
printf("Fill test failed iteration %d\n", i);
}
if (out.timestamp != i * 10) {
if (out.timestamp != (unsigned int)i * 10) {
printf("Fill test expected %d got %d\n", i*10, out.timestamp);
}
jitter_buffer_tick(jb);
Expand Down