[PATCH 5/5] Replace dixChangeGC with calls directly to the right variant.

Jamey Sharp jamey at minilop.net
Fri May 7 20:24:00 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 composite/compalloc.c        |    2 +-
 dbe/dbe.c                    |    2 +-
 dix/dispatch.c               |    2 +-
 dix/dixfonts.c               |    8 ++--
 dix/gc.c                     |   71 +++++++++++++++--------------------------
 dix/glyphcurs.c              |    5 +--
 dix/window.c                 |   13 +++----
 fb/fbseg.c                   |    2 +-
 glx/glxdriswrast.c           |    2 +-
 hw/kdrive/ephyr/ephyr_draw.c |    4 +-
 hw/kdrive/src/kxv.c          |    2 +-
 hw/xfree86/common/xf86xv.c   |    4 +-
 hw/xfree86/xaa/xaaPCache.c   |    2 +-
 include/gc.h                 |    9 ++++-
 mi/miarc.c                   |    6 ++--
 mi/mibitblt.c                |   23 ++++++-------
 mi/midispcur.c               |   10 +++---
 mi/miexpose.c                |    6 ++--
 mi/miglblt.c                 |    8 ++--
 mi/mipolypnt.c               |    4 +-
 mi/miwideline.c              |   16 +++++-----
 mi/miwideline.h              |    4 +-
 mi/mizerarc.c                |    4 +-
 miext/cw/cw.c                |    8 ++--
 render/mirect.c              |    4 +-
 xfixes/region.c              |    2 +-
 26 files changed, 103 insertions(+), 120 deletions(-)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 73adc72..55d863f 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -500,7 +500,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
 	    XID val = IncludeInferiors;
 	    
 	    ValidateGC(&pPixmap->drawable, pGC);
-	    dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL);
+	    dixChangeGCWithXIDs (serverClient, pGC, GCSubwindowMode, &val);
 	    (*pGC->ops->CopyArea) (&pParent->drawable,
 				   &pPixmap->drawable,
 				   pGC,
diff --git a/dbe/dbe.c b/dbe/dbe.c
index 9e72094..fde0e98 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -1283,7 +1283,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
             return(FALSE);
     }
 
-    return dixChangeGC(NullClient, pGC, gcmask, NULL, gcvalues) == 0;
+    return dixChangeGCWithPointers(NullClient, pGC, gcmask, gcvalues) == 0;
 } /* DbeSetupBackgroundPainter() */
 
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 982c808..3726066 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1555,7 +1555,7 @@ ProcChangeGC(ClientPtr client)
     if (len != Ones(stuff->mask))
         return BadLength;
 
