[GDI32] Add casts to silence warnings on x64
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 13 Jan 2019 14:29:13 +0000 (15:29 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 4 Mar 2019 20:58:42 +0000 (21:58 +0100)
The cast is required, because FARPROC is only compatible with function pointer types that return INT_PTR and the ones used return int/BOOL.

win32ss/gdi/gdi32/misc/wingl.c

index 13fee27..3e99344 100644 (file)
@@ -84,20 +84,20 @@ static BOOL OpenGLEnable(void)
                  thread-safe */
     }
 
-
-    if (!OpenGLInitFunction("wglChoosePixelFormat", &glChoosePixelFormat))
+    /* The cast is required on x64, because FARPROC has INT_PTR sized return */
+    if (!OpenGLInitFunction("wglChoosePixelFormat", (FARPROC*)&glChoosePixelFormat))
         Ret = FALSE;
 
-    if (!OpenGLInitFunction("wglSetPixelFormat", &glSetPixelFormat))
+    if (!OpenGLInitFunction("wglSetPixelFormat", (FARPROC*)&glSetPixelFormat))
         Ret = FALSE;
 
-    if (!OpenGLInitFunction("wglSwapBuffers", &glSwapBuffers))
+    if (!OpenGLInitFunction("wglSwapBuffers", (FARPROC*)&glSwapBuffers))
         Ret = FALSE;
 
-    if (!OpenGLInitFunction("wglDescribePixelFormat", &glDescribePixelFormat))
+    if (!OpenGLInitFunction("wglDescribePixelFormat", (FARPROC*)&glDescribePixelFormat))
         Ret = FALSE;
 
-    if (!OpenGLInitFunction("wglGetPixelFormat", &glGetPixelFormat))
+    if (!OpenGLInitFunction("wglGetPixelFormat", (FARPROC*)&glGetPixelFormat))
         Ret = FALSE;
 
     return Ret;