From ccf90df07215b4317e2842641a8915d757868e8b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 31 Aug 2016 04:56:10 -0700 Subject: Initialize some enums to dummy values --- OpenAL32/alBuffer.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'OpenAL32/alBuffer.c') diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index c52924a9..f9093cb7 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -139,8 +139,8 @@ AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer) AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq) { - enum UserFmtChannels srcchannels; - enum UserFmtType srctype; + enum UserFmtChannels srcchannels = UserFmtMono; + enum UserFmtType srctype = UserFmtByte; ALCdevice *device; ALCcontext *context; ALbuffer *albuf; @@ -288,8 +288,8 @@ done: AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length) { - enum UserFmtChannels srcchannels; - enum UserFmtType srctype; + enum UserFmtChannels srcchannels = UserFmtMono; + enum UserFmtType srctype = UserFmtByte; ALCdevice *device; ALCcontext *context; ALbuffer *albuf; @@ -981,13 +981,14 @@ done: */ ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels SrcChannels, enum UserFmtType SrcType, const ALvoid *data, ALsizei align, ALboolean storesrc) { + enum FmtChannels DstChannels = FmtMono; + enum FmtType DstType = FmtByte; ALuint NewChannels, NewBytes; - enum FmtChannels DstChannels; - enum FmtType DstType; ALuint64 newsize; - if(DecomposeFormat(NewFormat, &DstChannels, &DstType) == AL_FALSE || - (long)SrcChannels != (long)DstChannels) + if(DecomposeFormat(NewFormat, &DstChannels, &DstType) == AL_FALSE) + return AL_INVALID_ENUM; + if((long)SrcChannels != (long)DstChannels) return AL_INVALID_ENUM; NewChannels = ChannelsFromFmt(DstChannels); -- cgit v1.2.3