-    result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0);
+    result = dixChangeGCWithXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]);
     if (client->noClientException != Success)
         return(client->noClientException);
     else
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 7dbccaf..c6f1f84 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1261,7 +1261,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 	    {
 		if (pFont != c->pGC->font && c->pDraw)
 		{
-		    dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL);
+		    dixChangeGCWithXIDs(NullClient, c->pGC, GCFont, &fid);
 		    ValidateGC(c->pDraw, c->pGC);
 		    if (c->reqType == X_PolyText8)
 			c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
@@ -1404,7 +1404,7 @@ bail:
 	/* Step 4 */
 	if (pFont != origGC->font)
 	{
-	    dixChangeGC(NullClient, origGC, GCFont, &fid, NULL);
+	    dixChangeGCWithXIDs(NullClient, origGC, GCFont, &fid);
 	    ValidateGC(c->pDraw, origGC);
 	}
 
@@ -1423,7 +1423,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
+	dixChangeGCWithXIDs(NullClient, c->pGC, clearGCmask, clearGC);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
@@ -1580,7 +1580,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
+	dixChangeGCWithXIDs(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 c9730bb..3bcfc56 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -82,48 +82,37 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
 }
 
 
-/* dixChangeGC(client, pGC, mask, pC32, pUnion)
- * 
- * This function was created as part of the Security extension
- * implementation.  The client performing the gc change must be passed so
- * that access checks can be performed on any tiles, stipples, or fonts
- * that are specified.  ddxen can call this too; they should normally
- * pass NullClient for the client since any access checking should have
+/*
+ * dixChangeGCWith{XIDs,Pointers}:
+ *
+ * The client performing the gc change must be passed so that access
+ * checks can be performed on any tiles, stipples, or fonts that are
+ * specified.  ddxen can call this too; they should normally pass
+ * NullClient for the client since any access checking should have
  * already been done at a higher level.
  * 
- * You can pass the list of gc values via pC32 or pUnion, but not both;
- * one of them must be NULL.  If you don't need to pass any pointers,
- * you can use either one:
+ * If you have any XIDs, you must use the WithXIDs variant:
  * 
- *     example calling dixChangeGC using pC32 parameter
- *
  *     CARD32 v[2];
- *     v[0] = foreground;
- *     v[1] = background;
- *     dixChangeGC(client, pGC, GCForeground|GCBackground, v, NULL);
- * 
- *     example calling dixChangeGC using pUnion parameter;
- *     same effect as above
- *
- *     ChangeGCVal v[2];
- *     v[0].val = foreground;
- *     v[1].val = background;
- *     dixChangeGC(client, pGC, GCForeground|GCBackground, NULL, v);
+ *     v[0] = FillTiled;
+ *     v[1] = pid;
+ *     dixChangeGCWithXIDs(client, pGC, GCFillStyle|GCTile, v);
  * 
- * However, if you need to pass a pointer to a pixmap or font, you MUST
- * use the pUnion parameter.
+ * However, if you need to pass a pointer to a pixmap or font, you must
+ * use the WithPointers variant:
  * 
- *     example calling dixChangeGC passing pointers in the value list
- *     v[1].ptr is a pointer to a pixmap
- *
  *     ChangeGCVal v[2];
  *     v[0].val = FillTiled;
  *     v[1].ptr = pPixmap;
- *     dixChangeGC(client, pGC, GCFillStyle|GCTile, NULL, v);
+ *     dixChangeGCWithPointers(client, pGC, GCFillStyle|GCTile, v);
  * 
- * Note: we could have gotten by with just the pUnion parameter, but on
- * 64 bit machines that would have forced us to copy the value list that
- * comes in the ChangeGC request.
+ * If you have neither XIDs nor pointers, you can use either function,
+ * but the WithPointers variant will do less work.
+ *
+ *     ChangeGCVal v[2];
+ *     v[0].val = foreground;
+ *     v[1].val = background;
+ *     dixChangeGCWithPointers(client, pGC, GCForeground|GCBackground, v);
  */
 
 #define NEXTVAL(_type, _var) { \
@@ -133,7 +122,7 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
 #define NEXT_PTR(_type, _var) { \
     _var = (_type)pUnion->ptr; pUnion++; }
 
-static int
+int
 dixChangeGCWithPointers(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion)
 {
     BITS32 	index2;
@@ -430,7 +419,7 @@ static const struct {
     { GCClipMask, RT_PIXMAP, DixReadAccess },
 };
 
-static int
+int
 dixChangeGCWithXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
 {
     ChangeGCVal vals[GCLastBit + 1];
@@ -466,14 +455,6 @@ dixChangeGCWithXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
     return dixChangeGCWithPointers(client, pGC, mask, vals);
 }
 
-int
-dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion)
-{
-    if (pC32)
-	return dixChangeGCWithXIDs(client, pGC, mask, pC32);
-    return dixChangeGCWithPointers(client, pGC, mask, pUnion);
-}
-
 /* CreateGC(pDrawable, mask, pval, pStatus)
    creates a default GC for the given drawable, using mask to fill
    in any non-default values.
@@ -557,7 +538,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
     if (!(*pGC->pScreen->CreateGC)(pGC))
 	*pStatus = BadAlloc;
     else if (mask)
-        *pStatus = dixChangeGC(NullClient, pGC, mask, pval, NULL);
+        *pStatus = dixChangeGCWithXIDs(NullClient, pGC, mask, pval);
     else
 	*pStatus = Success;
 
@@ -600,7 +581,7 @@ CreateDefaultTile (GCPtr pGC)
     tmpval[0] = GXcopy;
     tmpval[1] = pGC->tile.pixel;
     tmpval[2] = FillSolid;
-    (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL);
+    (void)dixChangeGCWithXIDs(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval);
     ValidateGC((DrawablePtr)pTile, pgcScratch);
     rect.x = 0;
     rect.y = 0;
@@ -939,7 +920,7 @@ CreateDefaultStipple(int screenNum)
 	(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
 	return FALSE;
     }
-    (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL);
+    (void)dixChangeGCWithXIDs(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
     ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
     rect.x = 0;
     rect.y = 0;
diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c
index f74b137..c071053 100644
--- a/dix/glyphcurs.c
+++ b/dix/glyphcurs.c
@@ -118,14 +118,13 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha
     gcval[0].val = GXcopy;
     gcval[1].val = 0;
     gcval[2].ptr = (pointer)pfont;
-    dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont,
-		NULL, gcval);
+    dixChangeGCWithPointers(NullClient, pGC, GCFunction | GCForeground | GCFont, gcval);
     ValidateGC((DrawablePtr)ppix, pGC);
     (*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect);
 
     /* draw the glyph */
     gcval[0].val = 1;
-    dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval);
+    dixChangeGCWithPointers(NullClient, pGC, GCForeground, gcval);
     ValidateGC((DrawablePtr)ppix, pGC);
     (*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot,
 			    1, (unsigned short *)char2b);
diff --git a/dix/window.c b/dix/window.c
index 84c514b..81e1afc 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -328,7 +328,7 @@ MakeRootTile(WindowPtr pWin)
 	attributes[0] = pScreen->whitePixel;
 	attributes[1] = pScreen->blackPixel;
 
-	(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL);
+	(void)dixChangeGCWithXIDs(NullClient, pGC, GCForeground | GCBackground, attributes);
     }
 
    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
@@ -3763,8 +3763,7 @@ DrawLogo(WindowPtr pWin)
     } else {
 	back[0].val = 0;
 	back[1].val = 0;
-	dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin,
-		    NULL, back);
+	dixChangeGCWithPointers(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back);
 	back[0].val = FillTiled;
 	back[1].ptr = pWin->background.pixmap;
 	bmask = GCFillStyle|GCTile;
@@ -3802,7 +3801,7 @@ DrawLogo(WindowPtr pWin)
     poly[1].x = x + size-d31;	       poly[1].y = y;
     poly[2].x = x + 0;		       poly[2].y = y + size;
     poly[3].x = x + d31;	       poly[3].y = y + size;
-    dixChangeGC(NullClient, pGC, fmask, NULL, fore);
+    dixChangeGCWithPointers(NullClient, pGC, fmask, fore);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
 
@@ -3821,7 +3820,7 @@ DrawLogo(WindowPtr pWin)
     poly[1].x = x + size / 2;			 poly[1].y = y + size/2;
     poly[2].x = x + (size/2)+(d31-(d31/2));	 poly[2].y = y + size/2;
     poly[3].x = x + d31;			 poly[3].y = y + size;
-    dixChangeGC(NullClient, pGC, bmask, NULL, back);
+    dixChangeGCWithPointers(NullClient, pGC, bmask, back);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
 
@@ -3860,7 +3859,7 @@ DrawLogo(WindowPtr pWin)
     poly[1].x = x + size/4;	       poly[1].y = y;
     poly[2].x = x + size;	       poly[2].y = y + size;
     poly[3].x = x + size - size/4;     poly[3].y = y + size;
-    dixChangeGC(NullClient, pGC, fmask, NULL, fore);
+    dixChangeGCWithPointers(NullClient, pGC, fmask, fore);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
 
@@ -3878,7 +3877,7 @@ DrawLogo(WindowPtr pWin)
     poly[1].x = x + size-( thin+gap);  poly[1].y = y;
     poly[2].x = x + thin;	      poly[2].y = y + size;
     poly[3].x = x + thin + gap;	      poly[3].y = y + size;
-    dixChangeGC(NullClient, pGC, bmask, NULL, back);
+    dixChangeGCWithPointers(NullClient, pGC, bmask, back);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
 
diff --git a/fb/fbseg.c b/fb/fbseg.c
index 80dd480..d2b3529 100644
--- a/fb/fbseg.c
+++ b/fb/fbseg.c
@@ -250,7 +250,7 @@ fbSetFg (DrawablePtr	pDrawable,
 {
     if (fg != pGC->fgPixel)
     {
-	dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
+	dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &fg);
 	ValidateGC (pDrawable, pGC);
     }
 }
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 918383c..4adef67 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -297,7 +297,7 @@ glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
 {
     CARD32 v[1];
     v[0] = val;
-    dixChangeGC(NullClient, gc, mask, v, NULL);
+    dixChangeGCWithXIDs(NullClient, gc, mask, v);
 }
 
 static __GLXdrawable *
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index ffc96e6..fe12363 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -107,7 +107,7 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
     tmpval[0] = alu;
     tmpval[1] = pm;
     tmpval[2] = fg;
-    dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL);
+    dixChangeGCWithXIDs(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval);
 
     ValidateGC(&pPix->drawable, fakexa->pGC);
 
@@ -172,7 +172,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
 
     tmpval[0] = alu;
     tmpval[1] = pm;
-    dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL);
+    dixChangeGCWithXIDs (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 4506c54..a2fb49a 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1892,7 +1892,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
 
     val[0] = fg;
     val[1] = IncludeInferiors;
-    dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL);
+    dixChangeGCWithXIDs (NullClient, pGC, GCForeground|GCSubwindowMode, val);
 
     ValidateGC (pDraw, pGC);
 
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 6387184..d3dc2bf 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1855,7 +1855,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
        if (pPriv) pPriv->pGC = pGC;
    } else if (key != pGC->fgPixel){
        pval[0] = key;
-       dixChangeGC(NullClient, pGC, GCForeground, pval, NULL);
+       dixChangeGCWithXIDs(NullClient, pGC, GCForeground, pval);
        ValidateGC(pDraw, pGC);
    }
 
@@ -1892,7 +1892,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
    gc = GetScratchGC(root->depth, pScreen);
    pval[0] = key;
    pval[1] = IncludeInferiors;
-   (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL);
+   (void) dixChangeGCWithXIDs(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 ef3ecd2..c9d027a 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1881,7 +1881,7 @@ XAAWriteBitmapToCacheLinear(
    pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
    gcvals[0] = fg;
    gcvals[1] = bg;
-   dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals, NULL);
+   dixChangeGCWithXIDs(NullClient, pGC, GCForeground | GCBackground, gcvals);
    ValidateGC((DrawablePtr)pDstPix, pGC);
 
    /* We've unwrapped already so these ops miss a sync */
diff --git a/include/gc.h b/include/gc.h
index 3fa953d..5d5dedb 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -93,11 +93,16 @@ typedef union {
     pointer ptr;
 } ChangeGCVal, *ChangeGCValPtr;
 
-extern _X_EXPORT int dixChangeGC(
+extern _X_EXPORT int dixChangeGCWithXIDs(
+    ClientPtr /*client*/,
+    GCPtr /*pGC*/,
+    BITS32 /*mask*/,
+    CARD32 * /*pval*/);
+
+extern _X_EXPORT int dixChangeGCWithPointers(
     ClientPtr /*client*/,
     GCPtr /*pGC*/,
     BITS32 /*mask*/,
-    CARD32 * /*pval*/,
     ChangeGCValPtr /*pCGCV*/);
 
 extern _X_EXPORT GCPtr CreateGC(
diff --git a/mi/miarc.c b/mi/miarc.c
index 5fd1a67..300862c 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1145,7 +1145,7 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    gcvals[GCValsLineWidth] = pGC->lineWidth;
 	    gcvals[GCValsCapStyle] = pGC->capStyle;
 	    gcvals[GCValsJoinStyle] = pGC->joinStyle;
-	    dixChangeGC(NullClient, pGCTo, GCValsMask, gcvals, NULL);
+	    dixChangeGCWithXIDs(NullClient, pGCTo, GCValsMask, gcvals);
     
 	    /* allocate a 1 bit deep pixmap of the appropriate size, and
 	     * validate it */
@@ -1185,10 +1185,10 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	     iphase--)
 	{
 	    if (iphase == 1) {
-		dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL);
+		dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &bg);
 		ValidateGC (pDraw, pGC);
 	    } else if (pGC->lineStyle == LineDoubleDash) {
-		dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
+		dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &fg);
 		ValidateGC (pDraw, pGC);
 	    }
 	    for (i = 0; i < polyArcs[iphase].narcs; i++) {
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 246ff4b..79f7bce 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -426,7 +426,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     }
     /* First set the whole pixmap to 0 */
     gcv[0].val = 0;
-    dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv);
+    dixChangeGCWithPointers(NullClient, pGCT, GCBackground, gcv);
     ValidateGC((DrawablePtr)pPixmap, pGCT);
     miClearDrawable((DrawablePtr)pPixmap, pGCT);
     ppt = pptFirst = xalloc(h * sizeof(DDXPointRec));
@@ -477,9 +477,9 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     gcv[2].val = dstx - srcx;
     gcv[3].val = dsty;
 
-    dixChangeGC(NullClient, pGC,
+    dixChangeGCWithPointers(NullClient, pGC,
              GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin,
-	     NULL, gcv);
+	     gcv);
     ValidateGC(pDraw, pGC);
 
     /* Fill the drawable with the stipple.  This will draw the
@@ -495,7 +495,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only
      * within the clipping region, the part outside is still all 0s */
     gcv[0].val = GXinvert;
-    dixChangeGC(NullClient, pGCT, GCFunction, NULL, gcv);
+    dixChangeGCWithPointers(NullClient, pGCT, GCFunction, gcv);
     ValidateGC((DrawablePtr)pPixmap, pGCT);
     (*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap,
 			   pGCT, 0, 0, w + srcx, h, 0, 0);
@@ -507,8 +507,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     gcv[0].val = pGC->bgPixel;
     gcv[1].val = oldfg;
     gcv[2].ptr = pPixmap;
-    dixChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple,
-		NULL, gcv);
+    dixChangeGCWithPointers(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv);
     ValidateGC(pDraw, pGC);
     /* PolyFillRect might have bashed the rectangle */
     rect.x = dstx;
@@ -526,9 +525,9 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     gcv[3].ptr = pStipple;
     gcv[4].val = oldOrg.x;
     gcv[5].val = oldOrg.y;
-    dixChangeGC(NullClient, pGC, 
+    dixChangeGCWithPointers(NullClient, pGC,
         GCForeground | GCBackground | GCFillStyle | GCStipple | 
-	GCTileStipXOrigin | GCTileStipYOrigin, NULL, gcv);
+	GCTileStipXOrigin | GCTileStipYOrigin, gcv);
 
     ValidateGC(pDraw, pGC);
     /* put what we hope is a smaller clip region back in the scratch gc */
@@ -679,7 +678,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
  
 	    /* alu is already GXCopy */
 	    gcv[0] = (XID)planeMask;
-	    dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+	    dixChangeGCWithXIDs(NullClient, pGC, GCPlaneMask, gcv);
 	    ValidateGC((DrawablePtr)pPixmap, pGC);
 	}
 
@@ -776,7 +775,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	oldBg = pGC->bgPixel;
 	gcv[0] = (XID)~0;
 	gcv[1] = (XID)0;
-	dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL);
+	dixChangeGCWithXIDs(NullClient, pGC, GCForeground | GCBackground, gcv);
 	bytesPer = (long)h * BitmapBytePad(w + leftPad);
 
 	for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
@@ -784,7 +783,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	    if (i & oldPlanemask)
 	    {
 	        gcv[0] = (XID)i;
-	        dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+	        dixChangeGCWithXIDs(NullClient, pGC, GCPlaneMask, gcv);
 	        ValidateGC(pDraw, pGC);
 	        (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
 			         XYBitmap, (char *)pImage);
@@ -793,7 +792,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	gcv[0] = (XID)oldPlanemask;
 	gcv[1] = (XID)oldFg;
 	gcv[2] = (XID)oldBg;
-	dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL);
+	dixChangeGCWithXIDs(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
 	ValidateGC(pDraw, pGC);
 	break;
 
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 73f39c2..7bc9306 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -306,7 +306,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->source);
     gcvals[0] = GXand;
