From 832dc8a5857ff492502f23f9604d1b3e27718e24 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 27 Aug 2009 18:55:18 -0700 Subject: Remove unnecessary vars and rework device name checks --- Alc/wave.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Alc/wave.c') diff --git a/Alc/wave.c b/Alc/wave.c index d960588c..4ced5baf 100644 --- a/Alc/wave.c +++ b/Alc/wave.c @@ -108,7 +108,6 @@ static ALuint WaveProc(ALvoid *ptr) static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceName) { - const char *devName = waveDevice; wave_data *data; const char *fname; @@ -116,12 +115,10 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam if(!fname[0]) return ALC_FALSE; - if(deviceName) - { - if(strcmp(deviceName, waveDevice) != 0) - return ALC_FALSE; - devName = waveDevice; - } + if(!deviceName) + deviceName = waveDevice; + else if(strcmp(deviceName, waveDevice) != 0) + return ALC_FALSE; data = (wave_data*)calloc(1, sizeof(wave_data)); @@ -133,7 +130,7 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam return ALC_FALSE; } - device->szDeviceName = strdup(devName); + device->szDeviceName = strdup(deviceName); device->ExtraData = data; return ALC_TRUE; } -- cgit v1.2.3