From f6c1a21cf0adebdebaa302132055a73028faafde Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 22 Sep 2009 04:42:46 -0700 Subject: Properly flip the backend entries when sorting the device list --- Alc/ALc.c | 16 ++++++---------- 1 file 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++; } -- cgit v1.2.3