wgl: silence some cast-warnings
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 15 Apr 2020 19:11:44 +0000 (21:11 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 14:48:40 +0000 (14:48 +0000)
These casts cause warnings on x64. We're passing integers through
pointers, which works fine.

So let's make the casts a bit more explicit, to silence that warning.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

src/gallium/state_trackers/wgl/stw_ext_context.c
src/gallium/state_trackers/wgl/stw_wgl.c

index fc866892175ebed8c12ab8ee2c092ae24c8fa1ed..4171987f89c182f577970bd7a3b162ef915b64fb 100644 (file)
@@ -179,8 +179,8 @@ wglCreateContextAttribsARB(HDC hDC, HGLRC hShareContext, const int *attribList)
       }
       else {
          /* not using ICD */
-         dhglrc = (DHGLRC) context;
-         share_dhglrc = (DHGLRC) hShareContext;
+         dhglrc = (DHGLRC)(INT_PTR)context;
+         share_dhglrc = (DHGLRC)(INT_PTR)hShareContext;
       }
 
       c = stw_create_context_attribs(hDC, layerPlane, share_dhglrc,
index 443158271128669106a509e86efcd6afd25dfb8c..9103c750ea9b3b1da50b2788a00b8553a9291194 100644 (file)
@@ -68,7 +68,7 @@ wglCreateContext(
    HDC hdc )
 {
    overrideOpenGL32EntryPoints();
-   return (HGLRC) DrvCreateContext(hdc);
+   return (HGLRC)(UINT_PTR)DrvCreateContext(hdc);
 }
 
 WINGDIAPI HGLRC APIENTRY
@@ -77,7 +77,7 @@ wglCreateLayerContext(
    int iLayerPlane )
 {
    overrideOpenGL32EntryPoints();
-   return (HGLRC) DrvCreateLayerContext( hdc, iLayerPlane );
+   return (HGLRC)(UINT_PTR)DrvCreateLayerContext( hdc, iLayerPlane );
 }
 
 WINGDIAPI BOOL APIENTRY