Commit 38fd0dc8 authored by Sam Lantinga's avatar Sam Lantinga

Patch from Ryan to fix compiler warnings

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401803
parent 15bcc2d4
...@@ -61,30 +61,27 @@ static x11dynlib x11libs[] = ...@@ -61,30 +61,27 @@ static x11dynlib x11libs[] =
{ NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR }, { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR },
}; };
static void *X11_GetSym(const char *fnname, int *rc) static void X11_GetSym(const char *fnname, int *rc, void **fn)
{ {
int i; int i;
void *fn = NULL;
for (i = 0; i < SDL_TABLESIZE(x11libs); i++) { for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
if (x11libs[i].lib != NULL) if (x11libs[i].lib != NULL)
{ {
fn = SDL_LoadFunction(x11libs[i].lib, fnname); *fn = SDL_LoadFunction(x11libs[i].lib, fnname);
if (fn != NULL) if (*fn != NULL)
break; break;
} }
} }
#if DEBUG_DYNAMIC_X11 #if DEBUG_DYNAMIC_X11
if (fn != NULL) if (*fn != NULL)
printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, fn); printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn);
else else
printf("X11: Symbol '%s' NOT FOUND!\n", fnname); printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
#endif #endif
if (fn == NULL) if (*fn == NULL)
*rc = 0; /* kill this module. */ *rc = 0; /* kill this module. */
return fn;
} }
...@@ -159,13 +156,13 @@ int SDL_X11_LoadSymbols(void) ...@@ -159,13 +156,13 @@ int SDL_X11_LoadSymbols(void)
} }
} }
#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname; #define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
#define SDL_X11_SYM(a,fn,x,y,z) p##fn = X11_GetSym(#fn,thismod); #define SDL_X11_SYM(a,fn,x,y,z) X11_GetSym(#fn,thismod,(void**)&p##fn);
#include "SDL_x11sym.h" #include "SDL_x11sym.h"
#undef SDL_X11_MODULE #undef SDL_X11_MODULE
#undef SDL_X11_SYM #undef SDL_X11_SYM
#ifdef X_HAVE_UTF8_STRING #ifdef X_HAVE_UTF8_STRING
pXCreateIC = X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8); X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8,(void **)&pXCreateIC);
#endif #endif
if (!SDL_X11_HAVE_BASEXLIB) { /* some required symbol didn't load. */ if (!SDL_X11_HAVE_BASEXLIB) { /* some required symbol didn't load. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment