openal32: Avoid forward declarations of static arrays

Andrew Talbot andrew.talbot at talbotville.com
Fri Sep 9 16:12:55 CDT 2011


Changelog:
    openal32: Avoid forward declarations of static arrays.

Being static, thus having internal linkage, these declarations count as
tentative definitions, but would need their sizes to be specified (ugly) to be
correct.

diff --git a/dlls/openal32/openal.c b/dlls/openal32/openal.c
index 6a8e8f1..ec4149c 100644
--- a/dlls/openal32/openal.c
+++ b/dlls/openal32/openal.c
@@ -79,13 +79,8 @@ static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSlotfv)(ALuint sid, ALenum param,
 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSloti)(ALuint sid, ALenum param, ALint* value);
 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSlotiv)(ALuint sid, ALenum param, ALint* values);
 
-struct FuncList {
-    const char *name;
-    void *proc;
-};
-
-static const struct FuncList ALCFuncs[];
-static const struct FuncList ALFuncs[];
+extern ALCvoid* CDECL wine_alcGetProcAddress(ALCdevice *, const ALCchar *);
+extern ALvoid*  CDECL wine_alGetProcAddress(const ALchar*);
 
 static CRITICAL_SECTION openal_cs;
 static CRITICAL_SECTION_DEBUG openal_cs_debug =
@@ -238,25 +233,6 @@ ALCboolean CDECL wine_alcIsExtensionPresent(ALCdevice *device, const ALCchar *ex
     return alcIsExtensionPresent(device, extname);
 }
 
-ALCvoid* CDECL wine_alcGetProcAddress(ALCdevice *device, const ALCchar *funcname)
-{
-    void *proc;
-    int i;
-
-    /* Make sure the host implementation has the requested function */
-    proc = alcGetProcAddress(device, funcname);
-    if(!proc)
-        return NULL;
-
-    for(i = 0;ALCFuncs[i].name;i++)
-    {
-        if(strcmp(funcname, ALCFuncs[i].name) == 0)
-            return ALCFuncs[i].proc;
-    }
-    FIXME("Could not find function in list: %s\n", funcname);
-    return NULL;
-}
-
 ALCenum CDECL wine_alcGetEnumValue(ALCdevice *device, const ALCchar *enumname)
 {
     return alcGetEnumValue(device, enumname);
@@ -344,27 +320,6 @@ ALboolean CDECL wine_alIsExtensionPresent(const ALchar* extname)
     return alIsExtensionPresent(extname);
 }
 
-ALvoid* CDECL wine_alGetProcAddress(const ALchar* funcname)
-{
-    void *proc;
-    int i;
-
-    /* Make sure the host implementation has the requested function. This will
-     * also set the last AL error properly if the function should not be
-     * returned (eg. no current context). */
-    proc = alGetProcAddress(funcname);
-    if(!proc)
-        return NULL;
-
-    for(i = 0;ALFuncs[i].name;i++)
-    {
-        if(strcmp(funcname, ALFuncs[i].name) == 0)
-            return ALFuncs[i].proc;
-    }
-    FIXME("Could not find function in list: %s\n", funcname);
-    return NULL;
-}
-
 ALenum CDECL wine_alGetEnumValue(const ALchar* ename)
 {
     return alGetEnumValue(ename);
@@ -883,6 +838,10 @@ static ALCcontext* CDECL wine_alcGetThreadContext(ALCvoid)
     return alcGetThreadContext();
 }
 
+struct FuncList {
+    const char *name;
+    void *proc;
+};
 
 static const struct FuncList ALCFuncs[] = {
     { "alcCreateContext",           wine_alcCreateContext        },
@@ -1023,3 +982,45 @@ static const struct FuncList ALFuncs[] = {
 
     { NULL,                         NULL                         }
 };
+
+
+ALCvoid* CDECL wine_alcGetProcAddress(ALCdevice *device, const ALCchar *funcname)
+{
+    void *proc;
+    int i;
+
+    /* Make sure the host implementation has the requested function */
+    proc = alcGetProcAddress(device, funcname);
+    if(!proc)
+        return NULL;
+
+    for(i = 0;ALCFuncs[i].name;i++)
+    {
+        if(strcmp(funcname, ALCFuncs[i].name) == 0)
+            return ALCFuncs[i].proc;
+    }
+    FIXME("Could not find function in list: %s\n", funcname);
+    return NULL;
+}
+
+
+ALvoid* CDECL wine_alGetProcAddress(const ALchar* funcname)
+{
+    void *proc;
+    int i;
+
+    /* Make sure the host implementation has the requested function. This will
+     * also set the last AL error properly if the function should not be
+     * returned (eg. no current context). */
+    proc = alGetProcAddress(funcname);
+    if(!proc)
+        return NULL;
+
+    for(i = 0;ALFuncs[i].name;i++)
+    {
+        if(strcmp(funcname, ALFuncs[i].name) == 0)
+            return ALFuncs[i].proc;
+    }
+    FIXME("Could not find function in list: %s\n", funcname);
+    return NULL;
+}



More information about the wine-patches mailing list