diff --git a/src/x11/platform.h b/src/x11/platform.h index 6b8ae11e..61670be8 100644 --- a/src/x11/platform.h +++ b/src/x11/platform.h @@ -264,12 +264,10 @@ typedef struct _GLFWlibraryX11 struct { double resolution; long long t0; - } Timer; + } timer; #if defined(_GLFW_DLOPEN_LIBGL) - struct { - void* libGL; // dlopen handle for libGL.so - } Libs; + void* libGL; // dlopen handle for libGL.so #endif } _GLFWlibraryX11; diff --git a/src/x11/x11_glext.c b/src/x11/x11_glext.c index e5d47a7d..434ac4d9 100644 --- a/src/x11/x11_glext.c +++ b/src/x11/x11_glext.c @@ -45,7 +45,7 @@ void (*glXGetProcAddressEXT(const GLubyte* procName))(); #elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT) #define _glfw_glXGetProcAddress(x) glXGetProcAddressEXT(x) #elif defined(_GLFW_HAS_DLOPEN) - #define _glfw_glXGetProcAddress(x) dlsym(_glfwLibs.libGL,x) + #define _glfw_glXGetProcAddress(x) dlsym(_glfwLibrary.X11.libGL, x) #define _GLFW_DLOPEN_LIBGL #else #define _glfw_glXGetProcAddress(x) NULL diff --git a/src/x11/x11_init.c b/src/x11/x11_init.c index cf712f42..12af4f3c 100644 --- a/src/x11/x11_init.c +++ b/src/x11/x11_init.c @@ -54,11 +54,11 @@ static void initLibraries(void) NULL }; - _glfwLibrary.Libs.libGL = NULL; + _glfwLibrary.X11.libGL = NULL; for (i = 0; libGL_names[i] != NULL; i++) { - _glfwLibrary.Libs.libGL = dlopen(libGL_names[i], RTLD_LAZY | RTLD_GLOBAL); - if (_glfwLibrary.Libs.libGL) + _glfwLibrary.X11.libGL = dlopen(libGL_names[i], RTLD_LAZY | RTLD_GLOBAL); + if (_glfwLibrary.X11.libGL) break; } #endif @@ -191,10 +191,10 @@ int _glfwPlatformTerminate(void) // Unload libGL.so if necessary #ifdef _GLFW_DLOPEN_LIBGL - if (_glfwLibrary.Libs.libGL != NULL) + if (_glfwLibrary.X11.libGL != NULL) { - dlclose(_glfwLibrary.Libs.libGL); - _glfwLibrary.Libs.libGL = NULL; + dlclose(_glfwLibrary.X11.libGL); + _glfwLibrary.X11.libGL = NULL; } #endif diff --git a/src/x11/x11_time.c b/src/x11/x11_time.c index f779326d..62b574b3 100644 --- a/src/x11/x11_time.c +++ b/src/x11/x11_time.c @@ -40,11 +40,11 @@ void _glfwInitTimer(void) struct timeval tv; // "Resolution" is 1 us - _glfwLibrary.X11.Timer.resolution = 1e-6; + _glfwLibrary.X11.timer.resolution = 1e-6; // Set start-time for timer gettimeofday(&tv, NULL); - _glfwLibrary.X11.Timer.t0 = (long long) tv.tv_sec * (long long) 1000000 + + _glfwLibrary.X11.timer.t0 = (long long) tv.tv_sec * (long long) 1000000 + (long long) tv.tv_usec; } @@ -66,7 +66,7 @@ double _glfwPlatformGetTime(void) t = (long long) tv.tv_sec * (long long) 1000000 + (long long) tv.tv_usec; - return (double)(t - _glfwLibrary.X11.Timer.t0) * _glfwLibrary.X11.Timer.resolution; + return (double)(t - _glfwLibrary.X11.timer.t0) * _glfwLibrary.X11.timer.resolution; } @@ -84,6 +84,6 @@ void _glfwPlatformSetTime(double t) (long long) tv.tv_usec; // Calulate new starting time - _glfwLibrary.X11.Timer.t0 = t0 - (long long)(t / _glfwLibrary.X11.Timer.resolution); + _glfwLibrary.X11.timer.t0 = t0 - (long long)(t / _glfwLibrary.X11.timer.resolution); }