aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-19 03:01:02 -0700
committerChris Robinson <[email protected]>2011-08-19 03:01:57 -0700
commitb40aa8636b6216f1ee49e75c26f5f52c5eb3248f (patch)
tree3e3bf35ba4d0b82008c6e8e0e10985a03846350b /Alc
parentb3645df56fa96371c1818f950f380935d8095800 (diff)
Remove a couple unneeded variables
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 541da2a5..6f7b6acd 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1630,7 +1630,6 @@ static ALCvoid FreeContext(ALCcontext *context)
// This should probably move to another c file but for now ...
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei SampleSize)
{
- ALCboolean DeviceFound = ALC_FALSE;
ALCdevice *device = NULL;
DO_INITCONFIG();
@@ -1686,18 +1685,15 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
device->next = g_pDeviceList;
g_pDeviceList = device;
g_ulDeviceCount++;
-
- DeviceFound = ALC_TRUE;
}
- UnlockLists();
-
- if(!DeviceFound)
+ else
{
- alcSetError(NULL, ALC_INVALID_VALUE);
DeleteCriticalSection(&device->Mutex);
free(device);
device = NULL;
+ alcSetError(NULL, ALC_INVALID_VALUE);
}
+ UnlockLists();
return device;
}
@@ -2691,7 +2687,6 @@ static void GetFormatFromString(const char *str, enum DevFmtChannels *chans, enu
*/
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
{
- ALboolean bDeviceFound = AL_FALSE;
const ALCchar *fmt;
ALCdevice *device;
@@ -2776,19 +2771,16 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->next = g_pDeviceList;
g_pDeviceList = device;
g_ulDeviceCount++;
-
- bDeviceFound = AL_TRUE;
}
- UnlockLists();
-
- if(!bDeviceFound)
+ else
{
// No suitable output device found
- alcSetError(NULL, ALC_INVALID_VALUE);
DeleteCriticalSection(&device->Mutex);
free(device);
device = NULL;
+ alcSetError(NULL, ALC_INVALID_VALUE);
}
+ UnlockLists();
return device;
}