summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-08 14:10:51 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-13 17:13:48 -0700
commite2929db7b737413cf93fbebdf4d15abdfebff05c (patch)
treeb32ddbf9c163f8eb814ebdaa4b22301b82af0906
parent95728ca09d45afc84c8d1828c09c6b6725f1a58d (diff)
dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--composite/compalloc.c5
-rw-r--r--dix/dixfonts.c14
-rw-r--r--dix/gc.c18
-rw-r--r--dix/window.c8
-rw-r--r--fb/fbseg.c4
-rw-r--r--glx/glxdriswrast.c16
-rw-r--r--hw/kdrive/ephyr/ephyr_draw.c18
-rw-r--r--hw/kdrive/src/kxv.c8
-rw-r--r--hw/xfree86/common/xf86xv.c15
-rw-r--r--hw/xfree86/xaa/xaaPCache.c8
-rw-r--r--mi/miarc.c23
-rw-r--r--mi/mibitblt.c26
-rw-r--r--mi/midispcur.c24
-rw-r--r--mi/miexpose.c9
-rw-r--r--mi/miglblt.c32
-rw-r--r--mi/mipolypnt.c12
-rw-r--r--mi/miwideline.c42
-rw-r--r--mi/miwideline.h8
-rw-r--r--mi/mizerarc.c8
-rw-r--r--miext/cw/cw.c16
-rw-r--r--render/mirect.c23
-rw-r--r--xfixes/region.c8
22 files changed, 181 insertions, 164 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c
index a764972a2..7a8019e61 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -497,10 +497,11 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
*/
if (pGC)
{
- XID val = IncludeInferiors;
+ ChangeGCVal val;
+ val.val = IncludeInferiors;
ValidateGC(&pPixmap->drawable, pGC);
- dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL);
+ dixChangeGC (serverClient, pGC, GCSubwindowMode, NULL, &val);
(*pGC->ops->CopyArea) (&pParent->drawable,
&pPixmap->drawable,
pGC,
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 332fb9728..01123c3a9 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)
{
- dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL);
+ ChangeGCVal val;
+ val.ptr = pFont;
+ dixChangeGC(NullClient, c->pGC, GCFont, NULL, &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)
{
- dixChangeGC(NullClient, origGC, GCFont, &fid, NULL);
+ ChangeGCVal val;
+ val.ptr = pFont;
+ dixChangeGC(NullClient, origGC, GCFont, NULL, &val);
ValidateGC(c->pDraw, origGC);
}
@@ -1423,7 +1427,7 @@ bail:
if (c->slept)
{
ClientWakeup(c->client);
- dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
+ dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, 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);
- dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
+ dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, 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 c9b704a66..e5e6b4fac 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -593,7 +593,7 @@ out:
static Bool
CreateDefaultTile (GCPtr pGC)
{
- XID tmpval[3];
+ ChangeGCVal tmpval[3];
PixmapPtr pTile;
GCPtr pgcScratch;
xRectangle rect;
@@ -614,10 +614,10 @@ CreateDefaultTile (GCPtr pGC)
FreeScratchGC(pgcScratch);
return FALSE;
}
- tmpval[0] = GXcopy;
- tmpval[1] = pGC->tile.pixel;
- tmpval[2] = FillSolid;
- (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL);
+ tmpval[0].val = GXcopy;
+ tmpval[1].val = pGC->tile.pixel;
+ tmpval[2].val = FillSolid;
+ (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, NULL, tmpval);
ValidateGC((DrawablePtr)pTile, pgcScratch);
rect.x = 0;
rect.y = 0;
@@ -935,7 +935,7 @@ Bool
CreateDefaultStipple(int screenNum)
{
ScreenPtr pScreen;
- XID tmpval[3];
+ ChangeGCVal tmpval[3];
xRectangle rect;
CARD16 w, h;
GCPtr pgcScratch;
@@ -949,14 +949,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)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL);
+ (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, NULL, tmpval);
ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
rect.x = 0;
rect.y = 0;
diff --git a/dix/window.c b/dix/window.c
index 313593b47..595c60856 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)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL);
+ (void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, attributes);
}
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
diff --git a/fb/fbseg.c b/fb/fbseg.c
index 80dd48092..28a9cf04f 100644
--- a/fb/fbseg.c
+++ b/fb/fbseg.c
@@ -250,7 +250,9 @@ fbSetFg (DrawablePtr pDrawable,
{
if (fg != pGC->fgPixel)
{
- dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
+ ChangeGCVal val;
+ val.val = fg;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &val);
ValidateGC (pDrawable, pGC);
}
}
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index a0054515b..e6cb1eeb1 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;
- dixChangeGC(NullClient, gc, mask, v, NULL);
-}
-
static __GLXdrawable *
__glXDRIscreenCreateDrawable(ClientPtr client,
__GLXscreen *screen,
@@ -309,6 +301,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
XID glxDrawId,
__GLXconfig *glxConfig)
{
+ ChangeGCVal gcvals[2];
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
@@ -333,9 +326,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
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;
+ dixChangeGC(NullClient, private->gc, GCFunction, NULL, gcvals);
+ gcvals[1].val = FALSE;
+ dixChangeGC(NullClient, private->gc, GCFunction | GCGraphicsExposures, NULL, 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 672e0e4ea..f5a324745 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;
- dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL);
+ tmpval[0].val = alu;
+ tmpval[1].val = pm;
+ tmpval[2].val = fg;
+ dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, NULL, 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;
- dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL);
+ tmpval[0].val = alu;
+ tmpval[1].val = pm;
+ dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, NULL, tmpval);
ValidateGC(&pDst->drawable, fakexa->pGC);
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index bf6600a09..aedf06833 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;
- dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL);
+ val[0].val = fg;
+ val[1].val = IncludeInferiors;
+ dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, NULL, val);
ValidateGC (pDraw, pGC);
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index e2d9c1541..2ea305bf0 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,9 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
ValidateGC(pDraw, pGC);
if (pPriv) pPriv->pGC = pGC;
} else if (key != pGC->fgPixel){
- pval[0] = key;
- dixChangeGC(NullClient, pGC, GCForeground, pval, NULL);
+ ChangeGCVal val;
+ val.val = key;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &val);
ValidateGC(pDraw, pGC);
}
@@ -1881,7 +1882,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 +1891,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) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL);
+ pval[0].val = key;
+ pval[1].val = IncludeInferiors;
+ (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, NULL, pval);
ValidateGC(root, gc);
rects = malloc(nbox * sizeof(xRectangle));
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index e62f28083..7580c26c9 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;
- dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals, NULL);
+ gcvals[0].val = fg;
+ gcvals[1].val = bg;
+ dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, 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 f2959c77b..bdcbdf140 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1036,16 +1036,16 @@ 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;
+ 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;
dixChangeGC(NullClient, pGCTo, GCFunction |
GCForeground | GCBackground | GCLineWidth |
- GCCapStyle | GCJoinStyle, gcvals, NULL);
+ GCCapStyle | GCJoinStyle, NULL, gcvals);
}
/* allocate a 1 bit deep pixmap of the appropriate size, and
@@ -1085,11 +1085,14 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
iphase >= 0;
iphase--)
{
+ ChangeGCVal gcval;
if (iphase == 1) {
- dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL);
+ gcval.val = bg;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC);
} else if (pGC->lineStyle == LineDoubleDash) {
- dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
+ gcval.val = fg;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC);
}
for (i = 0; i < polyArcs[iphase].narcs; i++) {
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index f02c04fd4..b767a0519 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -646,7 +646,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;
@@ -655,6 +654,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);
@@ -678,8 +678,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
TRUE);
/* alu is already GXCopy */
- gcv[0] = (XID)planeMask;
- dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+ gcv.val = (XID)planeMask;
+ dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, &gcv);
ValidateGC((DrawablePtr)pPixmap, pGC);
}
@@ -747,7 +747,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;
@@ -774,26 +774,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;
- dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL);
+ gcv[0].val = (XID)~0;
+ gcv[1].val = (XID)0;
+ dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, 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;
- dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+ gcv[0].val = (XID)i;
+ dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, 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;
- dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL);
+ gcv[0].val = (XID)oldPlanemask;
+ gcv[1].val = (XID)oldFg;
+ gcv[2].val = (XID)oldBg;
+ dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, NULL, gcv);
ValidateGC(pDraw, pGC);
break;
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 11547dbd9..865b60bbc 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 = malloc(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;
- dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+ gcvals.val = GXand;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &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;
- dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+ gcvals.val = GXcopy;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &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);
+ gcvals.val = GXandInverted;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &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,13 @@ miDCPutBits (
unsigned long source,
unsigned long mask)
{
- XID gcvals[1];
+ ChangeGCVal gcval;
int x, y;
if (sourceGC->fgPixel != source)
{
- gcvals[0] = source;
- dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL);
+ gcval.val = source;
+ dixChangeGC (NullClient, sourceGC, GCForeground, NULL, &gcval);
}
if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC);
@@ -390,8 +390,8 @@ miDCPutBits (
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask)
{
- gcvals[0] = mask;
- dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL);
+ gcval.val = mask;
+ dixChangeGC (NullClient, maskGC, GCForeground, NULL, &gcval);
}
if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index b4d489a7d..03ce896aa 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -683,17 +683,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
void
miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
{
- XID fg = pGC->fgPixel;
- XID bg = pGC->bgPixel;
+ ChangeGCVal fg, bg;
xRectangle rect;
+ fg.val = pGC->fgPixel;
+ bg.val = pGC->bgPixel;
rect.x = 0;
rect.y = 0;
rect.width = pDraw->width;
rect.height = pDraw->height;
- dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL);
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &bg);
ValidateGC(pDraw, pGC);
(*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
- dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL);
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &fg);
ValidateGC(pDraw, pGC);
}
diff --git a/mi/miglblt.c b/mi/miglblt.c
index 22a170aa0..acb432745 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;
- dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL);
+ dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, NULL, gcvals);
nbyLine = BitmapBytePad(width);
pbits = malloc(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;
- dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = pGC->bgPixel;
+ gcvals[2].val = FillSolid;
+ dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
/* put down the glyphs */
- gcvals[0] = oldFG;
- dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL);
+ gcvals[0].val = oldFG;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, 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;
- dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+ gcvals[0].val = oldAlu;
+ gcvals[1].val = oldFG;
+ gcvals[2].val = oldFS;
+ dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC);
}
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index b54a9fdbe..99ba68afd 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, fsNew;
int *pwidthInit, *pwidth;
int i;
xPoint *ppt;
@@ -103,11 +103,11 @@ miPolyPoint(
}
}
- fsOld = pGC->fillStyle;
- fsNew = FillSolid;
+ fsOld.val = pGC->fillStyle;
+ fsNew.val = FillSolid;
if(pGC->fillStyle != FillSolid)
{
- dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL);
+ dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &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)
{
- dixChangeGC(NullClient, pGC, GCFillStyle, &fsOld, NULL);
+ dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsOld);
ValidateGC(pDrawable, pGC);
}
free(pwidthInit);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index cabc0c1ce..c08f9649f 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -110,19 +110,20 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S
{
if (!spanData)
{
- XID oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
+ ChangeGCVal oldPixel, tmpPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
{
- XID tmpPixel = (XID)pixel;
- dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+ tmpPixel.val = (XID)pixel;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC);
}
(*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
free(spans->widths);
free(spans->points);
- if (pixel != oldPixel)
+ if (pixel != oldPixel.val)
{
- dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC);
}
}
@@ -246,7 +247,7 @@ miFillRectPolyHelper (
{
DDXPointPtr ppt;
int *pwidth;
- XID oldPixel;
+ ChangeGCVal oldPixel, tmpPixel;
Spans spanRec;
xRectangle rect;
@@ -256,17 +257,17 @@ miFillRectPolyHelper (
rect.y = y;
rect.width = w;
rect.height = h;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
{
- XID tmpPixel = (XID)pixel;
- dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+ tmpPixel.val = (XID)pixel;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC);
}
(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
- if (pixel != oldPixel)
+ if (pixel != oldPixel.val)
{
- dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC);
}
}
@@ -1498,20 +1499,19 @@ 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, pixel;
+ pixel.val = pGC->bgPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel.val != oldPixel.val)
{
- dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL);
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &pixel);
ValidateGC (pDrawable, pGC);
}
miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
miFreeSpanGroup (&spanData->bgGroup);
- if (pixel != oldPixel)
+ if (pixel.val != oldPixel.val)
{
- dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL);
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC);
}
}
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 2ff36ed6b..8d848783c 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -78,13 +78,17 @@ typedef struct _LineFace {
#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
oldPixel = pGC->fgPixel; \
if (pixel != oldPixel) { \
- dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \
+ ChangeGCVal gcval; \
+ gcval.val = pixel; \
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \
ValidateGC (pDrawable, pGC); \
} \
}
#define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
if (pixel != oldPixel) { \
- dixChangeGC (NullClient, pGC, GCForeground, (XID *) &oldPixel, NULL); \
+ ChangeGCVal gcval; \
+ gcval.val = oldPixel; \
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \
ValidateGC (pDrawable, pGC); \
} \
}
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index feaa3cb77..623347291 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -803,7 +803,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled))
{
- dixChangeGC(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel, NULL);
+ ChangeGCVal gcval;
+ gcval.val = pGC->bgPixel;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC(pDraw, pGC);
}
pts = &points[numPts >> 1];
@@ -831,7 +833,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled))
{
- dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL);
+ ChangeGCVal gcval;
+ gcval.val = fgPixel;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC(pDraw, pGC);
}
}
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 1959c8b73..c3bcdc8cb 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,10 +202,10 @@ 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;
+ vals[0].val = x_off - pDrawable->x;
+ vals[1].val = y_off - pDrawable->y;
dixChangeGC(NullClient, pBackingGC,
- (GCClipXOrigin | GCClipYOrigin), vals, NULL);
+ (GCClipXOrigin | GCClipYOrigin), NULL, vals);
pPriv->serialNumber = pDrawable->serialNumber;
/*
@@ -223,11 +223,11 @@ 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;
+ ChangeGCVal vals[2];
+ vals[0].val = pGC->patOrg.x + x_off;
+ vals[1].val = pGC->patOrg.y + y_off;
dixChangeGC(NullClient, pBackingGC,
- (GCTileStipXOrigin | GCTileStipYOrigin), vals, NULL);
+ (GCTileStipXOrigin | GCTileStipYOrigin), NULL, vals);
}
ValidateGC(pBackingDrawable, pBackingGC);
diff --git a/render/mirect.c b/render/mirect.c
index 0030eff62..38452ec39 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);
}
- dixChangeGC (NullClient, pGC, mask, tmpval, NULL);
+ dixChangeGC (NullClient, pGC, mask, NULL, 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;
- dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL);
+ dixChangeGC (NullClient, pGC, GCFunction | GCForeground, NULL, gcvals);
ValidateGC (&pPixmap->drawable, pGC);
one.x = 0;
one.y = 0;
diff --git a/xfixes/region.c b/xfixes/region.c
index 5e1636962..8ed7fa15d 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -622,7 +622,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
{
GCPtr pGC;
RegionPtr pRegion;
- XID vals[2];
+ ChangeGCVal vals[2];
int rc;
REQUEST(xXFixesSetGCClipRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
@@ -640,9 +640,9 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
return BadAlloc;
}
- vals[0] = stuff->xOrigin;
- vals[1] = stuff->yOrigin;
- dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals, NULL);
+ vals[0].val = stuff->xOrigin;
+ vals[1].val = stuff->yOrigin;
+ dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, NULL, vals);
(*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
return (client->noClientException);