-    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+    dixChangeGCWithXIDs (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,
@@ -314,13 +314,13 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
     gcvals[0] = GXcopy;
-    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+    dixChangeGCWithXIDs (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;
-    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+    dixChangeGCWithXIDs (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,
@@ -371,7 +371,7 @@ miDCPutBits (
     if (sourceGC->fgPixel != source)
     {
 	gcvals[0] = source;
-	dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL);
+	dixChangeGCWithXIDs (NullClient, sourceGC, GCForeground, gcvals);
     }
     if (sourceGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, sourceGC);
@@ -391,7 +391,7 @@ miDCPutBits (
     if (maskGC->fgPixel != mask)
     {
 	gcvals[0] = mask;
-	dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL);
+	dixChangeGCWithXIDs (NullClient, maskGC, GCForeground, gcvals);
     }
     if (maskGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, maskGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 4943685..b2e49ee 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -657,7 +657,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	return;
     }
     
-    dixChangeGC (NullClient, pGC, gcmask, NULL, gcval);
+    dixChangeGCWithPointers (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
     numRects = REGION_NUM_RECTS(prgn);
@@ -691,9 +691,9 @@ miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
     rect.y = 0;
     rect.width = pDraw->width;
     rect.height = pDraw->height;
-    dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL);
+    dixChangeGCWithXIDs(NullClient, pGC, GCForeground, &bg);
     ValidateGC(pDraw, pGC);
     (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-    dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL);
+    dixChangeGCWithXIDs(NullClient, pGC, GCForeground, &fg);
     ValidateGC(pDraw, pGC);
 }
diff --git a/mi/miglblt.c b/mi/miglblt.c
index 7e1e40d..98834f3 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -138,7 +138,7 @@ miPolyGlyphBlt(
     gcvals[1] = 1;
     gcvals[2] = 0;
 
-    dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL);
+    dixChangeGCWithXIDs(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals);
 
     nbyLine = BitmapBytePad(width);
     pbits = xalloc(height*nbyLine);
@@ -237,13 +237,13 @@ miImageGlyphBlt(
     gcvals[0] = GXcopy;
     gcvals[1] = pGC->bgPixel;
     gcvals[2] = FillSolid;
-    dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+    dixChangeGCWithXIDs(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
 
     /* put down the glyphs */
     gcvals[0] = oldFG;
-    dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL);
+    dixChangeGCWithXIDs(NullClient, pGC, GCForeground, gcvals);
     ValidateGC(pDrawable, pGC);
     (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
 			      pglyphBase);
@@ -252,7 +252,7 @@ miImageGlyphBlt(
     gcvals[0] = oldAlu;
     gcvals[1] = oldFG;
     gcvals[2] = oldFS;
-    dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+    dixChangeGCWithXIDs(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals);
     ValidateGC(pDrawable, pGC);
 
 }
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 1650f0c..4c3370d 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -104,7 +104,7 @@ miPolyPoint(
     fsNew = FillSolid;
     if(pGC->fillStyle != FillSolid)
     {
-	dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL);
+	dixChangeGCWithXIDs(NullClient, pGC, GCFillStyle, &fsNew);
 	ValidateGC(pDrawable, pGC);
     }
     if(!(pwidthInit = xalloc(npt * sizeof(int))))
@@ -116,7 +116,7 @@ miPolyPoint(
 
     if(fsOld != FillSolid)
     {
-	dixChangeGC(NullClient, pGC, GCFillStyle, &fsOld, NULL);
+	dixChangeGCWithXIDs(NullClient, pGC, GCFillStyle, &fsOld);
 	ValidateGC(pDrawable, pGC);
     }
     xfree(pwidthInit);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index a1d4a1a..dfb8606 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -110,7 +110,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-	    dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &tmpPixel);
     	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -171,7 +171,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
     	xfree (pptInit);
     	if (pixel != oldPixel)
     	{
-	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &oldPixel);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -209,13 +209,13 @@ miFillRectPolyHelper (
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-	    dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &tmpPixel);
     	    ValidateGC (pDrawable, pGC);
     	}
 	(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
     	if (pixel != oldPixel)
     	{
-	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &oldPixel);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
@@ -1058,7 +1058,7 @@ miLineArc (
     	if (pixel != oldPixel)
     	{
 	    XID tmpPixel = (XID)pixel;
-	    dixChangeGC(NullClient, pGC, GCForeground, &tmpPixel, NULL);
+	    dixChangeGCWithXIDs(NullClient, pGC, GCForeground, &tmpPixel);
 	    ValidateGC (pDraw, pGC);
     	}
     }
@@ -1090,7 +1090,7 @@ miLineArc (
     	xfree(points);
     	if (pixel != oldPixel)
     	{
-	    dixChangeGC(NullClient, pGC, GCForeground, &oldPixel, NULL);
+	    dixChangeGCWithXIDs(NullClient, pGC, GCForeground, &oldPixel);
 	    ValidateGC (pDraw, pGC);
     	}
     }
@@ -1509,14 +1509,14 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
 	oldPixel = pGC->fgPixel;
     	if (pixel != oldPixel)
     	{
-	    dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &pixel);
     	    ValidateGC (pDrawable, pGC);
     	}
 	miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
 	miFreeSpanGroup (&spanData->bgGroup);
     	if (pixel != oldPixel)
     	{
-	    dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+	    dixChangeGCWithXIDs (NullClient, pGC, GCForeground, &oldPixel);
 	    ValidateGC (pDrawable, pGC);
     	}
     }
diff --git a/mi/miwideline.h b/mi/miwideline.h
index c3ff992..5ff0e57 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -142,13 +142,13 @@ typedef struct _LineFace {
 #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     oldPixel = pGC->fgPixel; \
     if (pixel != oldPixel) { \
-	dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \
+	dixChangeGCWithXIDs (NullClient, pGC, GCForeground, (XID *) &pixel); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
 #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
     if (pixel != oldPixel) { \
-	dixChangeGC (NullClient, pGC, GCForeground, (XID *) &oldPixel, NULL); \
+	dixChangeGCWithXIDs (NullClient, pGC, GCForeground, (XID *) &oldPixel); \
 	ValidateGC (pDrawable, pGC); \
     } \
 }
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 46d1e5c..e449917 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -803,7 +803,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		dixChangeGC(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel, NULL);
+		dixChangeGCWithXIDs(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel);
 		ValidateGC(pDraw, pGC);
 	    }
 	    pts = &points[numPts >> 1];
@@ -831,7 +831,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
 	    if ((pGC->fillStyle == FillSolid) ||
 		(pGC->fillStyle == FillStippled))
 	    {
-		dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL);
+		dixChangeGCWithXIDs(NullClient, pGC, GCForeground, &fgPixel);
 		ValidateGC(pDraw, pGC);
 	    }
 	}
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 247cb83..948daaf 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -204,8 +204,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
 	
 	vals[0] = x_off - pDrawable->x;
 	vals[1] = y_off - pDrawable->y;
