egl: Silence warnings when compiled with -pedantic.

Just follow gcc's advices here.
This commit is contained in:
Chia-I Wu
2010-02-19 11:47:54 +08:00
parent bef4b476d7
commit 496724b869
4 changed files with 10 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ enum {
ATTRIB_CRITERION_ATLEAST, ATTRIB_CRITERION_ATLEAST,
ATTRIB_CRITERION_MASK, ATTRIB_CRITERION_MASK,
ATTRIB_CRITERION_SPECIAL, ATTRIB_CRITERION_SPECIAL,
ATTRIB_CRITERION_IGNORE, ATTRIB_CRITERION_IGNORE
}; };

View File

@@ -14,6 +14,8 @@ enum _egl_resource_type {
_EGL_NUM_RESOURCES _EGL_NUM_RESOURCES
}; };
/* this cannot and need not go into egltypedefs.h */
typedef enum _egl_resource_type _EGLResourceType;
/** /**

View File

@@ -144,7 +144,13 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain"); mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain");
#elif defined(_EGL_PLATFORM_POSIX) #elif defined(_EGL_PLATFORM_POSIX)
if (lib) { if (lib) {
mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); union {
_EGLMain_t func;
void *ptr;
} tmp = { NULL };
/* direct cast gives a warning when compiled with -pedantic */
tmp.ptr = dlsym(lib, "_eglMain");
mainFunc = tmp.func;
if (!mainFunc) if (!mainFunc)
error = dlerror(); error = dlerror();
} }

View File

@@ -8,8 +8,6 @@
#include "eglcompiler.h" #include "eglcompiler.h"
typedef enum _egl_resource_type _EGLResourceType;
typedef struct _egl_api _EGLAPI; typedef struct _egl_api _EGLAPI;
typedef struct _egl_config _EGLConfig; typedef struct _egl_config _EGLConfig;