Mesa (master): Avoid compiler warning for unused glx_dpy variable.

Carl Worth cworth at kemper.freedesktop.org
Wed Jul 28 17:45:11 UTC 2010


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

Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jul 28 10:33:27 2010 -0700

Avoid compiler warning for unused glx_dpy variable.

My earlier attempt to eliminate this warning (c0ca2bfb2ad8c) was
invalid as it removed the variable declaration. Jerome correctly
reverted that (600c85efdb0ff) since the variable is used when
X_DRI2SwapBuffers is defined.

Here, instead of removing the declaration, we move it to inside the
correct #ifdef.

---

 src/glx/dri2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index d53431c..f288ab8 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -88,7 +88,6 @@ static Bool
 DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 {
    XExtDisplayInfo *info = DRI2FindDisplay(dpy);
-   __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy);
 
    XextCheckExtension(dpy, info, dri2ExtensionName, False);
 
@@ -100,6 +99,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
       GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
       xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
       __GLXDRIdrawable *pdraw;
+      __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy);
 
       /* Ignore swap events if we're not looking for them */
       pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);




More information about the mesa-commit mailing list