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

Conversation

NWilson
Copy link

@NWilson NWilson commented Jul 13, 2017

I can confirmed that with these changes, the resampling sounds the same (and I'd expect it to sound terrible if something wrapped that shouldn't). Tested with floating-point only, but the same branches are covered for fixed.

@NWilson
Copy link
Author

NWilson commented Jan 9, 2018

Ping - any chance of merging this?

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using a spx_int32_t filt_len temporary instead? That way you can avoid adding casts inside the loop and even delete one that's already there.

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary about changing these index variables to unsigned as this has burned libspeex before: 1e2f99.
Less intrusive would be to promote the upper limit variable (e.g., len) to signed, or live with the warnings.

@NWilson NWilson force-pushed the ncw/visualstudio-warnings branch from f8267e8 to c73d2f3 Compare April 24, 2019 10:05
@NWilson
Copy link
Author

NWilson commented Apr 24, 2019

It's been a while, sorry! But I've updated with the changes you requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants