diff --git a/src/context.c b/src/context.c index d32bb5a9..71c9bc03 100644 --- a/src/context.c +++ b/src/context.c @@ -490,16 +490,16 @@ GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig) return GL_TRUE; } -int _glfwStringInExtensionString(const char* string, const GLubyte* extensions) +int _glfwStringInExtensionString(const char* string, const char* extensions) { - const GLubyte* start = extensions; + const char* start = extensions; for (;;) { - GLubyte* where; - GLubyte* terminator; + const char* where; + const char* terminator; - where = (GLubyte*) strstr((const char*) start, string); + where = strstr(start, string); if (!where) return GL_FALSE; @@ -602,7 +602,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension) { // Check if extension is in the old style OpenGL extensions string - const GLubyte* extensions = glGetString(GL_EXTENSIONS); + const char* extensions = (const char*) glGetString(GL_EXTENSIONS); if (!extensions) { _glfwInputError(GLFW_PLATFORM_ERROR, diff --git a/src/egl_context.c b/src/egl_context.c index d6226238..c2c541f0 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -476,12 +476,10 @@ void _glfwPlatformSwapInterval(int interval) int _glfwPlatformExtensionSupported(const char* extension) { - const char* extensions; - - extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS); - if (extensions != NULL) + const char* extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS); + if (extensions) { - if (_glfwStringInExtensionString(extension, (unsigned char*) extensions)) + if (_glfwStringInExtensionString(extension, extensions)) return GL_TRUE; } diff --git a/src/glx_context.c b/src/glx_context.c index b2c8e7e3..79d6eb5e 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -509,10 +509,8 @@ void _glfwPlatformSwapInterval(int interval) int _glfwPlatformExtensionSupported(const char* extension) { - const GLubyte* extensions = - (const GLubyte*) glXQueryExtensionsString(_glfw.x11.display, - _glfw.x11.screen); - + const char* extensions = glXQueryExtensionsString(_glfw.x11.display, + _glfw.x11.screen); if (extensions) { if (_glfwStringInExtensionString(extension, extensions)) diff --git a/src/internal.h b/src/internal.h index 986f6230..80038c63 100644 --- a/src/internal.h +++ b/src/internal.h @@ -799,7 +799,7 @@ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue); * @return `GL_TRUE` if the extension was found, or `GL_FALSE` otherwise. * @ingroup utility */ -int _glfwStringInExtensionString(const char* string, const GLubyte* extensions); +int _glfwStringInExtensionString(const char* string, const char* extensions); /*! @brief Chooses the framebuffer config that best matches the desired one. * @param[in] desired The desired framebuffer config. diff --git a/src/wgl_context.c b/src/wgl_context.c index 7514ac6d..e76f3cf7 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -605,14 +605,14 @@ void _glfwPlatformSwapInterval(int interval) int _glfwPlatformExtensionSupported(const char* extension) { - const GLubyte* extensions; + const char* extensions; _GLFWwindow* window = _glfwPlatformGetCurrentContext(); if (window->wgl.GetExtensionsStringEXT != NULL) { - extensions = (GLubyte*) window->wgl.GetExtensionsStringEXT(); - if (extensions != NULL) + extensions = window->wgl.GetExtensionsStringEXT(); + if (extensions) { if (_glfwStringInExtensionString(extension, extensions)) return GL_TRUE; @@ -621,8 +621,8 @@ int _glfwPlatformExtensionSupported(const char* extension) if (window->wgl.GetExtensionsStringARB != NULL) { - extensions = (GLubyte*) window->wgl.GetExtensionsStringARB(window->wgl.dc); - if (extensions != NULL) + extensions = window->wgl.GetExtensionsStringARB(window->wgl.dc); + if (extensions) { if (_glfwStringInExtensionString(extension, extensions)) return GL_TRUE;