SDL_os2audio.c (OS2_OpenDevice): change {0} initializers to SDL_zero()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c
index 69b317e..7b83d24 100644
--- a/src/audio/os2/SDL_os2audio.c
+++ b/src/audio/os2/SDL_os2audio.c
@@ -264,11 +264,14 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
{
PSDL_PrivateAudioData pAData;
SDL_AudioFormat SDLAudioFmt;
- MCI_AMP_OPEN_PARMS stMCIAmpOpen = { 0 };
- MCI_BUFFER_PARMS stMCIBuffer = { 0 };
+ MCI_AMP_OPEN_PARMS stMCIAmpOpen;
+ MCI_BUFFER_PARMS stMCIBuffer;
ULONG ulRC;
ULONG ulIdx;
+ SDL_zero(stMCIAmpOpen);
+ SDL_zero(stMCIBuffer);
+
for( SDLAudioFmt = SDL_FirstAudioFormat( this->spec.format );
SDLAudioFmt != 0; SDLAudioFmt = SDL_NextAudioFormat() )
{
@@ -311,11 +314,12 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
if ( iscapture != 0 )
{
- MCI_CONNECTOR_PARMS stMCIConnector = { 0 };
- MCI_AMP_SET_PARMS stMCIAmpSet = { 0 };
+ MCI_CONNECTOR_PARMS stMCIConnector;
+ MCI_AMP_SET_PARMS stMCIAmpSet;
BOOL fLineIn = _getEnvULong( "SDL_AUDIO_LINEIN", 1, 0 );
// Set particular connector.
+ SDL_zero(stMCIConnector);
stMCIConnector.ulConnectorType = fLineIn ? MCI_LINE_IN_CONNECTOR
: MCI_MICROPHONE_CONNECTOR;
mciSendCommand( stMCIAmpOpen.usDeviceID, MCI_CONNECTOR,
@@ -323,6 +327,7 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
MCI_CONNECTOR_TYPE, &stMCIConnector, 0 );
// Disable monitor.
+ SDL_zero(stMCIAmpSet);
stMCIAmpSet.ulItem = MCI_AMP_SET_MONITOR;
mciSendCommand( stMCIAmpOpen.usDeviceID, MCI_SET,
MCI_WAIT | MCI_SET_OFF | MCI_SET_ITEM,
@@ -343,9 +348,13 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
this->spec.format = SDLAudioFmt;
this->spec.channels = this->spec.channels > 1 ? 2 : 1;
if ( this->spec.freq < 8000 )
+ {
this->spec.freq = 8000;
- if ( this->spec.freq > 48000 )
+ }
+ else if ( this->spec.freq > 48000 )
+ {
this->spec.freq = 48000;
+ }
// Setup mixer.
pAData->stMCIMixSetup.ulFormatTag = MCI_WAVE_FORMAT_PCM;