diff options
author | Chris Robinson <[email protected]> | 2011-06-14 02:28:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-06-14 02:28:15 -0700 |
commit | 9c7dad1bdf431090f76a3f164e9b9eebc5aa8e5b (patch) | |
tree | e8be9a9f782efa4f3e4f864609e5fb09130cd470 /Alc | |
parent | bfe09b933e7704ec888d060ea0cc6d6e41c859ca (diff) |
Combine multiple probe functions into one
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 32 |
1 files changed, 9 insertions, 23 deletions
@@ -626,38 +626,24 @@ static void alc_deinit(void) } -static void ProbeDeviceList() +static void ProbeList(ALCchar **list, size_t *listsize, int type) { ALint i; - free(alcDeviceList); alcDeviceList = NULL; - alcDeviceListSize = 0; + free(*list); + *list = NULL; + *listsize = 0; for(i = 0;BackendList[i].Probe;i++) - BackendList[i].Probe(DEVICE_PROBE); + BackendList[i].Probe(type); } +static void ProbeDeviceList() +{ ProbeList(&alcDeviceList, &alcDeviceListSize, DEVICE_PROBE); } static void ProbeAllDeviceList() -{ - ALint i; - - free(alcAllDeviceList); alcAllDeviceList = NULL; - alcAllDeviceListSize = 0; - - for(i = 0;BackendList[i].Probe;i++) - BackendList[i].Probe(ALL_DEVICE_PROBE); -} - +{ ProbeList(&alcAllDeviceList, &alcAllDeviceListSize, ALL_DEVICE_PROBE); } static void ProbeCaptureDeviceList() -{ - ALint i; - - free(alcCaptureDeviceList); alcCaptureDeviceList = NULL; - alcCaptureDeviceListSize = 0; - - for(i = 0;BackendList[i].Probe;i++) - BackendList[i].Probe(CAPTURE_DEVICE_PROBE); -} +{ ProbeList(&alcCaptureDeviceList, &alcCaptureDeviceListSize, CAPTURE_DEVICE_PROBE); } static void AppendList(const ALCchar *name, ALCchar **List, size_t *ListSize) |