-	dixChangeGC(NullClient, pBackingGC,
-		    (GCClipXOrigin | GCClipYOrigin), vals, NULL);
+	dixChangeGCWithXIDs(NullClient, pBackingGC,
+		    (GCClipXOrigin | GCClipYOrigin), vals);
 
 	pPriv->serialNumber = pDrawable->serialNumber;
 	/*
@@ -226,8 +226,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
 	XID vals[2];
 	vals[0] = pGC->patOrg.x + x_off;
 	vals[1] = pGC->patOrg.y + y_off;
-	dixChangeGC(NullClient, pBackingGC,
-		    (GCTileStipXOrigin | GCTileStipYOrigin), vals, NULL);
+	dixChangeGCWithXIDs(NullClient, pBackingGC,
+		    (GCTileStipXOrigin | GCTileStipYOrigin), vals);
     }
 
     ValidateGC(pBackingDrawable, pBackingGC);
diff --git a/render/mirect.c b/render/mirect.c
index 0030eff..dae76b4 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -70,7 +70,7 @@ miColorRects (PicturePtr    pDst,
 	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
     }
 
-    dixChangeGC (NullClient, pGC, mask, tmpval, NULL);
+    dixChangeGCWithXIDs (NullClient, pGC, mask, tmpval);
     ValidateGC (pDst->pDrawable, pGC);
     if (xoff || yoff)
     {
@@ -148,7 +148,7 @@ miCompositeRects (CARD8		op,
 	tmpval[0] = GXcopy;
 	tmpval[1] = pixel;
 
-	dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL);
+	dixChangeGCWithXIDs (NullClient, pGC, GCFunction | GCForeground, tmpval);
 	ValidateGC (&pPixmap->drawable, pGC);
 	one.x = 0;
 	one.y = 0;
diff --git a/xfixes/region.c b/xfixes/region.c
index 6ccc723..35961fd 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -643,7 +643,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
     
     vals[0] = stuff->xOrigin;
     vals[1] = stuff->yOrigin;
-    dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals, NULL);
+    dixChangeGCWithXIDs (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