summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-14 02:28:15 -0700
committerChris Robinson <[email protected]>2011-06-14 02:28:15 -0700
commit9c7dad1bdf431090f76a3f164e9b9eebc5aa8e5b (patch)
treee8be9a9f782efa4f3e4f864609e5fb09130cd470
parentbfe09b933e7704ec888d060ea0cc6d6e41c859ca (diff)
Combine multiple probe functions into one
-rw-r--r--Alc/ALc.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index e4faf4d3..77f60eac 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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)