aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-22 04:42:46 -0700
committerChris Robinson <[email protected]>2009-09-22 04:42:46 -0700
commitf6c1a21cf0adebdebaa302132055a73028faafde (patch)
tree856e23297b6126764469f12c14568df0ed8d1479 /Alc
parentc953072a152e73fcdcc58bd6c836302dad6620b8 (diff)
Properly flip the backend entries when sorting the device list
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 9c460267..ff81d4b1 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -40,13 +40,14 @@
#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-static struct {
+typedef struct BackendInfo {
const char *name;
void (*Init)(BackendFuncs*);
void (*Deinit)(void);
void (*Probe)(int);
BackendFuncs Funcs;
-} BackendList[] = {
+} BackendInfo;
+static BackendInfo BackendList[] = {
#ifdef HAVE_ALSA
{ "alsa", alc_alsa_init, alc_alsa_deinit, alc_alsa_probe, EmptyFuncs },
#endif
@@ -273,14 +274,9 @@ static void alc_init(void)
if(len == strlen(BackendList[n].name) &&
strncmp(BackendList[n].name, devs, len) == 0)
{
- const char *name = BackendList[i].name;
- void (*Init)(BackendFuncs*) = BackendList[i].Init;
-
- BackendList[i].name = BackendList[n].name;
- BackendList[i].Init = BackendList[n].Init;
-
- BackendList[n].name = name;
- BackendList[n].Init = Init;
+ BackendInfo Bkp = BackendList[i];
+ BackendList[i] = BackendList[n];
+ BackendList[n] = Bkp;
i++;
}