[Mesa-dev] [PATCH 2/4] glx: move declarations before code

Brian Paul brianp at vmware.com
Wed Jun 26 12:50:38 PDT 2013


---
 src/glx/glxcmds.c |   15 +++++++--------
 src/glx/single2.c |    3 ++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 5c79073..224e402 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -575,20 +575,19 @@ static Bool
 __glXIsDirect(Display * dpy, GLXContextID contextID)
 {
    CARD8 opcode;
+   xcb_connection_t *c;
+   xcb_generic_error_t *err;
+   xcb_glx_is_direct_reply_t *reply;
+   Bool is_direct;
 
    opcode = __glXSetupForCommand(dpy);
    if (!opcode) {
       return GL_FALSE;
    }
 
-   xcb_connection_t *c = XGetXCBConnection(dpy);
-   xcb_generic_error_t *err;
-   xcb_glx_is_direct_reply_t *reply = xcb_glx_is_direct_reply(c,
-                                                              xcb_glx_is_direct
-                                                              (c, contextID),
-                                                              &err);
-
-   const Bool is_direct = (reply != NULL && reply->is_direct) ? True : False;
+   c = XGetXCBConnection(dpy);
+   reply = xcb_glx_is_direct_reply(c, xcb_glx_is_direct(c, contextID), &err);
+   is_direct = (reply != NULL && reply->is_direct) ? True : False;
 
    if (err != NULL) {
       __glXSendErrorForXcb(dpy, err);
diff --git a/src/glx/single2.c b/src/glx/single2.c
index 103558f..54f51ad 100644
--- a/src/glx/single2.c
+++ b/src/glx/single2.c
@@ -886,8 +886,9 @@ __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures,
    GLboolean retval = (GLboolean) 0;
    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
       xcb_connection_t *c = XGetXCBConnection(dpy);
+      xcb_glx_are_textures_resident_reply_t *reply;
       (void) __glXFlushRenderBuffer(gc, gc->pc);
-      xcb_glx_are_textures_resident_reply_t *reply =
+      reply =
          xcb_glx_are_textures_resident_reply(c,
                                              xcb_glx_are_textures_resident
                                              (c, gc->currentContextTag, n,
-- 
1.7.10.4



More information about the mesa-dev mailing list