Put quotes around the CC and CXX variables passed to mklib. This make
[mesa.git] / src / glx / x11 / glxext.c
index c24e22ff4f81c52a4653d3d7095561dfa65ebbbe..397b39018935fffe60d9ef6fa09049cd021c8d79 100644 (file)
@@ -1263,23 +1263,23 @@ CARD8 __glXSetupForCommand(Display *dpy)
     return priv->majorOpcode;
 }
 
-/*
-** Flush the drawing command transport buffer.
-*/
+/**
+ * Flush the drawing command transport buffer.
+ * 
+ * \param ctx  Context whose transport buffer is to be flushed.
+ * \param pc   Pointer to first unused buffer location.
+ * 
+ * \todo
+ * Modify this function to use \c ctx->pc instead of the explicit
+ * \c pc parameter.
+ */
 GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
 {
-    Display *dpy;
+    Display * const dpy = ctx->currentDpy;
     xGLXRenderReq *req;
-    GLint size;
-
-    if (!(dpy = ctx->currentDpy)) {
-       /* Using the dummy context */
-       ctx->pc = ctx->buf;
-       return ctx->pc;
-    }
+    const GLint size = pc - ctx->buf;
 
-    size = pc - ctx->buf;
-    if (size) {
+    if ( (dpy != NULL) && (size > 0) ) {
        /* Send the entire buffer as an X request */
        LockDisplay(dpy);
        GetReq(GLXRender,req); 
@@ -1523,13 +1523,14 @@ static Bool BindContextWrapper( Display *dpy, GLXContext gc,
        return (*gc->driContext.bindContext3)(dpy, gc->screen, draw, read, 
                                              & gc->driContext);
     }
+#ifndef DRI_NEW_INTERFACE_ONLY
     else {
        return (*gc->driContext.bindContext2)(dpy, gc->screen, draw, read,
                                              gc);
     }
-#else
-    return GL_FALSE;
 #endif
+#endif
+    return GL_FALSE;
 }
 
 
@@ -1542,14 +1543,15 @@ static Bool UnbindContextWrapper( Display *dpy, GLXContext gc )
                                                gc->currentReadable,
                                                & gc->driContext );
     }
+#ifndef DRI_NEW_INTERFACE_ONLY
     else {
        return (*gc->driContext.unbindContext2)(dpy, gc->screen,
                                                gc->currentDrawable,
                                                gc->currentReadable, gc);
     }
-#else
-    return GL_FALSE;
 #endif
+#endif
+    return GL_FALSE;
 }