Mesa (master): wgl: silence some cast-warnings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 16 15:09:18 UTC 2020


Module: Mesa
Branch: master
Commit: 522bb081314131340804a160d5d53f2fbe9a10be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=522bb081314131340804a160d5d53f2fbe9a10be

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Apr 15 21:11:44 2020 +0200

wgl: silence some cast-warnings

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 at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>

---

 src/gallium/state_trackers/wgl/stw_ext_context.c | 4 ++--
 src/gallium/state_trackers/wgl/stw_wgl.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_ext_context.c b/src/gallium/state_trackers/wgl/stw_ext_context.c
index fc866892175..4171987f89c 100644
--- a/src/gallium/state_trackers/wgl/stw_ext_context.c
+++ b/src/gallium/state_trackers/wgl/stw_ext_context.c
@@ -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,
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.c b/src/gallium/state_trackers/wgl/stw_wgl.c
index 44315827112..9103c750ea9 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.c
+++ b/src/gallium/state_trackers/wgl/stw_wgl.c
@@ -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



More information about the mesa-commit mailing list