glx: use a block to fix declarations after code warning
authorBrian Paul <brianp@vmware.com>
Fri, 19 Aug 2011 14:36:22 +0000 (08:36 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 19 Aug 2011 14:36:22 +0000 (08:36 -0600)
src/glx/glxcmds.c

index fc0a07901a71a3281a2b3ba78bfed62df2c8e107..c8ec9c21fed8d20d3af40b4c0452901cd0d33e64 100644 (file)
@@ -794,15 +794,17 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
    gc = __glXGetCurrentContext();
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-   __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
+   {
+      __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
 
-   if (pdraw != NULL) {
-      if (gc && drawable == gc->currentDrawable) {
-        glFlush();
-      }
+      if (pdraw != NULL) {
+         if (gc && drawable == gc->currentDrawable) {
+            glFlush();
+         }
 
-      (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0);
-      return;
+         (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0);
+         return;
+      }
    }
 #endif