[PATCH 3/5] glx: Remove some obfuscatory macros

Adam Jackson ajax at redhat.com
Mon Mar 21 13:02:15 PDT 2011


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c               |   14 +++++++-------
 glx/glxserver.h             |    8 --------
 glx/single2.c               |    8 ++++----
 glx/single2swap.c           |    8 ++++----
 glx/singlepix.c             |    2 +-
 glx/singlepixswap.c         |    2 +-
 hw/dmx/glxProxy/glxserver.h |    8 --------
 hw/xwin/glx/indirect.c      |    2 +-
 8 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 6585080..66d4c7e 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -586,10 +586,10 @@ DoMakeCurrent(__GLXclientState *cl,
 	/*
 	** Flush the previous context if needed.
 	*/
-	if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
+	if (prevglxc->hasUnflushedCommands) {
 	    if (__glXForceCurrent(cl, tag, (int *)&error)) {
 		CALL_Flush( GET_DISPATCH(), () );
-		__GLX_NOTE_FLUSHED_CMDS(prevglxc);
+		prevglxc->hasUnflushedCommands = GL_FALSE;
 	    } else {
 		return error;
 	    }
@@ -855,7 +855,7 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
 	    ** in both streams are completed before the copy is executed.
 	    */
 	    CALL_Finish( GET_DISPATCH(), () );
-	    __GLX_NOTE_FLUSHED_CMDS(tagcx);
+	    tagcx->hasUnflushedCommands = GL_FALSE;
 	} else {
 	    return error;
 	}
@@ -1566,7 +1566,7 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
 	    ** in both streams are completed before the swap is executed.
 	    */
 	    CALL_Finish( GET_DISPATCH(), () );
-	    __GLX_NOTE_FLUSHED_CMDS(glxc);
+	    glxc->hasUnflushedCommands = GL_FALSE;
 	} else {
 	    return error;
 	}
@@ -1765,7 +1765,7 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
 	    ** in both streams are completed before the swap is executed.
 	    */
 	    CALL_Finish( GET_DISPATCH(), () );
-	    __GLX_NOTE_FLUSHED_CMDS(glxc);
+	    glxc->hasUnflushedCommands = GL_FALSE;
 	} else {
 	    return error;
 	}
@@ -1952,7 +1952,7 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
 	left -= cmdlen;
 	commandsDone++;
     }
-    __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+    glxc->hasUnflushedCommands = GL_TRUE;
     return Success;
 }
 
@@ -2149,7 +2149,7 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
 	    ** Skip over the header and execute the command.
 	    */
 	    (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
-	    __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+	    glxc->hasUnflushedCommands = GL_TRUE;
 
 	    /*
 	    ** Reset for the next RenderLarge series.
diff --git a/glx/glxserver.h b/glx/glxserver.h
index f10c8fe..e951126 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -100,14 +100,6 @@ extern ClientPtr __pGlxClient;
 
 int __glXError(int error);
 
-/*
-** Macros to set, unset, and retrieve the flag that says whether a context
-** has unflushed commands.
-*/
-#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
-#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
-#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
-
 /************************************************************************/
 
 typedef struct __GLXprovider __GLXprovider;
diff --git a/glx/single2.c b/glx/single2.c
index 07b89a8..9884f40 100644
--- a/glx/single2.c
+++ b/glx/single2.c
@@ -72,7 +72,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
 	cx->feedbackBufSize = size;
     }
     CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) );
-    __GLX_NOTE_UNFLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_TRUE;
     return Success;
 }
 
@@ -100,7 +100,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
 	cx->selectBufSize = size;
     }
     CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) );
-    __GLX_NOTE_UNFLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_TRUE;
     return Success;
 }
 
@@ -213,7 +213,7 @@ int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
 	}
 
 	CALL_Flush( GET_DISPATCH(), () );
-	__GLX_NOTE_FLUSHED_CMDS(cx);
+	cx->hasUnflushedCommands = GL_FALSE;
 	return Success;
 }
 
@@ -230,7 +230,7 @@ int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
 
     /* Do a local glFinish */
     CALL_Finish( GET_DISPATCH(), () );
-    __GLX_NOTE_FLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_FALSE;
 
     /* Send empty reply packet to indicate finish is finished */
     client = cl->client;
diff --git a/glx/single2swap.c b/glx/single2swap.c
index 04e50b4..e3afcab 100644
--- a/glx/single2swap.c
+++ b/glx/single2swap.c
@@ -72,7 +72,7 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
 	cx->feedbackBufSize = size;
     }
     CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) );
-    __GLX_NOTE_UNFLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_TRUE;
     return Success;
 }
 
@@ -103,7 +103,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
 	cx->selectBufSize = size;
     }
     CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) );
-    __GLX_NOTE_UNFLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_TRUE;
     return Success;
 }
 
@@ -229,7 +229,7 @@ int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
 	}
 
 	CALL_Flush( GET_DISPATCH(), () );
-	__GLX_NOTE_FLUSHED_CMDS(cx);
+	cx->hasUnflushedCommands = GL_FALSE;
 	return Success;
 }
 
@@ -248,7 +248,7 @@ int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
 
     /* Do a local glFinish */
     CALL_Finish( GET_DISPATCH(), () );
-    __GLX_NOTE_FLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_FALSE;
 
     /* Send empty reply packet to indicate finish is finished */
     client = cl->client;
diff --git a/glx/singlepix.c b/glx/singlepix.c
index a0a6a79..85fc486 100644
--- a/glx/singlepix.c
+++ b/glx/singlepix.c
@@ -91,7 +91,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
 	__GLX_SEND_HEADER();
 	__GLX_SEND_VOID_ARRAY(compsize);
     }
-    __GLX_NOTE_FLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_FALSE;
     return Success;
 }
 
diff --git a/glx/singlepixswap.c b/glx/singlepixswap.c
index a7febc9..bef99f6 100644
--- a/glx/singlepixswap.c
+++ b/glx/singlepixswap.c
@@ -102,7 +102,7 @@ int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
 	__GLX_SEND_HEADER();
 	__GLX_SEND_VOID_ARRAY(compsize);
     }
-    __GLX_NOTE_FLUSHED_CMDS(cx);
+    cx->hasUnflushedCommands = GL_FALSE;
     return Success;
 }
 
diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
index 17adce4..cd833f8 100644
--- a/hw/dmx/glxProxy/glxserver.h
+++ b/hw/dmx/glxProxy/glxserver.h
@@ -92,14 +92,6 @@ extern GLint __glXNumActiveScreens;
 extern __GLXcontext *__glXLastContext;
 extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
 
-/*
-** Macros to set, unset, and retrieve the flag that says whether a context
-** has unflushed commands.
-*/
-#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
-#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
-#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
-
 /************************************************************************/
 
 typedef struct {
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index e32ac51..bd2a1ad 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -859,7 +859,7 @@ glxWinDrawableDestroy(__GLXdrawable *base)
       // on the next context change)
       // (GLX core considers it an error when we try to select a new current context if the old one
       // has unflushed commands, but the window has disappeared..)
-      __GLX_NOTE_FLUSHED_CMDS(__glXLastContext);
+      __glXLastContext->hasUnflushedCommands = FALSE;
       __glXLastContext = NULL;
     }
 
-- 
1.7.4.1



More information about the xorg-devel mailing list