diff options
author | Chris Robinson <[email protected]> | 2013-06-05 01:52:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-06-05 01:52:49 -0700 |
commit | a371de080b01d9ea9dc38dd386b5903f7e4d8282 (patch) | |
tree | 2d6ad48f76bf1580430d0d6aa3dbd2bf7ab2d047 /OpenAL32 | |
parent | 0e0f70b2888c23debeefd80603f8c6f0c1ad4880 (diff) |
Silence some clang warnings
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 6 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 13 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 17 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 4 |
4 files changed, 9 insertions, 31 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 605c96c7..6e9abd6a 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -9,12 +9,6 @@ extern "C" { #define LOWPASSFREQREF (5000) -/* Calculates the low-pass filter coefficient given the pre-scaled gain and - * cos(w) value. Note that g should be pre-scaled (sqr(gain) for one-pole, - * sqrt(gain) for four-pole, etc) */ -ALfloat lpCoeffCalc(ALfloat g, ALfloat cw); - - typedef enum ALfilterType { ALfilterType_HighShelf, ALfilterType_LowShelf, diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 2daa2e3d..44eacaff 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -455,7 +455,7 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, cons offset = offset/OldBytes * Bytes; length = length/OldBytes/Channels; } - ConvertData(&((ALubyte*)ALBuf->data)[offset], ALBuf->FmtType, + ConvertData((char*)ALBuf->data+offset, (enum UserFmtType)ALBuf->FmtType, data, SrcType, Channels, length); WriteUnlock(&ALBuf->lock); } @@ -531,7 +531,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, /* offset -> byte offset */ offset *= FrameSize; - ConvertData(&((ALubyte*)ALBuf->data)[offset], ALBuf->FmtType, + ConvertData((char*)ALBuf->data+offset, (enum UserFmtType)ALBuf->FmtType, data, type, ChannelsFromFmt(ALBuf->FmtChannels), samples); WriteUnlock(&ALBuf->lock); } @@ -581,7 +581,8 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, /* offset -> byte offset */ offset *= FrameSize; - ConvertData(data, type, &((ALubyte*)ALBuf->data)[offset], ALBuf->FmtType, + ConvertData(data, type, + (char*)ALBuf->data+offset, (enum UserFmtType)ALBuf->FmtType, ChannelsFromFmt(ALBuf->FmtChannels), samples); ReadUnlock(&ALBuf->lock); } @@ -1972,7 +1973,7 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei f ALBuf->data = temp; if(data != NULL) - ConvertData(ALBuf->data, DstType, data, SrcType, NewChannels, frames); + ConvertData(ALBuf->data, (enum UserFmtType)DstType, data, SrcType, NewChannels, frames); if(storesrc) { @@ -1985,8 +1986,8 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei f } else { - ALBuf->OriginalChannels = DstChannels; - ALBuf->OriginalType = DstType; + ALBuf->OriginalChannels = (enum UserFmtChannels)DstChannels; + ALBuf->OriginalType = (enum UserFmtType)DstType; ALBuf->OriginalSize = frames * NewBytes * NewChannels; } diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 5bef87fd..abfcbdd4 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -403,23 +403,6 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g } -ALfloat lpCoeffCalc(ALfloat g, ALfloat cw) -{ - ALfloat a = 0.0f; - - if(g < 0.9999f) /* 1-epsilon */ - { - /* Be careful with gains < 0.001, as that causes the coefficient head - * towards 1, which will flatten the signal */ - g = maxf(g, 0.001f); - a = (1 - g*cw - sqrtf(2*g*(1-cw) - g*g*(1 - cw*cw))) / - (1 - g); - } - - return a; -} - - static void lp_SetParami(ALfilter *filter, ALCcontext *context, ALenum param, ALint val) { SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; } static void lp_SetParamiv(ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals) diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index f98b31ea..c59cec2b 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -534,13 +534,13 @@ static ALenum SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp pr case sfAuxSendFilterGainHFAuto: case sfDirectChannelsSOFT: ival = (ALint)values[0]; - return SetSourceiv(Source, Context, prop, &ival); + return SetSourceiv(Source, Context, (SrcIntProp)prop, &ival); case sfBuffer: case sfBuffersQueued: case sfBuffersProcessed: ival = (ALint)((ALuint)values[0]); - return SetSourceiv(Source, Context, prop, &ival); + return SetSourceiv(Source, Context, (SrcIntProp)prop, &ival); } ERR("Unexpected property: 0x%04x\n", prop); |