[PATCH 14/14] Use ChangeGC instead of ChangeGCXIDs anywhere there can't be XIDs.

Jamey Sharp jamey at minilop.net
Sat May 8 16:39:29 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 composite/compalloc.c        |    4 ++--
 dix/dixfonts.c               |   14 +++++++++-----
 dix/gc.c                     |   18 ++++++++++--------
 dix/window.c                 |    8 ++++----
 fb/fbseg.c                   |    3 ++-
 glx/glxdriswrast.c           |   16 +++++-----------
 hw/kdrive/ephyr/ephyr_draw.c |   18 +++++++++---------
 hw/kdrive/src/kxv.c          |    8 ++++----
 hw/xfree86/common/xf86xv.c   |   14 +++++++-------
 hw/xfree86/xaa/xaaPCache.c   |    8 ++++----
 mi/miarc.c                   |   23 +++++++++++++----------
 mi/mibitblt.c                |   26 +++++++++++++-------------
 mi/midispcur.c               |   23 +++++++++++------------
 mi/miexpose.c                |    8 ++++----
 mi/miglblt.c                 |   32 ++++++++++++++++----------------
 mi/mipolypnt.c               |   12 ++++++------
 mi/miwideline.c              |   28 ++++++++++++++--------------
 mi/miwideline.h              |    6 ++++--
 mi/mizerarc.c                |    6 ++++--
 miext/cw/cw.c                |   16 ++++++++--------
 render/mirect.c              |   23 ++++++++++++-----------
 xfixes/region.c              |    8 ++++----
 22 files changed, 165 insertions(+), 157 deletions(-)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 0e8885b..7720a6d 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -497,10 +497,10 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
 	 */
 	if (pGC)
 	{
-	    XID val = IncludeInferiors;
+	    ChangeGCVal val = { IncludeInferiors };
 	    
 	    ValidateGC(&pPixmap->drawable, pGC);
-	    ChangeGCXIDs (serverClient, pGC, GCSubwindowMode, &val);
+	    ChangeGC (serverClient, pGC, GCSubwindowMode, &val);
 	    (*pGC->ops->CopyArea) (&pParent->drawable,
 				   &pPixmap->drawable,
 				   pGC,
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 6209bd5..7d31762 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1166,7 +1166,7 @@ badAlloc:
 
 #define TextEltHeader 2
 #define FontShiftSize 5
-static XID clearGC[] = { CT_NONE };
+static ChangeGCVal clearGC[] = { { .ptr = NullPixmap } };
 #define clearGCmask (GCClipMask)
 
 int
@@ -1261,7 +1261,9 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 	    {
 		if (pFont != c->pGC->font && c->pDraw)
 		{
-		    ChangeGCXIDs(NullClient, c->pGC, GCFont, &fid);
+		    ChangeGCVal val;
+		    val.ptr = pFont;
+		    ChangeGC(NullClient, c->pGC, GCFont, &val);
 		    ValidateGC(c->pDraw, c->pGC);
 		    if (c->reqType == X_PolyText8)
 			c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
@@ -1404,7 +1406,9 @@ bail:
 	/* Step 4 */
 	if (pFont != origGC->font)
 	{
-	    ChangeGCXIDs(NullClient, origGC, GCFont, &fid);
+	    ChangeGCVal val;
+	    val.ptr = pFont;
+	    ChangeGC(NullClient, origGC, GCFont, &val);
 	    ValidateGC(c->pDraw, origGC);
 	}
 
@@ -1423,7 +1427,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGCXIDs(NullClient, c->pGC, clearGCmask, clearGC);
+	ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
@@ -1580,7 +1584,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGCXIDs(NullClient, c->pGC, clearGCmask, clearGC);
+	ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
diff --git a/dix/gc.c b/dix/gc.c
index 9a50b9d..86b1b67 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -557,7 +557,7 @@ out:
 static Bool
 CreateDefaultTile (GCPtr pGC)
 {
-    XID		tmpval[3];
+    ChangeGCVal	tmpval[3];
     PixmapPtr 	pTile;
     GCPtr	pgcScratch;
     xRectangle	rect;
@@ -578,10 +578,10 @@ CreateDefaultTile (GCPtr pGC)
 	    FreeScratchGC(pgcScratch);
 	return FALSE;
     }
-    tmpval[0] = GXcopy;
-    tmpval[1] = pGC->tile.pixel;
-    tmpval[2] = FillSolid;
-    (void)ChangeGCXIDs(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval);
+    tmpval[0].val = GXcopy;
+    tmpval[1].val = pGC->tile.pixel;
+    tmpval[2].val = FillSolid;
+    (void)ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval);
     ValidateGC((DrawablePtr)pTile, pgcScratch);
     rect.x = 0;
     rect.y = 0;
@@ -899,7 +899,7 @@ Bool
 CreateDefaultStipple(int screenNum)
 {
     ScreenPtr pScreen;
-    XID tmpval[3];
+    ChangeGCVal tmpval[3];
     xRectangle rect;
     CARD16 w, h;
     GCPtr pgcScratch;
@@ -913,14 +913,16 @@ CreateDefaultStipple(int screenNum)
 			(*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
 	return FALSE;
     /* fill stipple with 1 */
-    tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid;
+    tmpval[0].val = GXcopy;
+    tmpval[1].val = 1;
+    tmpval[2].val = FillSolid;
     pgcScratch = GetScratchGC(1, pScreen);
     if (!pgcScratch)
     {
 	(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
 	return FALSE;
     }
-    (void)ChangeGCXIDs(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
+    (void)ChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
     ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
     rect.x = 0;
     rect.y = 0;
diff --git a/dix/window.c b/dix/window.c
index 67cfecc..b5daf7f 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -323,12 +323,12 @@ MakeRootTile(WindowPtr pWin)
 	FatalError("could not create root tile");
 
     {
-	CARD32 attributes[2];
+	ChangeGCVal attributes[2];
 
-	attributes[0] = pScreen->whitePixel;
-	attributes[1] = pScreen->blackPixel;
+	attributes[0].val = pScreen->whitePixel;
+	attributes[1].val = pScreen->blackPixel;
 
-	(void)ChangeGCXIDs(NullClient, pGC, GCForeground | GCBackground, attributes);
+	(void)ChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes);
     }
 
    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
diff --git a/fb/fbseg.c b/fb/fbseg.c
index 64ecd08..a4c2a8d 100644
--- a/fb/fbseg.c
+++ b/fb/fbseg.c
@@ -250,7 +250,8 @@ fbSetFg (DrawablePtr	pDrawable,
 {
     if (fg != pGC->fgPixel)
     {
-	ChangeGCXIDs (NullClient, pGC, GCForeground, &fg);
+	ChangeGCVal val = { fg };
+	ChangeGC (NullClient, pGC, GCForeground, &val);
 	ValidateGC (pDrawable, pGC);
     }
 }
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 5a562e3..6d17085 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -292,14 +292,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
     return &context->base;
 }
 
-static void
-glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
-{
-    CARD32 v[1];
-    v[0] = val;
-    ChangeGCXIDs(NullClient, gc, mask, v);
-}
-
 static __GLXdrawable *
 __glXDRIscreenCreateDrawable(__GLXscreen *screen,
 			     DrawablePtr pDraw,
@@ -307,6 +299,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
 			     XID drawId,
 			     __GLXconfig *glxConfig)
 {
+    ChangeGCVal gcvals[2];
     __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
     __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
     __GLXDRIdrawable *private;
@@ -331,9 +324,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
     private->gc = CreateScratchGC(pScreen, pDraw->depth);
     private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
 
-    glxChangeGC(private->gc, GCFunction, GXcopy);
-    glxChangeGC(private->swapgc, GCFunction, GXcopy);
-    glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE);
+    gcvals[0].val = GXcopy;
+    ChangeGC(NullClient, private->gc, GCFunction, gcvals);
+    gcvals[1].val = FALSE;
+    ChangeGC(NullClient, private->gc, GCFunction | GCGraphicsExposures, gcvals);
 
     private->driDrawable =
 	(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index 130c877..cc9ead7 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -97,17 +97,17 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
     KdScreenInfo *screen = pScreenPriv->screen;
     EphyrScrPriv *scrpriv = screen->driver;
     EphyrFakexaPriv *fakexa = scrpriv->fakexa;
-    CARD32 tmpval[3];
+    ChangeGCVal tmpval[3];
 
     ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST);
 
     fakexa->pDst = pPix;
     fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen);
 
-    tmpval[0] = alu;
-    tmpval[1] = pm;
-    tmpval[2] = fg;
-    ChangeGCXIDs(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval);
+    tmpval[0].val = alu;
+    tmpval[1].val = pm;
+    tmpval[2].val = fg;
+    ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval);
 
     ValidateGC(&pPix->drawable, fakexa->pGC);
 
@@ -161,7 +161,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
     KdScreenInfo *screen = pScreenPriv->screen;
     EphyrScrPriv *scrpriv = screen->driver;
     EphyrFakexaPriv *fakexa = scrpriv->fakexa;
-    CARD32 tmpval[2];
+    ChangeGCVal tmpval[2];
 
     ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
     ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
@@ -170,9 +170,9 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
     fakexa->pDst = pDst;
     fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen);
 
-    tmpval[0] = alu;
-    tmpval[1] = pm;
-    ChangeGCXIDs (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
+    tmpval[0].val = alu;
+    tmpval[1].val = pm;
+    ChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
 
     ValidateGC(&pDst->drawable, fakexa->pGC);
 
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index bcee666..277e0f8 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1867,7 +1867,7 @@ void
 KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
 {
     GCPtr	pGC;
-    CARD32    	val[2];
+    ChangeGCVal	val[2];
     xRectangle	*rects, *r;
     BoxPtr	pBox = REGION_RECTS (pRgn);
     int		nBox = REGION_NUM_RECTS (pRgn);
@@ -1890,9 +1890,9 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
     if (!pGC)
 	goto bail1;
 
-    val[0] = fg;
-    val[1] = IncludeInferiors;
-    ChangeGCXIDs (NullClient, pGC, GCForeground|GCSubwindowMode, val);
+    val[0].val = fg;
+    val[1].val = IncludeInferiors;
+    ChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val);
 
     ValidateGC (pDraw, pGC);
 
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index c6a9192..8e36415 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1834,7 +1834,6 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
    WindowPtr pWin = (WindowPtr)pDraw;
    XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
    GCPtr pGC = NULL;
-   XID pval[2];
    BoxPtr pbox = REGION_RECTS(clipboxes);
    int i, nbox = REGION_NUM_RECTS(clipboxes);
    xRectangle *rects;
@@ -1846,6 +1845,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
 
    if(!pGC) {
        int status;
+       XID pval[2];
        pval[0] = key;
        pval[1] = IncludeInferiors;
        pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status,
@@ -1854,8 +1854,8 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
        ValidateGC(pDraw, pGC);
        if (pPriv) pPriv->pGC = pGC;
    } else if (key != pGC->fgPixel){
-       pval[0] = key;
-       ChangeGCXIDs(NullClient, pGC, GCForeground, pval);
+       ChangeGCVal val = { key };
+       ChangeGC(NullClient, pGC, GCForeground, &val);
        ValidateGC(pDraw, pGC);
    }
 
@@ -1881,7 +1881,7 @@ void
 xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
 {
    DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
-   XID pval[2];
+   ChangeGCVal pval[2];
    BoxPtr pbox = REGION_RECTS(clipboxes);
    int i, nbox = REGION_NUM_RECTS(clipboxes);
    xRectangle *rects;
@@ -1890,9 +1890,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
    if(!xf86Screens[pScreen->myNum]->vtSema) return;
 
    gc = GetScratchGC(root->depth, pScreen);
-   pval[0] = key;
-   pval[1] = IncludeInferiors;
-   (void) ChangeGCXIDs(NullClient, gc, GCForeground|GCSubwindowMode, pval);
+   pval[0].val = key;
+   pval[1].val = IncludeInferiors;
+   (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval);
    ValidateGC(root, gc);
 
    rects = xalloc (nbox * sizeof(xRectangle));
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index dc84bf6..f772eaa 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1867,7 +1867,7 @@ XAAWriteBitmapToCacheLinear(
 ){
    ScreenPtr pScreen = pScrn->pScreen;
    PixmapPtr pScreenPix, pDstPix;
-   XID gcvals[2];
+   ChangeGCVal gcvals[2];
    GCPtr pGC;
 
    pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
@@ -1879,9 +1879,9 @@ XAAWriteBitmapToCacheLinear(
 					pScreenPix->devPrivate.ptr);
    
    pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
-   gcvals[0] = fg;
-   gcvals[1] = bg;
-   ChangeGCXIDs(NullClient, pGC, GCForeground | GCBackground, gcvals);
+   gcvals[0].val = fg;
+   gcvals[1].val = bg;
+   ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals);
    ValidateGC((DrawablePtr)pDstPix, pGC);
 
    /* We've unwrapped already so these ops miss a sync */
diff --git a/mi/miarc.c b/mi/miarc.c
index ee98afb..29e9638 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1130,14 +1130,14 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if (!pGCTo)
 		return;
 	    {
-		CARD32 gcvals[6];
-		gcvals[0] = GXcopy;
-		gcvals[1] = 1;
-		gcvals[2] = 0;
-		gcvals[3] = pGC->lineWidth;
-		gcvals[4] = pGC->capStyle;
-		gcvals[5] = pGC->joinStyle;
-		ChangeGCXIDs(NullClient, pGCTo, GCFunction |
+		ChangeGCVal gcvals[6];
+		gcvals[0].val = GXcopy;
+		gcvals[1].val = 1;
+		gcvals[2].val = 0;
+		gcvals[3].val = pGC->lineWidth;
+		gcvals[4].val = pGC->capStyle;
+		gcvals[5].val = pGC->joinStyle;
+		ChangeGC(NullClient, pGCTo, GCFunction |
 			GCForeground | GCBackground | GCLineWidth |
 			GCCapStyle | GCJoinStyle, gcvals);
 	    }
@@ -1179,11 +1179,14 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
  	     iphase >= 0;
 	     iphase--)
 	{
+	    ChangeGCVal gcval;
 	    if (iphase == 1) {
-		ChangeGCXIDs (NullClient, pGC, GCForeground, &bg);
+		gcval.val = bg;
+		ChangeGC (NullClient, pGC, GCForeground, &gcval);
 		ValidateGC (pDraw, pGC);
 	    } else if (pGC->lineStyle == LineDoubleDash) {
-		ChangeGCXIDs (NullClient, pGC, GCForeground, &fg);
+		gcval.val = fg;
+		ChangeGC (NullClient, pGC, GCForeground, &gcval);
 		ValidateGC (pDraw, pGC);
 	    }
 	    for (i = 0; i < polyArcs[iphase].narcs; i++) {
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 215a631..c305060 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -645,7 +645,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     unsigned char	depth;
     int			i, linelength, width, srcx, srcy;
     DDXPointRec		pt = {0, 0};
-    XID			gcv[2];
     PixmapPtr		pPixmap = NULL;
     GCPtr		pGC = NULL;
 
@@ -654,6 +653,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     {
 	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
 	{
+	    ChangeGCVal gcv;
 	    xPoint pt;
 
 	    pGC = GetScratchGC(depth, pDraw->pScreen);
@@ -677,8 +677,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
 				   TRUE);
  
 	    /* alu is already GXCopy */
-	    gcv[0] = (XID)planeMask;
-	    ChangeGCXIDs(NullClient, pGC, GCPlaneMask, gcv);
+	    gcv.val = (XID)planeMask;
+	    ChangeGC(NullClient, pGC, GCPlaneMask, &gcv);
 	    ValidateGC((DrawablePtr)pPixmap, pGC);
 	}
 
@@ -746,7 +746,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
     RegionPtr		prgnSrc;
     BoxRec		box;
     unsigned long	oldFg, oldBg;
-    XID			gcv[3];
+    ChangeGCVal		gcv[3];
     unsigned long	oldPlanemask;
     unsigned long	i;
     long		bytesPer;
@@ -773,26 +773,26 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	oldPlanemask = pGC->planemask;
 	oldFg = pGC->fgPixel;
 	oldBg = pGC->bgPixel;
-	gcv[0] = (XID)~0;
-	gcv[1] = (XID)0;
-	ChangeGCXIDs(NullClient, pGC, GCForeground | GCBackground, gcv);
+	gcv[0].val = (XID)~0;
+	gcv[1].val = (XID)0;
+	ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
 	bytesPer = (long)h * BitmapBytePad(w + leftPad);
 
 	for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
 	{
 	    if (i & oldPlanemask)
 	    {
-	        gcv[0] = (XID)i;
-	        ChangeGCXIDs(NullClient, pGC, GCPlaneMask, gcv);
+	        gcv[0].val = (XID)i;
+	        ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
 	        ValidateGC(pDraw, pGC);
 	        (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
 			         XYBitmap, (char *)pImage);
 	    }
 	}
-	gcv[0] = (XID)oldPlanemask;
-	gcv[1] = (XID)oldFg;
-	gcv[2] = (XID)oldBg;
-	ChangeGCXIDs(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
+	gcv[0].val = (XID)oldPlanemask;
+	gcv[1].val = (XID)oldFg;
+	gcv[2].val = (XID)oldBg;
+	ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
 	ValidateGC(pDraw, pGC);
 	break;
 
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 3efbbf5..7b21028 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -222,7 +222,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 {
     miDCCursorPtr   pPriv;
     GCPtr	    pGC;
-    XID		    gcvals[3];
+    ChangeGCVal	    gcvals;
 
     pPriv = xalloc (sizeof (miDCCursorRec));
     if (!pPriv)
@@ -305,22 +305,22 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->source);
-    gcvals[0] = GXand;
-    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
+    gcvals.val = GXand;
+    ChangeGC (NullClient, pGC, GCFunction, &gcvals);
     ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->mask);
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
-    gcvals[0] = GXcopy;
-    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
+    gcvals.val = GXcopy;
+    ChangeGC (NullClient, pGC, GCFunction, &gcvals);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->mask);
-    gcvals[0] = GXandInverted;
-    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
+    gcvals.val = GXandInverted;
+    ChangeGC (NullClient, pGC, GCFunction, &gcvals);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -365,13 +365,12 @@ miDCPutBits (
     unsigned long   source,
     unsigned long   mask)
 {
-    XID	    gcvals[1];
     int     x, y;
 
     if (sourceGC->fgPixel != source)
     {
-	gcvals[0] = source;
-	ChangeGCXIDs (NullClient, sourceGC, GCForeground, gcvals);
+	ChangeGCVal gcval = { source };
+	ChangeGC (NullClient, sourceGC, GCForeground, &gcval);
     }
     if (sourceGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, sourceGC);
@@ -390,8 +389,8 @@ miDCPutBits (
     (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
     if (maskGC->fgPixel != mask)
     {
-	gcvals[0] = mask;
-	ChangeGCXIDs (NullClient, maskGC, GCForeground, gcvals);
+	ChangeGCVal gcval = { mask };
+	ChangeGC (NullClient, maskGC, GCForeground, &gcval);
     }
     if (maskGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, maskGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index ef445c1..24b507f 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -683,17 +683,17 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 void
 miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
 {
-    XID fg = pGC->fgPixel;
-    XID bg = pGC->bgPixel;
+    ChangeGCVal fg = { pGC->fgPixel };
+    ChangeGCVal bg = { pGC->bgPixel };
     xRectangle rect;
 
     rect.x = 0;
     rect.y = 0;
     rect.width = pDraw->width;
     rect.height = pDraw->height;
-    ChangeGCXIDs(NullClient, pGC, GCForeground, &bg);
+    ChangeGC(NullClient, pGC, GCForeground, &bg);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-    ChangeGCXIDs(NullClient, pGC, GCForeground, &fg);
+    ChangeGC(NullClient, pGC, GCForeground, &fg);
     ValidateGC(pDraw, pGC);
 }
diff --git a/mi/miglblt.c b/mi/miglblt.c
index 6aac8c0..1517e89 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -107,7 +107,7 @@ miPolyGlyphBlt(
     int nbyGlyphWidth;		/* bytes per scanline of glyph */
     int nbyPadGlyph;		/* server padded line of glyph */
 
-    XID gcvals[3];
+    ChangeGCVal gcvals[3];
 
     if (pGC->miTranslate)
     {
@@ -134,11 +134,11 @@ miPolyGlyphBlt(
 	return;
     }
 
-    gcvals[0] = GXcopy;
-    gcvals[1] = 1;
-    gcvals[2] = 0;
+    gcvals[0].val = GXcopy;
+    gcvals[1].val = 1;
+    gcvals[2].val = 0;
 
-    ChangeGCXIDs(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals);
+    ChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals);
 
     nbyLine = BitmapBytePad(width);
     pbits = xalloc(height*nbyLine);
@@ -209,7 +209,7 @@ miImageGlyphBlt(
     )
 {
     ExtentInfoRec info;		/* used by QueryGlyphExtents() */
-    XID gcvals[3];
+    ChangeGCVal gcvals[3];
     int oldAlu, oldFS;
     unsigned long	oldFG;
     xRectangle backrect;
@@ -234,25 +234,25 @@ miImageGlyphBlt(
     oldFS = pGC->fillStyle;
 
     /* fill in the background */
-    gcvals[0] = GXcopy;
-    gcvals[1] = pGC->bgPixel;
-    gcvals[2] = FillSolid;
-    ChangeGCXIDs(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
+    gcvals[0].val = GXcopy;
+    gcvals[1].val = pGC->bgPixel;
+    gcvals[2].val = FillSolid;
+    ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
 
     /* put down the glyphs */
-    gcvals[0] = oldFG;
-    ChangeGCXIDs(NullClient, pGC, GCForeground, gcvals);
+    gcvals[0].val = oldFG;
+    ChangeGC(NullClient, pGC, GCForeground, gcvals);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
 			      pglyphBase);
 
     /* put all the toys away when done playing */
-    gcvals[0] = oldAlu;
-    gcvals[1] = oldFG;
-    gcvals[2] = oldFS;
-    ChangeGCXIDs(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
+    gcvals[0].val = oldAlu;
+    gcvals[1].val = oldFG;
+    gcvals[2].val = oldFS;
+    ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
     ValidateGC(pDrawable, pGC);
 
 }
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 1ac2a3b..3813f65 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -68,7 +68,7 @@ miPolyPoint(
     int 		xorg;
     int 		yorg;
     int 		nptTmp;
-    XID			fsOld, fsNew;
+    ChangeGCVal		fsOld;
     int			*pwidthInit, *pwidth;
     int			i;
     xPoint 		*ppt;
@@ -103,11 +103,11 @@ miPolyPoint(
 	}
     }
 
-    fsOld = pGC->fillStyle;
-    fsNew = FillSolid;
+    fsOld.val = pGC->fillStyle;
     if(pGC->fillStyle != FillSolid)
     {
-	ChangeGCXIDs(NullClient, pGC, GCFillStyle, &fsNew);
+	ChangeGCVal fsNew = { FillSolid };
+	ChangeGC(NullClient, pGC, GCFillStyle, &fsNew);
 	ValidateGC(pDrawable, pGC);
     }
     pwidth = pwidthInit;
@@ -115,9 +115,9 @@ miPolyPoint(
 	*pwidth++ = 1;
     (*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE); 
 
-    if(fsOld != FillSolid)
+    if(fsOld.val != FillSolid)
     {
-	ChangeGCXIDs(NullClient, pGC, GCFillStyle, &fsOld);
+	ChangeGC(NullClient, pGC, GCFillStyle, &fsOld);
 	ValidateGC(pDrawable, pGC);
     }
     xfree(pwidthInit);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 0e291a4..99aec16 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -113,8 +113,8 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S
 	XID oldPixel = pGC->fgPixel;
 	if (pixel != oldPixel)
 	{
-	    XID tmpPixel = (XID)pixel;
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &tmpPixel);
+	    ChangeGCVal tmpPixel = { (XID)pixel };
+	    ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
 	    ValidateGC (pDrawable, pGC);
 	}
 	(*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
@@ -122,7 +122,8 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S
 	xfree (spans->points);
 	if (pixel != oldPixel)
 	{
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &oldPixel);
+	    ChangeGCVal tmpPixel = { oldPixel };
+	    ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
 	    ValidateGC (pDrawable, pGC);
 	}
     }
@@ -259,14 +260,15 @@ miFillRectPolyHelper (
     	oldPixel = pGC->fgPixel;
     	if (pixel != oldPixel)
     	{
-	    XID tmpPixel = (XID)pixel;
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &tmpPixel);
+	    ChangeGCVal tmpPixel = { (XID)pixel };
+	    ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
     	    ValidateGC (pDrawable, pGC);
     	}
 	(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
     	if (pixel != oldPixel)
     	{
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &oldPixel);
+	    ChangeGCVal tmpPixel = { oldPixel };
+	    ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -1498,20 +1500,18 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
 {
     if (pGC->lineStyle == LineDoubleDash)
     {
-	XID oldPixel, pixel;
-	
-	pixel = pGC->bgPixel;
-	oldPixel = pGC->fgPixel;
-    	if (pixel != oldPixel)
+	ChangeGCVal oldPixel = { pGC->fgPixel };
+	if (pGC->bgPixel != oldPixel.val)
     	{
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &pixel);
+	    ChangeGCVal pixel = { pGC->bgPixel };
+	    ChangeGC (NullClient, pGC, GCForeground, &pixel);
     	    ValidateGC (pDrawable, pGC);
     	}
 	miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
 	miFreeSpanGroup (&spanData->bgGroup);
-    	if (pixel != oldPixel)
+	if (pGC->bgPixel != oldPixel.val)
     	{
-	    ChangeGCXIDs (NullClient, pGC, GCForeground, &oldPixel);
+	    ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 11a8e3a..1df386e 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -78,13 +78,15 @@ typedef struct _LineFace {
 #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     oldPixel = pGC->fgPixel; \
     if (pixel != oldPixel) { \
-	ChangeGCXIDs (NullClient, pGC, GCForeground, (XID *) &pixel); \
+	ChangeGCVal gcval = { pixel }; \
+	ChangeGC (NullClient, pGC, GCForeground, &gcval); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
 #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     if (pixel != oldPixel) { \
-	ChangeGCXIDs (NullClient, pGC, GCForeground, (XID *) &oldPixel); \
+	ChangeGCVal gcval = { oldPixel }; \
+	ChangeGC (NullClient, pGC, GCForeground, &gcval); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 348f07e..4a58f3b 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -803,7 +803,8 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		ChangeGCXIDs(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel);
+		ChangeGCVal gcval = { pGC->bgPixel };
+		ChangeGC(NullClient, pGC, GCForeground, &gcval);
 		ValidateGC(pDraw, pGC);
 	    }
 	    pts = &points[numPts >> 1];
@@ -831,7 +832,8 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		ChangeGCXIDs(NullClient, pGC, GCForeground, &fgPixel);
+		ChangeGCVal gcval = { fgPixel };
+		ChangeGC(NullClient, pGC, GCForeground, &gcval);
 		ValidateGC(pDraw, pGC);
 	    }
 	}
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 59b8ebd..cabb5c5 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -188,7 +188,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
     if (pDrawable->serialNumber != pPriv->serialNumber ||
 	(pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask)))
     {
-	XID vals[2];
+	ChangeGCVal vals[2];
 	RegionPtr   pCompositeClip;
 
 	pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
@@ -202,9 +202,9 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
 	(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
 					  (pointer) pCompositeClip, 0);
 	
-	vals[0] = x_off - pDrawable->x;
-	vals[1] = y_off - pDrawable->y;
-	ChangeGCXIDs(NullClient, pBackingGC,
+	vals[0].val = x_off - pDrawable->x;
+	vals[1].val = y_off - pDrawable->y;
+	ChangeGC(NullClient, pBackingGC,
 		    (GCClipXOrigin | GCClipYOrigin), vals);
 
 	pPriv->serialNumber = pDrawable->serialNumber;
@@ -223,10 +223,10 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
     if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x ||
 	(pGC->patOrg.y + y_off) != pBackingGC->patOrg.y)
     {
-	XID vals[2];
-	vals[0] = pGC->patOrg.x + x_off;
-	vals[1] = pGC->patOrg.y + y_off;
-	ChangeGCXIDs(NullClient, pBackingGC,
+	ChangeGCVal vals[2];
+	vals[0].val = pGC->patOrg.x + x_off;
+	vals[1].val = pGC->patOrg.y + y_off;
+	ChangeGC(NullClient, pBackingGC,
 		    (GCTileStipXOrigin | GCTileStipYOrigin), vals);
     }
 
diff --git a/render/mirect.c b/render/mirect.c
index 70dc9c3..13d7fa6 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -45,7 +45,7 @@ miColorRects (PicturePtr    pDst,
     ScreenPtr		pScreen = pDst->pDrawable->pScreen;
     CARD32		pixel;
     GCPtr		pGC;
-    CARD32		tmpval[5];
+    ChangeGCVal		tmpval[5];
     RegionPtr		pClip;
     unsigned long	mask;
 
@@ -54,14 +54,14 @@ miColorRects (PicturePtr    pDst,
     pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
     if (!pGC)
 	return;
-    tmpval[0] = GXcopy;
-    tmpval[1] = pixel;
-    tmpval[2] = pDst->subWindowMode;
+    tmpval[0].val = GXcopy;
+    tmpval[1].val = pixel;
+    tmpval[2].val = pDst->subWindowMode;
     mask = GCFunction | GCForeground | GCSubwindowMode;
     if (pClipPict->clientClipType == CT_REGION)
     {
-	tmpval[3] = pDst->clipOrigin.x - xoff;
-	tmpval[4] = pDst->clipOrigin.y - yoff;
+	tmpval[3].val = pDst->clipOrigin.x - xoff;
+	tmpval[4].val = pDst->clipOrigin.y - yoff;
 	mask |= GCClipXOrigin|GCClipYOrigin;
 	
 	pClip = REGION_CREATE (pScreen, NULL, 1);
@@ -70,7 +70,7 @@ miColorRects (PicturePtr    pDst,
 	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
     }
 
-    ChangeGCXIDs (NullClient, pGC, mask, tmpval);
+    ChangeGC (NullClient, pGC, mask, tmpval);
     ValidateGC (pDst->pDrawable, pGC);
     if (xoff || yoff)
     {
@@ -129,7 +129,8 @@ miCompositeRects (CARD8		op,
 	int		error;
 	Pixel		pixel;
 	GCPtr		pGC;
-	CARD32		tmpval[2];
+	ChangeGCVal	gcvals[2];
+	XID		tmpval[1];
 
 	rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
 	if (!rgbaFormat)
@@ -145,10 +146,10 @@ miCompositeRects (CARD8		op,
 	pGC = GetScratchGC (rgbaFormat->depth, pScreen);
 	if (!pGC)
 	    goto bail3;
-	tmpval[0] = GXcopy;
-	tmpval[1] = pixel;
+	gcvals[0].val = GXcopy;
+	gcvals[1].val = pixel;
 
-	ChangeGCXIDs (NullClient, pGC, GCFunction | GCForeground, tmpval);
+	ChangeGC (NullClient, pGC, GCFunction | GCForeground, gcvals);
 	ValidateGC (&pPixmap->drawable, pGC);
 	one.x = 0;
 	one.y = 0;
diff --git a/xfixes/region.c b/xfixes/region.c
index 1cf36ea..58eeaa2 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -623,7 +623,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
 {
     GCPtr	pGC;
     RegionPtr	pRegion;
-    XID		vals[2];
+    ChangeGCVal	vals[2];
     int		rc;
     REQUEST(xXFixesSetGCClipRegionReq);
     REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
@@ -641,9 +641,9 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
 	    return BadAlloc;
     }
     
-    vals[0] = stuff->xOrigin;
-    vals[1] = stuff->yOrigin;
-    ChangeGCXIDs (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals);
+    vals[0].val = stuff->xOrigin;
+    vals[1].val = stuff->yOrigin;
+    ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals);
     (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
 
     return (client->noClientException);
-- 
1.7.0



More information about the xorg-devel mailing list