glx: move declarations before code
authorBrian Paul <brianp@vmware.com>
Wed, 26 Jun 2013 19:38:18 +0000 (13:38 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 27 Jun 2013 13:48:18 +0000 (07:48 -0600)
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/glx/glxcmds.c
src/glx/single2.c

index 5c79073a9ccfd4e0725ecd10b74ee1024b748955..224e402c8caae2d381a1ff57db796b37a3116326 100644 (file)
@@ -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);
index 103558fb5b2325013651646cf8ce54dfe19e0de3..54f51ad7fd825ec02fda01c7310c51921de4dc13 100644 (file)
@@ -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,