From 83f7ec97279405958aed86c6a57704a460c3bfba Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 13:38:00 -0700 Subject: [PATCH 01/11] miwideline: Factor out span buffer allocation. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard Reviewed-by: Adam Jackson --- mi/miwideline.c | 106 +++++++++++++++--------------------------------- 1 file changed, 32 insertions(+), 74 deletions(-) diff --git a/mi/miwideline.c b/mi/miwideline.c index c54e2deb13..22e15cf47a 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -52,6 +52,21 @@ from The Open Group. #include "miwideline.h" #include "mi.h" +static Bool +InitSpans(Spans *spans, size_t nspans) +{ + spans->points = malloc(nspans * sizeof (*spans->points)); + if (!spans->points) + return FALSE; + spans->widths = malloc(nspans * sizeof (*spans->widths)); + if (!spans->widths) + { + free(spans->points); + return FALSE; + } + return TRUE; +} + /* * interface data to span-merging polygon filler */ @@ -110,9 +125,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, int left_height = 0, right_height = 0; DDXPointPtr ppt; - DDXPointPtr pptInit = NULL; int *pwidth; - int *pwidthInit = NULL; XID oldPixel; int xorg; Spans spanRec; @@ -120,19 +133,12 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, left_height = 0; right_height = 0; + if (!InitSpans(&spanRec, overall_height)) + return; + ppt = spanRec.points; + pwidth = spanRec.widths; if (!spanData) { - pptInit = malloc(overall_height * sizeof(*ppt)); - if (!pptInit) - return; - pwidthInit = malloc(overall_height * sizeof(*pwidth)); - if (!pwidthInit) - { - free(pptInit); - return; - } - ppt = pptInit; - pwidth = pwidthInit; oldPixel = pGC->fgPixel; if (pixel != oldPixel) { @@ -141,20 +147,6 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, ValidateGC (pDrawable, pGC); } } - else - { - spanRec.points = malloc(overall_height * sizeof (*ppt)); - if (!spanRec.points) - return; - spanRec.widths = malloc(overall_height * sizeof (int)); - if (!spanRec.widths) - { - free(spanRec.points); - return; - } - ppt = spanRec.points; - pwidth = spanRec.widths; - } xorg = 0; if (pGC->miTranslate) @@ -226,11 +218,12 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, } } } + spanRec.count = ppt - spanRec.points; if (!spanData) { - (*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE); - free(pwidthInit); - free(pptInit); + (*pGC->ops->FillSpans) (pDrawable, pGC, spanRec.count, spanRec.points, spanRec.widths, TRUE); + free(spanRec.widths); + free(spanRec.points); if (pixel != oldPixel) { dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); @@ -238,10 +231,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, } } else - { - spanRec.count = ppt - spanRec.points; AppendSpanGroup (pGC, pixel, &spanRec, spanData); - } } static void @@ -283,15 +273,8 @@ miFillRectPolyHelper ( } else { - spanRec.points = malloc(h * sizeof (*ppt)); - if (!spanRec.points) + if (!InitSpans(&spanRec, h)) return; - spanRec.widths = malloc(h * sizeof (int)); - if (!spanRec.widths) - { - free(spanRec.points); - return; - } ppt = spanRec.points; pwidth = spanRec.widths; @@ -1058,8 +1041,6 @@ miLineArc ( double yorg, Bool isInt) { - DDXPointPtr points; - int *widths; int xorgi = 0, yorgi = 0; XID oldPixel; Spans spanRec; @@ -1105,17 +1086,10 @@ miLineArc ( } isInt = FALSE; } + if (!InitSpans(&spanRec, pGC->lineWidth)) + return; if (!spanData) { - points = malloc(sizeof(DDXPointRec) * pGC->lineWidth); - if (!points) - return; - widths = malloc(sizeof(int) * pGC->lineWidth); - if (!widths) - { - free(points); - return; - } oldPixel = pGC->fgPixel; if (pixel != oldPixel) { @@ -1124,32 +1098,19 @@ miLineArc ( ValidateGC (pDraw, pGC); } } - else - { - points = malloc(pGC->lineWidth * sizeof (DDXPointRec)); - if (!points) - return; - widths = malloc(pGC->lineWidth * sizeof (int)); - if (!widths) - { - free(points); - return; - } - spanRec.points = points; - spanRec.widths = widths; - } if (isInt) - n = miLineArcI(pDraw, pGC, xorgi, yorgi, points, widths); + n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths); else - n = miLineArcD(pDraw, pGC, xorg, yorg, points, widths, + n = miLineArcD(pDraw, pGC, xorg, yorg, spanRec.points, spanRec.widths, &edge1, edgey1, edgeleft1, &edge2, edgey2, edgeleft2); + spanRec.count = n; if (!spanData) { - (*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE); - free(widths); - free(points); + (*pGC->ops->FillSpans)(pDraw, pGC, spanRec.count, spanRec.points, spanRec.widths, TRUE); + free(spanRec.widths); + free(spanRec.points); if (pixel != oldPixel) { dixChangeGC(NullClient, pGC, GCForeground, &oldPixel, NULL); @@ -1157,10 +1118,7 @@ miLineArc ( } } else - { - spanRec.count = n; AppendSpanGroup (pGC, pixel, &spanRec, spanData); - } } static void From bff8525f8483304d5f93e83e36b47209381da721 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 12:06:50 -0700 Subject: [PATCH 02/11] Simplify miFillPolyHelper and miLineArc. Both functions compute a set of spans and either fill them immediately or accumulate them into a caller-provided buffer. Computing the spans used only the miTranslate and lineWidth fields of pGC, and neither could have been changed by the initial ChangeGC/ValidateGC pair, so it's safe to compute the spans first. Then both functions consume the spans the same way, so factor that into a new fillSpans function. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- mi/miwideline.c | 79 +++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 52 deletions(-) diff --git a/mi/miwideline.c b/mi/miwideline.c index 22e15cf47a..cabc0c1ce6 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -105,6 +105,31 @@ static void miLineArc(DrawablePtr pDraw, GCPtr pGC, * spans-based polygon filler */ +static void +fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, SpanDataPtr spanData) +{ + if (!spanData) + { + XID oldPixel = pGC->fgPixel; + if (pixel != oldPixel) + { + XID tmpPixel = (XID)pixel; + dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL); + ValidateGC (pDrawable, pGC); + } + (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE); + free(spans->widths); + free(spans->points); + if (pixel != oldPixel) + { + dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); + ValidateGC (pDrawable, pGC); + } + } + else + AppendSpanGroup (pGC, pixel, spans, spanData); +} + static void miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, int y, int overall_height, @@ -126,27 +151,13 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, DDXPointPtr ppt; int *pwidth; - XID oldPixel; int xorg; Spans spanRec; - left_height = 0; - right_height = 0; - if (!InitSpans(&spanRec, overall_height)) return; ppt = spanRec.points; pwidth = spanRec.widths; - if (!spanData) - { - oldPixel = pGC->fgPixel; - if (pixel != oldPixel) - { - XID tmpPixel = (XID)pixel; - dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL); - ValidateGC (pDrawable, pGC); - } - } xorg = 0; if (pGC->miTranslate) @@ -219,19 +230,7 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, } } spanRec.count = ppt - spanRec.points; - if (!spanData) - { - (*pGC->ops->FillSpans) (pDrawable, pGC, spanRec.count, spanRec.points, spanRec.widths, TRUE); - free(spanRec.widths); - free(spanRec.points); - if (pixel != oldPixel) - { - dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); - ValidateGC (pDrawable, pGC); - } - } - else - AppendSpanGroup (pGC, pixel, &spanRec, spanData); + fillSpans (pDrawable, pGC, pixel, &spanRec, spanData); } static void @@ -1042,7 +1041,6 @@ miLineArc ( Bool isInt) { int xorgi = 0, yorgi = 0; - XID oldPixel; Spans spanRec; int n; PolyEdgeRec edge1, edge2; @@ -1088,16 +1086,6 @@ miLineArc ( } if (!InitSpans(&spanRec, pGC->lineWidth)) return; - if (!spanData) - { - oldPixel = pGC->fgPixel; - if (pixel != oldPixel) - { - XID tmpPixel = (XID)pixel; - dixChangeGC(NullClient, pGC, GCForeground, &tmpPixel, NULL); - ValidateGC (pDraw, pGC); - } - } if (isInt) n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths); else @@ -1105,20 +1093,7 @@ miLineArc ( &edge1, edgey1, edgeleft1, &edge2, edgey2, edgeleft2); spanRec.count = n; - - if (!spanData) - { - (*pGC->ops->FillSpans)(pDraw, pGC, spanRec.count, spanRec.points, spanRec.widths, TRUE); - free(spanRec.widths); - free(spanRec.points); - if (pixel != oldPixel) - { - dixChangeGC(NullClient, pGC, GCForeground, &oldPixel, NULL); - ValidateGC (pDraw, pGC); - } - } - else - AppendSpanGroup (pGC, pixel, &spanRec, spanData); + fillSpans (pDraw, pGC, pixel, &spanRec, spanData); } static void From 95728ca09d45afc84c8d1828c09c6b6725f1a58d Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 09:25:34 -0700 Subject: [PATCH 03/11] Don't statically allocate the ChangeGC parameter array. Because that's insane. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- mi/miarc.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/mi/miarc.c b/mi/miarc.c index 36b71bf80f..f2959c77b1 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -213,16 +213,6 @@ typedef struct _miPolyArc { miArcJoinPtr joins; } miPolyArcRec, *miPolyArcPtr; -#define GCValsFunction 0 -#define GCValsForeground 1 -#define GCValsBackground 2 -#define GCValsLineWidth 3 -#define GCValsCapStyle 4 -#define GCValsJoinStyle 5 -#define GCValsMask (GCFunction | GCForeground | GCBackground | \ - GCLineWidth | GCCapStyle | GCJoinStyle) -static CARD32 gcvals[6]; - static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); static void newFinalSpan(int y, int xmin, int xmax); static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right, @@ -1045,13 +1035,18 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) pGCTo = GetScratchGC(1, pDraw->pScreen); if (!pGCTo) return; - gcvals[GCValsFunction] = GXcopy; - gcvals[GCValsForeground] = 1; - gcvals[GCValsBackground] = 0; - gcvals[GCValsLineWidth] = pGC->lineWidth; - gcvals[GCValsCapStyle] = pGC->capStyle; - gcvals[GCValsJoinStyle] = pGC->joinStyle; - dixChangeGC(NullClient, pGCTo, GCValsMask, gcvals, NULL); + { + CARD32 gcvals[6]; + gcvals[0] = GXcopy; + gcvals[1] = 1; + gcvals[2] = 0; + gcvals[3] = pGC->lineWidth; + gcvals[4] = pGC->capStyle; + gcvals[5] = pGC->joinStyle; + dixChangeGC(NullClient, pGCTo, GCFunction | + GCForeground | GCBackground | GCLineWidth | + GCCapStyle | GCJoinStyle, gcvals, NULL); + } /* allocate a 1 bit deep pixmap of the appropriate size, and * validate it */ From e2929db7b737413cf93fbebdf4d15abdfebff05c Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 14:10:51 -0700 Subject: [PATCH 04/11] dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere. The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- composite/compalloc.c | 5 +++-- dix/dixfonts.c | 14 +++++++----- dix/gc.c | 18 +++++++++------- dix/window.c | 8 +++---- fb/fbseg.c | 4 +++- glx/glxdriswrast.c | 16 +++++--------- hw/kdrive/ephyr/ephyr_draw.c | 18 ++++++++-------- hw/kdrive/src/kxv.c | 8 +++---- hw/xfree86/common/xf86xv.c | 15 +++++++------ hw/xfree86/xaa/xaaPCache.c | 8 +++---- mi/miarc.c | 23 +++++++++++--------- mi/mibitblt.c | 26 +++++++++++----------- mi/midispcur.c | 24 ++++++++++----------- mi/miexpose.c | 9 ++++---- mi/miglblt.c | 32 +++++++++++++-------------- mi/mipolypnt.c | 12 +++++------ mi/miwideline.c | 42 ++++++++++++++++++------------------ mi/miwideline.h | 8 +++++-- mi/mizerarc.c | 8 +++++-- miext/cw/cw.c | 16 +++++++------- render/mirect.c | 23 ++++++++++---------- xfixes/region.c | 8 +++---- 22 files changed, 181 insertions(+), 164 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index a764972a24..7a8019e618 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 332fb97280..01123c3a90 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 c9b704a66b..e5e6b4face 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 313593b478..595c608563 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 80dd480928..28a9cf04f4 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 a0054515bc..e6cb1eeb10 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 672e0e4eab..f5a3247450 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 bf6600a096..aedf06833d 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 e2d9c15412..2ea305bf05 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 e62f280834..7580c26c9d 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 f2959c77b1..bdcbdf1402 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 f02c04fd43..b767a05194 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<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 11547dbd94..865b60bbc7 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 b4d489a7df..03ce896aa4 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 22a170aa0a..acb4327453 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 b54a9fdbe3..99ba68afd8 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 cabc0c1ce6..c08f9649f5 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 2ff36ed6bb..8d848783c4 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 feaa3cb77f..623347291f 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 1959c8b73d..c3bcdc8cb9 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 0030eff620..38452ec399 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 5e16369628..8ed7fa15d9 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); From 2d7eb4a19b773d0406c0c2e018a7da97f3565fd5 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Fri, 7 May 2010 18:11:36 -0700 Subject: [PATCH 05/11] Pre-validate ChangeGC XIDs. In order to execute a wire-level ChangeGC request, we need to look up the resources named by any XIDs in the value-list. Various places in the server already have pointers to the resources they want to set into the GC, though, so over time the interface has evolved to accept either XIDs or pointers, with several different function call signatures used in different eras. This patch makes the existing code require pointers to resources rather than XIDs, and adds a simple wrapper that looks up any XIDs. The old dixChangeGC API is preserved by delegating to whichever implementation is appropriate. This affects error-handling: If any of the XIDs are invalid, then the GC is unchanged, and its ChangeGC callback is not invoked. This change is allowed by the protocol spec, which says, "The order in which components are verified and altered is server-dependent. If an error is generated, a subset of the components may have been altered." Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- dix/gc.c | 145 ++++++++++++++++++++++++------------------------------- 1 file changed, 64 insertions(+), 81 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index e5e6b4face..6d7a92d774 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -127,24 +127,21 @@ ValidateGC(DrawablePtr pDraw, GC *pGC) */ #define NEXTVAL(_type, _var) { \ - if (pC32) _var = (_type)*pC32++; \ - else { \ _var = (_type)(pUnion->val); pUnion++; \ - } \ } #define NEXT_PTR(_type, _var) { \ - assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; } + _var = (_type)pUnion->ptr; pUnion++; } -int -dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) +static int +ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) { BITS32 index2; - int rc, error = 0; + int error = 0; PixmapPtr pPixmap; BITS32 maskQ; - assert( (pC32 && !pUnion) || (!pC32 && pUnion) ); + assert(pUnion); pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; maskQ = mask; /* save these for when we walk the GCque */ @@ -254,23 +251,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr break; } case GCTile: - if (pUnion) - { - NEXT_PTR(PixmapPtr, pPixmap); - } - else - { - XID newpix; - NEXTVAL(XID, newpix); - rc = dixLookupResourceByType((pointer *)&pPixmap, newpix, - RT_PIXMAP, client, DixReadAccess); - if (rc != Success) - { - clientErrorValue = newpix; - error = (rc == BadValue) ? BadPixmap : rc; - break; - } - } + NEXT_PTR(PixmapPtr, pPixmap); if ((pPixmap->drawable.depth != pGC->depth) || (pPixmap->drawable.pScreen != pGC->pScreen)) { @@ -286,23 +267,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr } break; case GCStipple: - if (pUnion) - { - NEXT_PTR(PixmapPtr, pPixmap); - } - else - { - XID newstipple; - NEXTVAL(XID, newstipple) - rc = dixLookupResourceByType((pointer *)&pPixmap, newstipple, - RT_PIXMAP, client, DixReadAccess); - if (rc != Success) - { - clientErrorValue = newstipple; - error = (rc == BadValue) ? BadPixmap : rc; - break; - } - } + NEXT_PTR(PixmapPtr, pPixmap); if ((pPixmap->drawable.depth != 1) || (pPixmap->drawable.pScreen != pGC->pScreen)) { @@ -325,23 +290,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr case GCFont: { FontPtr pFont; - if (pUnion) - { - NEXT_PTR(FontPtr, pFont); - } - else - { - XID newfont; - NEXTVAL(XID, newfont) - rc = dixLookupResourceByType((pointer *)&pFont, newfont, - RT_FONT, client, DixUseAccess); - if (rc != Success) - { - clientErrorValue = newfont; - error = (rc == BadValue) ? BadFont : rc; - break; - } - } + NEXT_PTR(FontPtr, pFont); pFont->refcnt++; if (pGC->font) CloseFont(pGC->font, (Font)0); @@ -381,28 +330,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr NEXTVAL(INT16, pGC->clipOrg.y); break; case GCClipMask: - if (pUnion) - { - NEXT_PTR(PixmapPtr, pPixmap); - } - else - { - Pixmap pid; - NEXTVAL(Pixmap, pid) - if (pid == None) - pPixmap = NullPixmap; - else { - rc = dixLookupResourceByType((pointer *)&pPixmap, pid, - RT_PIXMAP, client, - DixReadAccess); - if (rc != Success) { - clientErrorValue = pid; - error = (rc == BadValue) ? BadPixmap : rc; - break; - } - } - } - + NEXT_PTR(PixmapPtr, pPixmap); if (pPixmap) { if ((pPixmap->drawable.depth != 1) || @@ -491,6 +419,61 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr #undef NEXTVAL #undef NEXT_PTR +static const struct { + BITS32 mask; + RESTYPE type; + Mask access_mode; +} xidfields[] = { + { GCTile, RT_PIXMAP, DixReadAccess }, + { GCStipple, RT_PIXMAP, DixReadAccess }, + { GCFont, RT_FONT, DixUseAccess }, + { GCClipMask, RT_PIXMAP, DixReadAccess }, +}; + +static int +ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) +{ + ChangeGCVal vals[GCLastBit + 1]; + int i; + if (mask & ~((1 << (GCLastBit + 1)) - 1)) + { + clientErrorValue = mask; + return BadValue; + } + for (i = Ones(mask); i; --i) + vals[i].val = pC32[i]; + for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i) + { + int offset, rc; + if (!(mask & xidfields[i].mask)) + continue; + offset = Ones(mask & (xidfields[i].mask - 1)); + if (xidfields[i].mask == GCClipMask && vals[offset].val == None) + { + vals[offset].ptr = NullPixmap; + continue; + } + rc = dixLookupResourceByType(&vals[offset].ptr, vals[offset].val, + xidfields[i].type, client, xidfields[i].access_mode); + if (rc != Success) + { + clientErrorValue = vals[offset].val; + if (rc == BadValue) + rc = (xidfields[i].type == RT_PIXMAP) ? BadPixmap : BadFont; + return rc; + } + } + return ChangeGC(client, pGC, mask, vals); +} + +int +dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) +{ + if (pC32) + return ChangeGCXIDs(client, pGC, mask, pC32); + return ChangeGC(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. From 6a84cd943430cfc9df55c83aef6a7f8dea6dbb94 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Fri, 7 May 2010 19:38:05 -0700 Subject: [PATCH 06/11] Replace dixChangeGC with calls directly to the right variant. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- composite/compalloc.c | 2 +- dbe/dbe.c | 2 +- dix/dispatch.c | 2 +- dix/dixfonts.c | 8 ++-- dix/gc.c | 73 +++++++++++++----------------------- dix/glyphcurs.c | 5 +-- dix/window.c | 13 +++---- fb/fbseg.c | 2 +- glx/glxdriswrast.c | 4 +- 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 | 8 ++-- mi/mibitblt.c | 23 ++++++------ mi/midispcur.c | 10 ++--- mi/miexpose.c | 6 +-- mi/miglblt.c | 8 ++-- mi/mipolypnt.c | 4 +- mi/miwideline.c | 12 +++--- mi/miwideline.h | 4 +- mi/mizerarc.c | 4 +- miext/cw/cw.c | 8 ++-- render/mirect.c | 4 +- xfixes/region.c | 2 +- 26 files changed, 104 insertions(+), 121 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index 7a8019e618..3694ab868b 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -501,7 +501,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) val.val = IncludeInferiors; ValidateGC(&pPixmap->drawable, pGC); - dixChangeGC (serverClient, pGC, GCSubwindowMode, NULL, &val); + ChangeGC (serverClient, pGC, GCSubwindowMode, &val); (*pGC->ops->CopyArea) (&pParent->drawable, &pPixmap->drawable, pGC, diff --git a/dbe/dbe.c b/dbe/dbe.c index 1d14bb38a0..f4d088c8a0 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 ChangeGC(NullClient, pGC, gcmask, gcvalues) == 0; } /* DbeSetupBackgroundPainter() */ diff --git a/dix/dispatch.c b/dix/dispatch.c index 4dc9ecd9d2..d6a8a5aaf2 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1537,7 +1537,7 @@ ProcChangeGC(ClientPtr client) if (len != Ones(stuff->mask)) return BadLength; - result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); + result = ChangeGCXIDs(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 01123c3a90..585754b572 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1263,7 +1263,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) { ChangeGCVal val; val.ptr = pFont; - dixChangeGC(NullClient, c->pGC, GCFont, NULL, &val); + ChangeGC(NullClient, c->pGC, GCFont, &val); ValidateGC(c->pDraw, c->pGC); if (c->reqType == X_PolyText8) c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; @@ -1408,7 +1408,7 @@ bail: { ChangeGCVal val; val.ptr = pFont; - dixChangeGC(NullClient, origGC, GCFont, NULL, &val); + ChangeGC(NullClient, origGC, GCFont, &val); ValidateGC(c->pDraw, origGC); } @@ -1427,7 +1427,7 @@ bail: if (c->slept) { ClientWakeup(c->client); - dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, clearGC); + ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ CloseFont(c->pGC->font, (Font)0); @@ -1584,7 +1584,7 @@ bail: if (c->slept) { ClientWakeup(c->client); - dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, 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 6d7a92d774..1f2d4d05b1 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 +/* + * ChangeGC/ChangeGCXIDs: + * + * 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 ChangeGCXIDs: * - * example calling dixChangeGC using pC32 parameter - * * CARD32 v[2]; - * v[0] = foreground; - * v[1] = background; - * dixChangeGC(client, pGC, GCForeground|GCBackground, v, NULL); + * v[0] = FillTiled; + * v[1] = pid; + * ChangeGCXIDs(client, pGC, GCFillStyle|GCTile, v); * - * example calling dixChangeGC using pUnion parameter; - * same effect as above + * However, if you need to pass a pointer to a pixmap or font, you must + * use ChangeGC: + * + * ChangeGCVal v[2]; + * v[0].val = FillTiled; + * v[1].ptr = pPixmap; + * ChangeGC(client, pGC, GCFillStyle|GCTile, v); + * + * If you have neither XIDs nor pointers, you can use either function, + * but ChangeGC will do less work. * * ChangeGCVal v[2]; * v[0].val = foreground; * v[1].val = background; - * dixChangeGC(client, pGC, GCForeground|GCBackground, NULL, v); - * - * However, if you need to pass a pointer to a pixmap or font, you MUST - * use the pUnion parameter. - * - * 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); - * - * 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. + * ChangeGC(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 ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) { BITS32 index2; @@ -430,7 +419,7 @@ static const struct { { GCClipMask, RT_PIXMAP, DixReadAccess }, }; -static int +int ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) { ChangeGCVal vals[GCLastBit + 1]; @@ -466,14 +455,6 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) return ChangeGC(client, pGC, mask, vals); } -int -dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) -{ - if (pC32) - return ChangeGCXIDs(client, pGC, mask, pC32); - return ChangeGC(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(client, pGC, mask, pval, NULL); + *pStatus = ChangeGCXIDs(client, pGC, mask, pval); else *pStatus = Success; @@ -600,7 +581,7 @@ CreateDefaultTile (GCPtr pGC) tmpval[0].val = GXcopy; tmpval[1].val = pGC->tile.pixel; tmpval[2].val = FillSolid; - (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, NULL, tmpval); + (void)ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval); ValidateGC((DrawablePtr)pTile, pgcScratch); rect.x = 0; rect.y = 0; @@ -941,7 +922,7 @@ CreateDefaultStipple(int screenNum) (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]); return FALSE; } - (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, NULL, 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/glyphcurs.c b/dix/glyphcurs.c index f10400f7b0..fa2aeca26d 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); + ChangeGC(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); + ChangeGC(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 595c608563..57cebf46a2 100644 --- a/dix/window.c +++ b/dix/window.c @@ -328,7 +328,7 @@ MakeRootTile(WindowPtr pWin) attributes[0].val = pScreen->whitePixel; attributes[1].val = pScreen->blackPixel; - (void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, attributes); + (void)ChangeGC(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); + ChangeGC(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); + ChangeGC(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); + ChangeGC(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); + ChangeGC(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); + ChangeGC(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 28a9cf04f4..999be1cda5 100644 --- a/fb/fbseg.c +++ b/fb/fbseg.c @@ -252,7 +252,7 @@ fbSetFg (DrawablePtr pDrawable, { ChangeGCVal val; val.val = fg; - dixChangeGC (NullClient, pGC, GCForeground, NULL, &val); + ChangeGC (NullClient, pGC, GCForeground, &val); ValidateGC (pDrawable, pGC); } } diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index e6cb1eeb10..ac8fd47c46 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -327,9 +327,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->swapgc = CreateScratchGC(pScreen, pDraw->depth); gcvals[0].val = GXcopy; - dixChangeGC(NullClient, private->gc, GCFunction, NULL, gcvals); + ChangeGC(NullClient, private->gc, GCFunction, gcvals); gcvals[1].val = FALSE; - dixChangeGC(NullClient, private->gc, GCFunction | GCGraphicsExposures, NULL, gcvals); + 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 f5a3247450..b1982a5e61 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].val = alu; tmpval[1].val = pm; tmpval[2].val = fg; - dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, NULL, tmpval); + ChangeGC(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].val = alu; tmpval[1].val = pm; - dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, NULL, tmpval); + 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 aedf06833d..c81d7daaa4 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].val = fg; val[1].val = IncludeInferiors; - dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, NULL, val); + ChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val); ValidateGC (pDraw, pGC); diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 2ea305bf05..2b33f2585e 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -1856,7 +1856,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) } else if (key != pGC->fgPixel){ ChangeGCVal val; val.val = key; - dixChangeGC(NullClient, pGC, GCForeground, NULL, &val); + ChangeGC(NullClient, pGC, GCForeground, &val); ValidateGC(pDraw, pGC); } @@ -1893,7 +1893,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) gc = GetScratchGC(root->depth, pScreen); pval[0].val = key; pval[1].val = IncludeInferiors; - (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, NULL, pval); + (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval); ValidateGC(root, gc); rects = malloc(nbox * sizeof(xRectangle)); diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 7580c26c9d..598a1bec8e 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].val = fg; gcvals[1].val = bg; - dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcvals); + ChangeGC(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 3fa953d560..63eecbd663 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 int ChangeGCXIDs( + ClientPtr /*client*/, + GCPtr /*pGC*/, + BITS32 /*mask*/, + CARD32 * /*pval*/); + +extern _X_EXPORT int ChangeGC( 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 bdcbdf1402..7e8ec1f503 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1043,9 +1043,9 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) gcvals[3].val = pGC->lineWidth; gcvals[4].val = pGC->capStyle; gcvals[5].val = pGC->joinStyle; - dixChangeGC(NullClient, pGCTo, GCFunction | + ChangeGC(NullClient, pGCTo, GCFunction | GCForeground | GCBackground | GCLineWidth | - GCCapStyle | GCJoinStyle, NULL, gcvals); + GCCapStyle | GCJoinStyle, gcvals); } /* allocate a 1 bit deep pixmap of the appropriate size, and @@ -1088,11 +1088,11 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) ChangeGCVal gcval; if (iphase == 1) { gcval.val = bg; - dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); + ChangeGC (NullClient, pGC, GCForeground, &gcval); ValidateGC (pDraw, pGC); } else if (pGC->lineStyle == LineDoubleDash) { gcval.val = fg; - dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); + 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 b767a05194..9c6e03d533 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); + ChangeGC(NullClient, pGCT, GCBackground, gcv); ValidateGC((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT); ppt = pptFirst = malloc(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, + ChangeGC(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); + ChangeGC(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); + ChangeGC(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, + ChangeGC(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.val = (XID)planeMask; - dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, &gcv); + ChangeGC(NullClient, pGC, GCPlaneMask, &gcv); ValidateGC((DrawablePtr)pPixmap, pGC); } @@ -776,7 +775,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth, oldBg = pGC->bgPixel; gcv[0].val = (XID)~0; gcv[1].val = (XID)0; - dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcv); + ChangeGC(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].val = (XID)i; - dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, gcv); + ChangeGC(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].val = (XID)oldPlanemask; gcv[1].val = (XID)oldFg; gcv[2].val = (XID)oldBg; - dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, NULL, gcv); + ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv); ValidateGC(pDraw, pGC); break; diff --git a/mi/midispcur.c b/mi/midispcur.c index 865b60bbc7..1acc469333 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.val = GXand; - dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals); + 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, @@ -314,13 +314,13 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) /* mask bits -- pCursor->mask & ~pCursor->source */ gcvals.val = GXcopy; - dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals); + 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.val = GXandInverted; - dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals); + 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, @@ -371,7 +371,7 @@ miDCPutBits ( if (sourceGC->fgPixel != source) { gcval.val = source; - dixChangeGC (NullClient, sourceGC, GCForeground, NULL, &gcval); + ChangeGC (NullClient, sourceGC, GCForeground, &gcval); } if (sourceGC->serialNumber != pDrawable->serialNumber) ValidateGC (pDrawable, sourceGC); @@ -391,7 +391,7 @@ miDCPutBits ( if (maskGC->fgPixel != mask) { gcval.val = mask; - dixChangeGC (NullClient, maskGC, GCForeground, NULL, &gcval); + ChangeGC (NullClient, maskGC, GCForeground, &gcval); } if (maskGC->serialNumber != pDrawable->serialNumber) ValidateGC (pDrawable, maskGC); diff --git a/mi/miexpose.c b/mi/miexpose.c index 03ce896aa4..a99e53008c 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); + ChangeGC (NullClient, pGC, gcmask, gcval); ValidateGC (drawable, pGC); numRects = REGION_NUM_RECTS(prgn); @@ -692,9 +692,9 @@ miClearDrawable(DrawablePtr pDraw, GCPtr pGC) rect.y = 0; rect.width = pDraw->width; rect.height = pDraw->height; - dixChangeGC(NullClient, pGC, GCForeground, NULL, &bg); + ChangeGC(NullClient, pGC, GCForeground, &bg); ValidateGC(pDraw, pGC); (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); - dixChangeGC(NullClient, pGC, GCForeground, NULL, &fg); + ChangeGC(NullClient, pGC, GCForeground, &fg); ValidateGC(pDraw, pGC); } diff --git a/mi/miglblt.c b/mi/miglblt.c index acb4327453..13efb0ced3 100644 --- a/mi/miglblt.c +++ b/mi/miglblt.c @@ -138,7 +138,7 @@ miPolyGlyphBlt( gcvals[1].val = 1; gcvals[2].val = 0; - dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, NULL, gcvals); + ChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals); nbyLine = BitmapBytePad(width); pbits = malloc(height*nbyLine); @@ -237,13 +237,13 @@ miImageGlyphBlt( gcvals[0].val = GXcopy; gcvals[1].val = pGC->bgPixel; gcvals[2].val = FillSolid; - dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals); + ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect); /* put down the glyphs */ gcvals[0].val = oldFG; - dixChangeGC(NullClient, pGC, GCForeground, NULL, gcvals); + ChangeGC(NullClient, pGC, GCForeground, gcvals); ValidateGC(pDrawable, pGC); (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); @@ -252,7 +252,7 @@ miImageGlyphBlt( gcvals[0].val = oldAlu; gcvals[1].val = oldFG; gcvals[2].val = oldFS; - dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals); + ChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals); ValidateGC(pDrawable, pGC); } diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c index 99ba68afd8..3e43a523e4 100644 --- a/mi/mipolypnt.c +++ b/mi/mipolypnt.c @@ -107,7 +107,7 @@ miPolyPoint( fsNew.val = FillSolid; if(pGC->fillStyle != FillSolid) { - dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsNew); + ChangeGC(NullClient, pGC, GCFillStyle, &fsNew); ValidateGC(pDrawable, pGC); } pwidth = pwidthInit; @@ -117,7 +117,7 @@ miPolyPoint( if(fsOld.val != FillSolid) { - dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsOld); + ChangeGC(NullClient, pGC, GCFillStyle, &fsOld); ValidateGC(pDrawable, pGC); } free(pwidthInit); diff --git a/mi/miwideline.c b/mi/miwideline.c index c08f9649f5..5f3d582157 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -115,7 +115,7 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S if (pixel != oldPixel.val) { tmpPixel.val = (XID)pixel; - dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel); + ChangeGC (NullClient, pGC, GCForeground, &tmpPixel); ValidateGC (pDrawable, pGC); } (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE); @@ -123,7 +123,7 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S free(spans->points); if (pixel != oldPixel.val) { - dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel); + ChangeGC (NullClient, pGC, GCForeground, &oldPixel); ValidateGC (pDrawable, pGC); } } @@ -261,13 +261,13 @@ miFillRectPolyHelper ( if (pixel != oldPixel.val) { tmpPixel.val = (XID)pixel; - dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel); + ChangeGC (NullClient, pGC, GCForeground, &tmpPixel); ValidateGC (pDrawable, pGC); } (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect); if (pixel != oldPixel.val) { - dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel); + ChangeGC (NullClient, pGC, GCForeground, &oldPixel); ValidateGC (pDrawable, pGC); } } @@ -1504,14 +1504,14 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData) oldPixel.val = pGC->fgPixel; if (pixel.val != oldPixel.val) { - dixChangeGC (NullClient, pGC, GCForeground, NULL, &pixel); + ChangeGC (NullClient, pGC, GCForeground, &pixel); ValidateGC (pDrawable, pGC); } miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup); miFreeSpanGroup (&spanData->bgGroup); if (pixel.val != oldPixel.val) { - dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel); + ChangeGC (NullClient, pGC, GCForeground, &oldPixel); ValidateGC (pDrawable, pGC); } } diff --git a/mi/miwideline.h b/mi/miwideline.h index 8d848783c4..e08aa6833d 100644 --- a/mi/miwideline.h +++ b/mi/miwideline.h @@ -80,7 +80,7 @@ typedef struct _LineFace { if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = pixel; \ - dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \ + ChangeGC (NullClient, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } @@ -88,7 +88,7 @@ typedef struct _LineFace { if (pixel != oldPixel) { \ ChangeGCVal gcval; \ gcval.val = oldPixel; \ - dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \ + ChangeGC (NullClient, pGC, GCForeground, &gcval); \ ValidateGC (pDrawable, pGC); \ } \ } diff --git a/mi/mizerarc.c b/mi/mizerarc.c index 623347291f..5adf3dd09d 100644 --- a/mi/mizerarc.c +++ b/mi/mizerarc.c @@ -805,7 +805,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { ChangeGCVal gcval; gcval.val = pGC->bgPixel; - dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval); + ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } pts = &points[numPts >> 1]; @@ -835,7 +835,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { ChangeGCVal gcval; gcval.val = fgPixel; - dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval); + ChangeGC(NullClient, pGC, GCForeground, &gcval); ValidateGC(pDraw, pGC); } } diff --git a/miext/cw/cw.c b/miext/cw/cw.c index c3bcdc8cb9..460862f5f1 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].val = x_off - pDrawable->x; vals[1].val = y_off - pDrawable->y; - dixChangeGC(NullClient, pBackingGC, - (GCClipXOrigin | GCClipYOrigin), NULL, vals); + ChangeGC(NullClient, pBackingGC, + (GCClipXOrigin | GCClipYOrigin), vals); pPriv->serialNumber = pDrawable->serialNumber; /* @@ -226,8 +226,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) ChangeGCVal vals[2]; vals[0].val = pGC->patOrg.x + x_off; vals[1].val = pGC->patOrg.y + y_off; - dixChangeGC(NullClient, pBackingGC, - (GCTileStipXOrigin | GCTileStipYOrigin), NULL, vals); + ChangeGC(NullClient, pBackingGC, + (GCTileStipXOrigin | GCTileStipYOrigin), vals); } ValidateGC(pBackingDrawable, pBackingGC); diff --git a/render/mirect.c b/render/mirect.c index 38452ec399..13d7fa6028 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, NULL, tmpval); + ChangeGC (NullClient, pGC, mask, tmpval); ValidateGC (pDst->pDrawable, pGC); if (xoff || yoff) { @@ -149,7 +149,7 @@ miCompositeRects (CARD8 op, gcvals[0].val = GXcopy; gcvals[1].val = pixel; - dixChangeGC (NullClient, pGC, GCFunction | GCForeground, NULL, gcvals); + 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 8ed7fa15d9..d5f583f1b4 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -642,7 +642,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) vals[0].val = stuff->xOrigin; vals[1].val = stuff->yOrigin; - dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, NULL, vals); + ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals); (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); return (client->noClientException); From 5193f25ea33eed31d6a75cdc1a86427c23d8033c Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 19:08:47 -0700 Subject: [PATCH 07/11] Define GCAllBits as the union of all valid CreateGC masks. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- dix/gc.c | 8 ++++---- include/gcstruct.h | 2 ++ miext/cw/cw.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index 1f2d4d05b1..43d16db4d8 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -424,7 +424,7 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) { ChangeGCVal vals[GCLastBit + 1]; int i; - if (mask & ~((1 << (GCLastBit + 1)) - 1)) + if (mask & ~GCAllBits) { clientErrorValue = mask; return BadValue; @@ -534,7 +534,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, if (*pStatus != Success) goto out; - pGC->stateChanges = (1 << (GCLastBit+1)) - 1; + pGC->stateChanges = GCAllBits; if (!(*pGC->pScreen->CreateGC)(pGC)) *pStatus = BadAlloc; else if (mask) @@ -837,7 +837,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) pGC->lastWinOrg.x = 0; pGC->lastWinOrg.y = 0; - pGC->stateChanges = (1 << (GCLastBit+1)) - 1; + pGC->stateChanges = GCAllBits; if (!(*pScreen->CreateGC)(pGC)) { FreeGC(pGC, (XID)0); @@ -1118,7 +1118,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen) pGC->clipOrg.y = 0; if (pGC->clientClipType != CT_NONE) (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); - pGC->stateChanges = (1 << (GCLastBit+1)) - 1; + pGC->stateChanges = GCAllBits; return pGC; } /* if we make it this far, need to roll our own */ diff --git a/include/gcstruct.h b/include/gcstruct.h index 8d9b055756..b9fc5cace5 100644 --- a/include/gcstruct.h +++ b/include/gcstruct.h @@ -59,6 +59,8 @@ SOFTWARE. #include "privates.h" #include +#define GCAllBits ((1 << (GCLastBit + 1)) - 1) + /* * functions which modify the state of the GC */ diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 460862f5f1..2d8fd12cfa 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -129,7 +129,7 @@ cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable) return FALSE; pPriv->serialNumber = 0; - pPriv->stateChanges = (1 << (GCLastBit + 1)) - 1; + pPriv->stateChanges = GCAllBits; return TRUE; } From 653e4878c4cc03613172a93ad4800e1eacc98f17 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 19:18:11 -0700 Subject: [PATCH 08/11] Quit using clientErrorValue in dix/gc.c. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- dix/dispatch.c | 15 ++++++++------- dix/gc.c | 43 +++++++++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index d6a8a5aaf2..fddfb709c9 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1541,10 +1541,7 @@ ProcChangeGC(ClientPtr client) if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return(result); - } } int @@ -1564,14 +1561,16 @@ ProcCopyGC(ClientPtr client) return result; if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) return (BadMatch); + if (stuff->mask & ~GCAllBits) + { + client->errorValue = stuff->mask; + return BadValue; + } result = CopyGC(pGC, dstGC, stuff->mask); if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return(result); - } } int @@ -1598,7 +1597,9 @@ ProcSetDashes(ClientPtr client) return(client->noClientException); else { - client->errorValue = clientErrorValue; + /* If there's an error, either there's no sensible errorValue, + * or there was a dash segment of 0. */ + client->errorValue = 0; return(result); } } diff --git a/dix/gc.c b/dix/gc.c index 43d16db4d8..00b63bd2d7 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -66,7 +66,6 @@ SOFTWARE. #include "xace.h" #include -extern XID clientErrorValue; extern FontPtr defaultFont; static Bool CreateDefaultTile(GCPtr pGC); @@ -149,7 +148,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->alu = newalu; else { - clientErrorValue = newalu; + if (client) + client->errorValue = newalu; error = BadValue; } break; @@ -182,7 +182,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->lineStyle = newlinestyle; else { - clientErrorValue = newlinestyle; + if (client) + client->errorValue = newlinestyle; error = BadValue; } break; @@ -195,7 +196,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->capStyle = newcapstyle; else { - clientErrorValue = newcapstyle; + if (client) + client->errorValue = newcapstyle; error = BadValue; } break; @@ -208,7 +210,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->joinStyle = newjoinstyle; else { - clientErrorValue = newjoinstyle; + if (client) + client->errorValue = newjoinstyle; error = BadValue; } break; @@ -221,7 +224,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->fillStyle = newfillstyle; else { - clientErrorValue = newfillstyle; + if (client) + client->errorValue = newfillstyle; error = BadValue; } break; @@ -234,7 +238,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->fillRule = newfillrule; else { - clientErrorValue = newfillrule; + if (client) + client->errorValue = newfillrule; error = BadValue; } break; @@ -294,7 +299,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->subWindowMode = newclipmode; else { - clientErrorValue = newclipmode; + if (client) + client->errorValue = newclipmode; error = BadValue; } break; @@ -307,7 +313,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->graphicsExposures = newge; else { - clientErrorValue = newge; + if (client) + client->errorValue = newge; error = BadValue; } break; @@ -368,7 +375,8 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) } else { - clientErrorValue = newdash; + if (client) + client->errorValue = newdash; error = BadValue; } break; @@ -381,13 +389,15 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion) pGC->arcMode = newarcmode; else { - clientErrorValue = newarcmode; + if (client) + client->errorValue = newarcmode; error = BadValue; } break; } default: - clientErrorValue = maskQ; + if (client) + client->errorValue = maskQ; error = BadValue; break; } @@ -426,7 +436,7 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) int i; if (mask & ~GCAllBits) { - clientErrorValue = mask; + client->errorValue = mask; return BadValue; } for (i = Ones(mask); i; --i) @@ -446,7 +456,7 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32) xidfields[i].type, client, xidfields[i].access_mode); if (rc != Success) { - clientErrorValue = vals[offset].val; + client->errorValue = vals[offset].val; if (rc == BadValue) rc = (xidfields[i].type == RT_PIXMAP) ? BadPixmap : BadFont; return rc; @@ -737,9 +747,7 @@ CopyGC(GC *pgcSrc, GC *pgcDst, BITS32 mask) pgcDst->arcMode = pgcSrc->arcMode; break; default: - clientErrorValue = maskQ; - error = BadValue; - break; + FatalError ("CopyGC: Unhandled mask!\n"); } } if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel) @@ -955,7 +963,6 @@ SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash) if (!*p++) { /* dash segment must be > 0 */ - clientErrorValue = 0; return BadValue; } } From a3d948ddbb54b9e831e67f22d5031922a3c44107 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Thu, 6 May 2010 12:35:52 -0700 Subject: [PATCH 09/11] clientErrorValue is never used outside dix. Stop importing it. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- Xext/panoramiXprocs.c | 7 ------- Xext/xvmain.c | 2 -- glx/xfont.c | 2 -- 3 files changed, 11 deletions(-) diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 75f758da5a..47362df4d9 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -52,13 +52,6 @@ Equipment Corporation. #define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ CWDontPropagate | CWOverrideRedirect | CWCursor ) -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -extern XID clientErrorValue; /* XXX this is a kludge */ - int PanoramiXCreateWindow(ClientPtr client) { PanoramiXRes *parent, *newWin; diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 13cd600a14..72678f766b 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -126,8 +126,6 @@ unsigned long XvRTPortNotify; /* EXTERNAL */ -extern XID clientErrorValue; - static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *); static Bool CreateResourceTypes(void); diff --git a/glx/xfont.c b/glx/xfont.c index 35fad4d5a8..f0b5644b94 100644 --- a/glx/xfont.c +++ b/glx/xfont.c @@ -46,8 +46,6 @@ #include #include -extern XID clientErrorValue; /* imported kludge from dix layer */ - /* ** Make a single GL bitmap from a single X glyph */ From 11c69880c7c48ef9e755c4e09fadef7a629d7bc7 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 8 May 2010 22:16:32 -0700 Subject: [PATCH 10/11] Quit using clientErrorValue in dix/colormap.c. And that's it! No more clientErrorValue kludge. Signed-off-by: Jamey Sharp Reviewed-by: Keith Packard --- dix/colormap.c | 26 ++++++++++++-------------- dix/dispatch.c | 22 +++------------------- dix/window.c | 2 +- hw/kdrive/src/kcmap.c | 2 +- hw/vfb/InitOutput.c | 2 +- hw/xfree86/vgahw/vgaCmap.c | 2 +- include/colormap.h | 6 ++++-- render/miindex.c | 2 +- 8 files changed, 24 insertions(+), 40 deletions(-) diff --git a/dix/colormap.c b/dix/colormap.c index 9a4ff28455..f75eefe14c 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -65,8 +65,6 @@ SOFTWARE. #include "privates.h" #include "xace.h" -extern XID clientErrorValue; - static Pixel FindBestPixel( EntryPtr /*pentFirst*/, int /*size*/, @@ -1415,7 +1413,7 @@ BlueComp (EntryPtr pent, xrgb *prgb) /* Read the color value of a cell */ int -QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) +QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList, ClientPtr client) { Pixel *ppix, pixel; xrgb *prgb; @@ -1438,14 +1436,14 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) { pixel = *ppix; if (pixel & rgbbad) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } i = (pixel & pVisual->redMask) >> pVisual->offsetRed; if (i >= numred) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1453,7 +1451,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (i >= numgreen) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1461,7 +1459,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (i >= numblue) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; continue; } @@ -1475,7 +1473,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) pixel = *ppix; if (pixel >= pVisual->ColormapEntries) { - clientErrorValue = pixel; + client->errorValue = pixel; errVal = BadValue; } else @@ -2238,7 +2236,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) } if ((mask != rmask) && count) { - clientErrorValue = *pixels | mask; + clients[client]->errorValue = *pixels | mask; result = BadValue; } /* XXX should worry about removing any RT_CMAPENTRY resource */ @@ -2320,7 +2318,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe pixTest = ((*pptr | bits) & cmask) >> offset; if ((pixTest >= numents) || (*pptr & rgbbad)) { - clientErrorValue = *pptr | bits; + clients[client]->errorValue = *pptr | bits; errVal = BadValue; continue; } @@ -2401,7 +2399,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe /* Redefine color values */ int -StoreColors (ColormapPtr pmap, int count, xColorItem *defs) +StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client) { Pixel pix; xColorItem *pdef; @@ -2439,7 +2437,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) if (pdef->pixel & rgbbad) { errVal = BadValue; - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; continue; } pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; @@ -2511,7 +2509,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) defs[idef] = defs[n]; idef++; } else - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; } } else @@ -2522,7 +2520,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs) ok = TRUE; if (pdef->pixel >= pVisual->ColormapEntries) { - clientErrorValue = pdef->pixel; + client->errorValue = pdef->pixel; errVal = BadValue; ok = FALSE; } diff --git a/dix/dispatch.c b/dix/dispatch.c index fddfb709c9..aee9143e9a 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -176,13 +176,6 @@ CallbackListPtr ClientStateCallback; volatile char dispatchException = 0; volatile char isItTimeToYield; -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -XID clientErrorValue; /* XXX this is a kludge */ - #define SAME_SCREENS(a, b) (\ (a.pScreen == b.pScreen)) @@ -2833,10 +2826,7 @@ ProcFreeColors(ClientPtr client) if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } else @@ -2864,14 +2854,11 @@ ProcStoreColors (ClientPtr client) if (count % sizeof(xColorItem)) return(BadLength); count /= sizeof(xColorItem); - rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); + rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1], client); if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } else { @@ -2899,7 +2886,7 @@ ProcStoreNamedColor (ClientPtr client) { def.flags = stuff->flags; def.pixel = stuff->pixel; - rc = StoreColors(pcmp, 1, &def); + rc = StoreColors(pcmp, 1, &def, client); if (client->noClientException != Success) return(client->noClientException); else @@ -2934,16 +2921,13 @@ ProcQueryColors(ClientPtr client) prgbs = calloc(1, count * sizeof(xrgb)); if(!prgbs && count) return(BadAlloc); - if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) + if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) ) { if (prgbs) free(prgbs); if (client->noClientException != Success) return(client->noClientException); else - { - client->errorValue = clientErrorValue; return rc; - } } memset(&qcr, 0, sizeof(xQueryColorsReply)); qcr.type = X_Reply; diff --git a/dix/window.c b/dix/window.c index 57cebf46a2..20cf452045 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3743,7 +3743,7 @@ DrawLogo(WindowPtr pWin) querypixels[0] = fore[0].val; querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); + QueryColors(cmap, 2, querypixels, rgb, serverClient); if ((rgb[0].red == rgb[1].red) && (rgb[0].green == rgb[1].green) && (rgb[0].blue == rgb[1].blue)) { diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c index 40697e091b..9bfdd78b65 100644 --- a/hw/kdrive/src/kcmap.c +++ b/hw/kdrive/src/kcmap.c @@ -58,7 +58,7 @@ KdSetColormap (ScreenPtr pScreen) for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) pixels[i] = i; - QueryColors (pCmap, (1 << pScreenPriv->screen->fb.depth), pixels, colors); + QueryColors (pCmap, (1 << pScreenPriv->screen->fb.depth), pixels, colors, serverClient); for (i = 0; i < (1 << pScreenPriv->screen->fb.depth); i++) { diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 7af5f93358..0f0edb2a9b 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -445,7 +445,7 @@ vfbInstallColormap(ColormapPtr pmap) for (i = 0; i < entries; i++) ppix[i] = i; /* XXX truecolor */ - QueryColors(pmap, entries, ppix, prgb); + QueryColors(pmap, entries, ppix, prgb, serverClient); for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */ diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c index dad71b93e6..4720f4db83 100644 --- a/hw/xfree86/vgahw/vgaCmap.c +++ b/hw/xfree86/vgahw/vgaCmap.c @@ -246,7 +246,7 @@ vgaInstallColormap(pmap) for ( i=0; i Date: Mon, 10 May 2010 20:22:05 -0700 Subject: [PATCH 11/11] Eliminate boilerplate around client->noClientException. Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp Reviewed-by: Daniel Stone --- Xext/bigreq.c | 2 +- Xext/dpms.c | 16 +- Xext/geext.c | 2 +- Xext/panoramiX.c | 12 +- Xext/panoramiXprocs.c | 30 +-- Xext/saver.c | 6 +- Xext/security.c | 7 +- Xext/shape.c | 8 +- Xext/shm.c | 18 +- Xext/sync.c | 14 +- Xext/xcalibrate.c | 6 +- Xext/xcmisc.c | 6 +- Xext/xf86bigfont.c | 4 +- Xext/xres.c | 8 +- Xext/xselinux_ext.c | 6 +- Xext/xtest.c | 8 +- Xext/xvdisp.c | 4 +- Xi/exevents.c | 2 +- composite/compext.c | 10 +- damageext/damageext.c | 10 +- dbe/dbe.c | 6 +- dix/devices.c | 8 +- dix/dispatch.c | 354 +++++++++----------------- dix/extension.c | 4 +- dix/property.c | 14 +- dix/selection.c | 8 +- glx/glxext.c | 2 +- hw/dmx/dmx.c | 28 +- hw/dmx/dmxfont.c | 2 - hw/kdrive/ephyr/ephyrdriext.c | 24 +- hw/xfree86/dixmods/extmod/xf86dga2.c | 64 +++-- hw/xfree86/dixmods/extmod/xf86vmode.c | 44 ++-- hw/xfree86/dri/xf86dri.c | 24 +- hw/xfree86/dri2/dri2ext.c | 36 +-- hw/xquartz/applewm.c | 26 +- hw/xquartz/pseudoramiX.c | 10 +- hw/xquartz/xpr/appledri.c | 14 +- hw/xwin/winwindowswm.c | 14 +- randr/rrcrtc.c | 14 +- randr/rrdispatch.c | 2 +- randr/rrmode.c | 2 +- randr/rroutput.c | 6 +- randr/rrproperty.c | 14 +- randr/rrscreen.c | 8 +- randr/rrxinerama.c | 12 +- record/record.c | 4 +- render/render.c | 50 ++-- xfixes/cursor.c | 16 +- xfixes/region.c | 49 ++-- xfixes/saveset.c | 6 +- xfixes/xfixes.c | 2 +- xkb/xkb.c | 50 ++-- 52 files changed, 475 insertions(+), 621 deletions(-) diff --git a/Xext/bigreq.c b/Xext/bigreq.c index f9f15edc5d..ce3734e8d3 100644 --- a/Xext/bigreq.c +++ b/Xext/bigreq.c @@ -76,5 +76,5 @@ ProcBigReqDispatch (ClientPtr client) swapl(&rep.max_request_size, n); } WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep); - return(client->noClientException); + return Success; } diff --git a/Xext/dpms.c b/Xext/dpms.c index df63a8bf1e..33a6e267cf 100644 --- a/Xext/dpms.c +++ b/Xext/dpms.c @@ -61,7 +61,7 @@ ProcDPMSGetVersion(ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -82,7 +82,7 @@ ProcDPMSCapable(ClientPtr client) swaps(&rep.sequenceNumber, n); } WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -108,7 +108,7 @@ ProcDPMSGetTimeouts(ClientPtr client) swaps(&rep.off, n); } WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -134,7 +134,7 @@ ProcDPMSSetTimeouts(ClientPtr client) DPMSOffTime = stuff->off * MILLI_PER_SECOND; SetScreenSaverTimer(); - return(client->noClientException); + return Success; } static int @@ -150,7 +150,7 @@ ProcDPMSEnable(ClientPtr client) SetScreenSaverTimer(); } - return(client->noClientException); + return Success; } static int @@ -164,7 +164,7 @@ ProcDPMSDisable(ClientPtr client) DPMSEnabled = FALSE; - return(client->noClientException); + return Success; } static int @@ -187,7 +187,7 @@ ProcDPMSForceLevel(ClientPtr client) DPMSSet(client, stuff->level); - return(client->noClientException); + return Success; } static int @@ -210,7 +210,7 @@ ProcDPMSInfo(ClientPtr client) swaps(&rep.power_level, n); } WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep); - return(client->noClientException); + return Success; } static int diff --git a/Xext/geext.c b/Xext/geext.c index f0a3d87789..b7f32c079c 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -91,7 +91,7 @@ ProcGEQueryVersion(ClientPtr client) } WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep); - return(client->noClientException); + return Success; } int (*ProcGEVector[GENumberRequests])(ClientPtr) = { diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 38b2f48d67..31286d41f6 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -917,7 +917,7 @@ ProcPanoramiXQueryVersion (ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } int @@ -944,7 +944,7 @@ ProcPanoramiXGetState(ClientPtr client) swapl (&rep.window, n); } WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -972,7 +972,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client) swapl (&rep.window, n); } WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep); - return client->noClientException; + return Success; } int @@ -1008,7 +1008,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client) swapl (&rep.screen, n); } WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -1039,7 +1039,7 @@ ProcXineramaIsActive(ClientPtr client) swapl (&rep.state, n); } WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -1084,7 +1084,7 @@ ProcXineramaQueryScreens(ClientPtr client) } } - return client->noClientException; + return Success; } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 47362df4d9..a1816958fd 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -572,7 +572,7 @@ int PanoramiXGetGeometry(ClientPtr client) } WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return (client->noClientException); + return Success; } int PanoramiXTranslateCoords(ClientPtr client) @@ -642,7 +642,7 @@ int PanoramiXTranslateCoords(ClientPtr client) } WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); + return Success; } int PanoramiXCreatePixmap(ClientPtr client) @@ -1081,8 +1081,6 @@ int PanoramiXCopyArea(ClientPtr client) } free(data); - - result = Success; } else { DrawablePtr pDst = NULL, pSrc = NULL; GCPtr pGC = NULL; @@ -1150,11 +1148,9 @@ int PanoramiXCopyArea(ClientPtr client) client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); REGION_UNINIT(pScreen, &totalReg); } - - result = client->noClientException; } - return (result); + return Success; } @@ -1264,7 +1260,7 @@ int PanoramiXCopyPlane(ClientPtr client) REGION_UNINIT(pScreen, &totalReg); } - return (client->noClientException); + return Success; } @@ -1324,7 +1320,7 @@ int PanoramiXPolyPoint(ClientPtr client) free(origPts); return (result); } else - return (client->noClientException); + return Success; } @@ -1384,7 +1380,7 @@ int PanoramiXPolyLine(ClientPtr client) free(origPts); return (result); } else - return (client->noClientException); + return Success; } @@ -1447,7 +1443,7 @@ int PanoramiXPolySegment(ClientPtr client) free(origSegs); return (result); } else - return (client->noClientException); + return Success; } @@ -1509,7 +1505,7 @@ int PanoramiXPolyRectangle(ClientPtr client) free(origRecs); return (result); } else - return (client->noClientException); + return Success; } @@ -1569,7 +1565,7 @@ int PanoramiXPolyArc(ClientPtr client) free(origArcs); return (result); } else - return (client->noClientException); + return Success; } @@ -1630,7 +1626,7 @@ int PanoramiXFillPoly(ClientPtr client) free(locPts); return (result); } else - return (client->noClientException); + return Success; } @@ -1691,7 +1687,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client) free(origRects); return (result); } else - return (client->noClientException); + return Success; } @@ -1752,7 +1748,7 @@ int PanoramiXPolyFillArc(ClientPtr client) free(origArcs); return (result); } else - return (client->noClientException); + return Success; } @@ -1947,7 +1943,7 @@ int PanoramiXGetImage(ClientPtr client) } } free(pBuf); - return (client->noClientException); + return Success; } diff --git a/Xext/saver.c b/Xext/saver.c index f89ee18861..4b43a305a3 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -737,7 +737,7 @@ ProcScreenSaverQueryVersion (ClientPtr client) swapl(&rep.length, n); } WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -813,7 +813,7 @@ ProcScreenSaverQueryInfo (ClientPtr client) swapl (&rep.eventMask, n); } WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -1415,7 +1415,7 @@ ProcScreenSaverSuspend (ClientPtr client) FreeScreenSaverTimer(); } - return (client->noClientException); + return Success; } static DISPATCH_PROC((*NormalVector[])) = { diff --git a/Xext/security.c b/Xext/security.c index 2685815796..7995ff2f32 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -383,7 +383,7 @@ ProcSecurityQueryVersion( } (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } /* ProcSecurityQueryVersion */ @@ -604,10 +604,7 @@ ProcSecurityGenerateAuthorization( pAuth->group, eventMask); /* the request succeeded; don't call RemoveAuthorization or free pAuth */ - - removeAuth = FALSE; - pAuth = NULL; - err = client->noClientException; + return Success; bailout: if (removeAuth) diff --git a/Xext/shape.c b/Xext/shape.c index f21d633c9a..cd756583c1 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -269,7 +269,7 @@ ProcShapeQueryVersion (ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } /***************** @@ -736,7 +736,7 @@ ProcShapeQueryExtents (ClientPtr client) swaps(&rep.heightClipShape, n); } WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep); - return (client->noClientException); + return Success; } /*ARGSUSED*/ @@ -996,7 +996,7 @@ ProcShapeInputSelected (ClientPtr client) swapl (&rep.length, n); } WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep); - return (client->noClientException); + return Success; } static int @@ -1081,7 +1081,7 @@ ProcShapeGetRectangles (ClientPtr client) WriteToClient (client, sizeof (rep), (char *) &rep); WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects); free(rects); - return client->noClientException; + return Success; } static int diff --git a/Xext/shm.c b/Xext/shm.c index 39b392943a..25043fadc2 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -359,7 +359,7 @@ ProcShmQueryVersion(ClientPtr client) swaps(&rep.gid, n); } WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } /* @@ -485,7 +485,7 @@ ProcShmAttach(ClientPtr client) } if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) return BadAlloc; - return(client->noClientException); + return Success; } /*ARGSUSED*/ @@ -515,7 +515,7 @@ ProcShmDetach(ClientPtr client) REQUEST_SIZE_MATCH(xShmDetachReq); VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); FreeResource(stuff->shmseg, RT_NONE); - return(client->noClientException); + return Success; } /* @@ -601,7 +601,7 @@ ProcPanoramiXShmPutImage(ClientPtr client) stuff->dstY = orig_y - panoramiXdataPtr[j].y; } result = ProcShmPutImage(client); - if(result != client->noClientException) break; + if(result != Success) break; } return(result); } @@ -733,7 +733,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) } WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - return(client->noClientException); + return Success; } static int @@ -804,7 +804,7 @@ CreatePmap: for(j = 1; j < PanoramiXNumScreens; j++) newPix->info[j].id = FakeClientID(client->index); - result = (client->noClientException); + result = Success; FOR_NSCREENS(j) { ShmScrPrivateRec *screen_priv; @@ -951,7 +951,7 @@ ProcShmPutImage(ClientPtr client) WriteEventsToClient(client, 1, (xEvent *) &ev); } - return (client->noClientException); + return Success; } @@ -1065,7 +1065,7 @@ ProcShmGetImage(ClientPtr client) } WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - return(client->noClientException); + return Success; } static PixmapPtr @@ -1162,7 +1162,7 @@ CreatePmap: pMap->drawable.id = stuff->pid; if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) { - return(client->noClientException); + return Success; } pDraw->pScreen->DestroyPixmap(pMap); } diff --git a/Xext/sync.c b/Xext/sync.c index 94ac5dfb10..0534728a73 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1146,7 +1146,7 @@ ProcSyncInitialize(ClientPtr client) swaps(&rep.sequenceNumber, n); } WriteToClient(client, sizeof(rep), (char *) &rep); - return client->noClientException; + return Success; } /* @@ -1223,7 +1223,7 @@ ProcSyncListSystemCounters(ClientPtr client) free(list); } - return client->noClientException; + return Success; } /* @@ -1297,7 +1297,7 @@ ProcSyncGetPriority(ClientPtr client) WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); - return client->noClientException; + return Success; } /* @@ -1317,7 +1317,7 @@ ProcSyncCreateCounter(ClientPtr client) if (!SyncCreateCounter(client, stuff->cid, initial)) return BadAlloc; - return client->noClientException; + return Success; } /* @@ -1569,7 +1569,7 @@ ProcSyncQueryCounter(ClientPtr client) swapl(&rep.value_lo, n); } WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -1749,7 +1749,7 @@ ProcSyncQueryAlarm(ClientPtr client) } WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); - return client->noClientException; + return Success; } static int @@ -1767,7 +1767,7 @@ ProcSyncDestroyAlarm(ClientPtr client) return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc; FreeResource(stuff->alarm, RT_NONE); - return client->noClientException; + return Success; } /* diff --git a/Xext/xcalibrate.c b/Xext/xcalibrate.c index 6e6461a5f8..364b92ac4e 100644 --- a/Xext/xcalibrate.c +++ b/Xext/xcalibrate.c @@ -90,7 +90,7 @@ ProcXCalibrateQueryVersion (ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof (xXCalibrateQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -160,7 +160,7 @@ ProcXCalibrateSetRawMode (ClientPtr client) swaps (&rep.status, n); } WriteToClient(client, sizeof (rep), (char *) &rep); - return (client->noClientException); + return Success; } static int @@ -200,7 +200,7 @@ ProcXCalibrateScreenToCoord (ClientPtr client) swaps (&rep.y, n); } WriteToClient(client, sizeof (rep), (char *) &rep); - return (client->noClientException); + return Success; } static int diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c index 1c8e3f2c44..986c870a50 100644 --- a/Xext/xcmisc.c +++ b/Xext/xcmisc.c @@ -83,7 +83,7 @@ ProcXCMiscGetVersion(ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -106,7 +106,7 @@ ProcXCMiscGetXIDRange(ClientPtr client) swapl(&rep.count, n); } WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -145,7 +145,7 @@ ProcXCMiscGetXIDList(ClientPtr client) WriteSwappedDataToClient(client, count * sizeof(XID), pids); } free(pids); - return(client->noClientException); + return Success; } static int diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 312fcc9e90..8c4a7eba93 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -368,7 +368,7 @@ ProcXF86BigfontQueryVersion( } WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), (char *)&reply); - return client->noClientException; + return Success; } static void @@ -698,7 +698,7 @@ ProcXF86BigfontQueryFont( if (shmid == -1) free(pIndex2UniqIndex); if (!pDesc) free(pCI); } - return (client->noClientException); + return Success; } } diff --git a/Xext/xres.c b/Xext/xres.c index 14641f70f8..06639a2cfe 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -50,7 +50,7 @@ ProcXResQueryVersion (ClientPtr client) swaps(&rep.server_minor, n); } WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -103,7 +103,7 @@ ProcXResQueryClients (ClientPtr client) free(current_clients); - return (client->noClientException); + return Success; } @@ -184,7 +184,7 @@ ProcXResQueryClientResources (ClientPtr client) free(counts); - return (client->noClientException); + return Success; } static unsigned long @@ -295,7 +295,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client) } WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep); - return (client->noClientException); + return Success; } static int diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c index 4d55e15650..93c1b595f7 100644 --- a/Xext/xselinux_ext.c +++ b/Xext/xselinux_ext.c @@ -78,7 +78,7 @@ ProcSELinuxQueryVersion(ClientPtr client) swaps(&rep.server_minor, n); } WriteToClient(client, sizeof(rep), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -109,7 +109,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid) WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep); WriteToClient(client, len, ctx); freecon(ctx); - return client->noClientException; + return Success; } static int @@ -390,7 +390,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items, WriteToClient(client, size * 4, (char *)buf); /* Free stuff and return */ - rc = client->noClientException; + rc = Success; free(buf); out: SELinuxFreeItems(items, count); diff --git a/Xext/xtest.c b/Xext/xtest.c index bb5bae6bc8..09c4677a23 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -126,7 +126,7 @@ ProcXTestGetVersion(ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -164,7 +164,7 @@ ProcXTestCompareCursor(ClientPtr client) swaps(&rep.sequenceNumber, n); } WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -457,7 +457,7 @@ ProcXTestFakeInput(ClientPtr client) if (need_ptr_update) miPointerUpdateSprite(dev); - return client->noClientException; + return Success; } static int @@ -475,7 +475,7 @@ ProcXTestGrabControl(ClientPtr client) MakeClientGrabImpervious(client); else MakeClientGrabPervious(client); - return(client->noClientException); + return Success; } static int diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index b8d8d17c3f..fd633f1f94 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -460,7 +460,7 @@ ProcXvQueryAdaptors(ClientPtr client) } - return (client->noClientException); + return Success; } static int @@ -520,7 +520,7 @@ ProcXvQueryEncodings(ClientPtr client) pe++; } - return (client->noClientException); + return Success; } static int diff --git a/Xi/exevents.c b/Xi/exevents.c index 3ddee77915..b24204d828 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1851,7 +1851,7 @@ ChangeKeyMapping(ClientPtr client, XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL, serverClient); - return client->noClientException; + return Success; } static void diff --git a/composite/compext.c b/composite/compext.c index 17c4bae1e1..3bb9a37011 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -132,7 +132,7 @@ ProcCompositeQueryVersion (ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } #define VERIFY_WINDOW(pWindow, wid, client, mode) \ @@ -226,7 +226,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } static int @@ -265,7 +265,7 @@ ProcCompositeNameWindowPixmap (ClientPtr client) if (!AddResource (stuff->pixmap, RT_PIXMAP, (pointer) pPixmap)) return BadAlloc; - return(client->noClientException); + return Success; } @@ -325,7 +325,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client) } (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); - return client->noClientException; + return Success; } static int @@ -351,7 +351,7 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client) /* The delete function will free the client structure */ FreeResource (pOc->resource, RT_NONE); - return client->noClientException; + return Success; } static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { diff --git a/damageext/damageext.c b/damageext/damageext.c index f2630feb4f..af4fef6787 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -162,7 +162,7 @@ ProcDamageQueryVersion(ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } static int @@ -231,7 +231,7 @@ ProcDamageCreate (ClientPtr client) DamageRegionAppend(pDrawable, pRegion); } - return (client->noClientException); + return Success; } static int @@ -243,7 +243,7 @@ ProcDamageDestroy (ClientPtr client) REQUEST_SIZE_MATCH(xDamageDestroyReq); VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); FreeResource (stuff->damage, RT_NONE); - return (client->noClientException); + return Success; } static int @@ -276,7 +276,7 @@ ProcDamageSubtract (ClientPtr client) DamageEmpty (pDamage); } } - return (client->noClientException); + return Success; } static int @@ -301,7 +301,7 @@ ProcDamageAdd (ClientPtr client) DamageRegionAppend(pDrawable, pRegion); REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y); - return (client->noClientException); + return Success; } /* Major version controls available requests */ diff --git a/dbe/dbe.c b/dbe/dbe.c index f4d088c8a0..b28b3a0e63 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -147,7 +147,7 @@ ProcDbeGetVersion(ClientPtr client) WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } /* ProcDbeGetVersion() */ @@ -810,7 +810,7 @@ ProcDbeGetVisualInfo(ClientPtr client) free(pDrawables); } - return(client->noClientException); + return Success; } /* ProcDbeGetVisualInfo() */ @@ -866,7 +866,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), (char *)&rep); - return(client->noClientException); + return Success; } /* ProcDbeGetbackBufferAttributes() */ diff --git a/dix/devices.c b/dix/devices.c index db5c4a1364..de72c8834f 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1535,7 +1535,7 @@ ProcSetModifierMapping(ClientPtr client) rep.success = rc; WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep); - return client->noClientException; + return Success; } int @@ -1561,7 +1561,7 @@ ProcGetModifierMapping(ClientPtr client) free(modkeymap); - return client->noClientException; + return Success; } int @@ -1619,7 +1619,7 @@ ProcChangeKeyboardMapping(ClientPtr client) stuff->keyCodes, NULL, client); } - return client->noClientException; + return Success; } int @@ -1722,7 +1722,7 @@ ProcGetKeyboardMapping(ClientPtr client) free(syms->map); free(syms); - return client->noClientException; + return Success; } int diff --git a/dix/dispatch.c b/dix/dispatch.c index aee9143e9a..fe9ddb2a8d 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -437,16 +437,18 @@ Dispatch(void) client->sequence, client->index, result); #endif - if (result != Success) + if (client->noClientException != Success) { - if (client->noClientException != Success) - CloseDownClient(client); - else - SendErrorToClient(client, MAJOROP, - MinorOpcodeOfRequest(client), - client->errorValue, result); + CloseDownClient(client); break; - } + } + else if (result != Success) + { + SendErrorToClient(client, MAJOROP, + MinorOpcodeOfRequest(client), + client->errorValue, result); + break; + } } FlushAllOutput(); client = clients[clientReady[nready]]; @@ -668,10 +670,7 @@ ProcCreateWindow(ClientPtr client) return BadAlloc; pWin->eventMask = mask; } - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return rc; } int @@ -679,7 +678,7 @@ ProcChangeWindowAttributes(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeWindowAttributesReq); - int result, len, rc; + int len, rc; Mask access_mode = 0; REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); @@ -691,14 +690,10 @@ ProcChangeWindowAttributes(ClientPtr client) len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq)); if (len != Ones(stuff->valueMask)) return BadLength; - result = ChangeWindowAttributes(pWin, + return ChangeWindowAttributes(pWin, stuff->valueMask, (XID *) &stuff[1], client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); } int @@ -716,7 +711,7 @@ ProcGetWindowAttributes(ClientPtr client) memset(&wa, 0, sizeof(xGetWindowAttributesReply)); GetWindowAttributes(pWin, client, &wa); WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); - return(client->noClientException); + return Success; } int @@ -737,7 +732,7 @@ ProcDestroyWindow(ClientPtr client) return rc; FreeResource(stuff->id, RT_NONE); } - return(client->noClientException); + return Success; } int @@ -752,7 +747,7 @@ ProcDestroySubwindows(ClientPtr client) if (rc != Success) return rc; DestroySubwindows(pWin, client); - return(client->noClientException); + return Success; } int @@ -760,7 +755,7 @@ ProcChangeSaveSet(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeSaveSetReq); - int result, rc; + int rc; REQUEST_SIZE_MATCH(xChangeSaveSetReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); @@ -769,18 +764,9 @@ ProcChangeSaveSet(ClientPtr client) if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) return BadMatch; if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) - { - result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->mode; - return( BadValue ); - } + return AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); + client->errorValue = stuff->mode; + return BadValue; } int @@ -788,7 +774,7 @@ ProcReparentWindow(ClientPtr client) { WindowPtr pWin, pParent; REQUEST(xReparentWindowReq); - int result, rc; + int rc; REQUEST_SIZE_MATCH(xReparentWindowReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); @@ -797,23 +783,16 @@ ProcReparentWindow(ClientPtr client) rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); if (rc != Success) return rc; - if (SAME_SCREENS(pWin->drawable, pParent->drawable)) - { - if ((pWin->backgroundState == ParentRelative) && - (pParent->drawable.depth != pWin->drawable.depth)) - return BadMatch; - if ((pWin->drawable.class != InputOnly) && - (pParent->drawable.class == InputOnly)) - return BadMatch; - result = ReparentWindow(pWin, pParent, - (short)stuff->x, (short)stuff->y, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - return (BadMatch); + if (!SAME_SCREENS(pWin->drawable, pParent->drawable)) + return BadMatch; + if ((pWin->backgroundState == ParentRelative) && + (pParent->drawable.depth != pWin->drawable.depth)) + return BadMatch; + if ((pWin->drawable.class != InputOnly) && + (pParent->drawable.class == InputOnly)) + return BadMatch; + return ReparentWindow(pWin, pParent, + (short)stuff->x, (short)stuff->y, client); } int @@ -829,7 +808,7 @@ ProcMapWindow(ClientPtr client) return rc; MapWindow(pWin, client); /* update cache to say it is mapped */ - return(client->noClientException); + return Success; } int @@ -845,7 +824,7 @@ ProcMapSubwindows(ClientPtr client) return rc; MapSubwindows(pWin, client); /* update cache to say it is mapped */ - return(client->noClientException); + return Success; } int @@ -861,7 +840,7 @@ ProcUnmapWindow(ClientPtr client) return rc; UnmapWindow(pWin, FALSE); /* update cache to say it is mapped */ - return(client->noClientException); + return Success; } int @@ -876,7 +855,7 @@ ProcUnmapSubwindows(ClientPtr client) if (rc != Success) return rc; UnmapSubwindows(pWin); - return(client->noClientException); + return Success; } int @@ -884,7 +863,6 @@ ProcConfigureWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xConfigureWindowReq); - int result; int len, rc; REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); @@ -895,12 +873,7 @@ ProcConfigureWindow(ClientPtr client) len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq)); if (Ones((Mask)stuff->mask) != len) return BadLength; - result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], client); } int @@ -921,7 +894,7 @@ ProcCirculateWindow(ClientPtr client) if (rc != Success) return rc; CirculateWindow(pWin, (int)stuff->direction, client); - return(client->noClientException); + return Success; } static int @@ -980,7 +953,7 @@ ProcGetGeometry(ClientPtr client) return status; WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return(client->noClientException); + return Success; } @@ -1030,7 +1003,7 @@ ProcQueryTree(ClientPtr client) free(childIDs); } - return(client->noClientException); + return Success; } int @@ -1057,7 +1030,7 @@ ProcInternAtom(ClientPtr client) reply.sequenceNumber = client->sequence; reply.atom = atom; WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return(client->noClientException); + return Success; } else return (BadAlloc); @@ -1082,7 +1055,7 @@ ProcGetAtomName(ClientPtr client) reply.nameLength = len; WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); (void)WriteToClient(client, len, str); - return(client->noClientException); + return Success; } else { @@ -1102,7 +1075,7 @@ ProcGrabServer(ClientPtr client) client->sequence--; BITSET(grabWaiters, client->index); IgnoreClient(client); - return(client->noClientException); + return Success; } rc = OnlyListenToOneClient(client); if (rc != Success) @@ -1118,7 +1091,7 @@ ProcGrabServer(ClientPtr client) CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); } - return(client->noClientException); + return Success; } static void @@ -1153,7 +1126,7 @@ ProcUngrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); UngrabServer(client); - return(client->noClientException); + return Success; } int @@ -1227,7 +1200,7 @@ ProcTranslateCoords(ClientPtr client) rep.dstY = y - pDst->drawable.y; } WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); + return Success; } int @@ -1243,7 +1216,7 @@ ProcOpenFont(ClientPtr client) stuff->nbytes, (char *)&stuff[1]); if (err == Success) { - return(client->noClientException); + return Success; } else return err; @@ -1262,7 +1235,7 @@ ProcCloseFont(ClientPtr client) if (rc == Success) { FreeResource(stuff->id, RT_NONE); - return(client->noClientException); + return Success; } else { @@ -1314,7 +1287,7 @@ ProcQueryFont(ClientPtr client) WriteReplyToClient(client, rlength, reply); free(reply); - return(client->noClientException); + return Success; } } @@ -1355,7 +1328,7 @@ ProcQueryTextExtents(ClientPtr client) reply.overallLeft = info.overallLeft; reply.overallRight = info.overallRight; WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); - return(client->noClientException); + return Success; } int @@ -1456,7 +1429,7 @@ CreatePmap: return rc; } if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - return(client->noClientException); + return Success; (*pDraw->pScreen->DestroyPixmap)(pMap); } return (BadAlloc); @@ -1475,7 +1448,7 @@ ProcFreePixmap(ClientPtr client) if (rc == Success) { FreeResource(stuff->id, RT_NONE); - return(client->noClientException); + return Success; } else { @@ -1510,7 +1483,7 @@ ProcCreateGC(ClientPtr client) return error; if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) return (BadAlloc); - return(client->noClientException); + return Success; } int @@ -1530,11 +1503,7 @@ ProcChangeGC(ClientPtr client) if (len != Ones(stuff->mask)) return BadLength; - result = ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]); } int @@ -1559,11 +1528,7 @@ ProcCopyGC(ClientPtr client) client->errorValue = stuff->mask; return BadValue; } - result = CopyGC(pGC, dstGC, stuff->mask); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return CopyGC(pGC, dstGC, stuff->mask); } int @@ -1584,17 +1549,11 @@ ProcSetDashes(ClientPtr client) if (result != Success) return result; - result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, + /* If there's an error, either there's no sensible errorValue, + * or there was a dash segment of 0. */ + client->errorValue = 0; + return SetDashes(pGC, stuff->dashOffset, stuff->nDashes, (unsigned char *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - /* If there's an error, either there's no sensible errorValue, - * or there was a dash segment of 0. */ - client->errorValue = 0; - return(result); - } } int @@ -1619,12 +1578,8 @@ ProcSetClipRectangles(ClientPtr client) if (nr & 4) return(BadLength); nr >>= 3; - result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, + return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, nr, (xRectangle *)&stuff[1], (int)stuff->ordering); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); } int @@ -1640,7 +1595,7 @@ ProcFreeGC(ClientPtr client) return rc; FreeResource(stuff->id, RT_NONE); - return(client->noClientException); + return Success; } int @@ -1667,7 +1622,7 @@ ProcClearToBackground(ClientPtr client) (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, stuff->width, stuff->height, (Bool)stuff->exposures); - return(client->noClientException); + return Success; } int @@ -1709,7 +1664,7 @@ ProcCopyArea(ClientPtr client) REGION_DESTROY(pDst->pScreen, pRgn); } - return(client->noClientException); + return Success; } int @@ -1758,7 +1713,7 @@ ProcCopyPlane(ClientPtr client) if (pRgn) REGION_DESTROY(pdstDraw->pScreen, pRgn); } - return(client->noClientException); + return Success; } int @@ -1781,7 +1736,7 @@ ProcPolyPoint(ClientPtr client) if (npoint) (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, (xPoint *) &stuff[1]); - return (client->noClientException); + return Success; } int @@ -1804,7 +1759,7 @@ ProcPolyLine(ClientPtr client) if (npoint > 1) (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, (DDXPointPtr) &stuff[1]); - return(client->noClientException); + return Success; } int @@ -1823,7 +1778,7 @@ ProcPolySegment(ClientPtr client) nsegs >>= 3; if (nsegs) (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); - return (client->noClientException); + return Success; } int @@ -1843,7 +1798,7 @@ ProcPolyRectangle (ClientPtr client) if (nrects) (*pGC->ops->PolyRectangle)(pDraw, pGC, nrects, (xRectangle *) &stuff[1]); - return(client->noClientException); + return Success; } int @@ -1862,7 +1817,7 @@ ProcPolyArc(ClientPtr client) narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); + return Success; } int @@ -1893,7 +1848,7 @@ ProcFillPoly(ClientPtr client) (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, stuff->coordMode, things, (DDXPointPtr) &stuff[1]); - return(client->noClientException); + return Success; } int @@ -1914,7 +1869,7 @@ ProcPolyFillRectangle(ClientPtr client) if (things) (*pGC->ops->PolyFillRect) (pDraw, pGC, things, (xRectangle *) &stuff[1]); - return (client->noClientException); + return Success; } int @@ -1933,7 +1888,7 @@ ProcPolyFillArc(ClientPtr client) narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); + return Success; } #ifdef MATCH_CLIENT_ENDIAN @@ -2044,7 +1999,7 @@ ProcPutImage(ClientPtr client) stuff->width, stuff->height, stuff->leftPad, stuff->format, tmpImage); - return (client->noClientException); + return Success; } static int @@ -2288,7 +2243,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, REGION_DESTROY(pDraw->pScreen, pVisibleRegion); if (!im_return) free(pBuf); - return (client->noClientException); + return Success; } int @@ -2327,7 +2282,7 @@ ProcPolyText(ClientPtr client) if (err == Success) { - return(client->noClientException); + return Success; } else return err; @@ -2357,7 +2312,7 @@ ProcImageText8(ClientPtr client) if (err == Success) { - return(client->noClientException); + return Success; } else return err; @@ -2387,7 +2342,7 @@ ProcImageText16(ClientPtr client) if (err == Success) { - return(client->noClientException); + return Success; } else return err; @@ -2425,12 +2380,8 @@ ProcCreateColormap(ClientPtr client) { if (pVisual->vid != stuff->visual) continue; - result = CreateColormap(mid, pScreen, pVisual, &pmap, + return CreateColormap(mid, pScreen, pVisual, &pmap, (int)stuff->alloc, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); } client->errorValue = stuff->visual; return(BadMatch); @@ -2451,7 +2402,7 @@ ProcFreeColormap(ClientPtr client) /* Freeing a default colormap is a no-op */ if (!(pmap->flags & IsDefault)) FreeResource(stuff->id, RT_NONE); - return (client->noClientException); + return Success; } else { @@ -2475,18 +2426,9 @@ ProcCopyColormapAndFree(ClientPtr client) rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, client, DixReadAccess|DixRemoveAccess); if (rc == Success) - { - rc = CopyColormapAndFree(mid, pSrcMap, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; - } - else - { - client->errorValue = stuff->srcCmap; - return (rc == BadValue) ? BadColor : rc; - } + return CopyColormapAndFree(mid, pSrcMap, client->index); + client->errorValue = stuff->srcCmap; + return (rc == BadValue) ? BadColor : rc; } int @@ -2507,8 +2449,8 @@ ProcInstallColormap(ClientPtr client) goto out; (*(pcmp->pScreen->InstallColormap)) (pcmp); + return Success; - rc = client->noClientException; out: client->errorValue = stuff->id; return (rc == BadValue) ? BadColor : rc; @@ -2533,8 +2475,8 @@ ProcUninstallColormap(ClientPtr client) if(pcmp->mid != pcmp->pScreen->defColormap) (*(pcmp->pScreen->UninstallColormap)) (pcmp); + return Success; - rc = client->noClientException; out: client->errorValue = stuff->id; return (rc == BadValue) ? BadColor : rc; @@ -2551,12 +2493,12 @@ ProcListInstalledColormaps(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); if (rc != Success) - goto out; + return rc; rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, DixGetAttrAccess); if (rc != Success) - goto out; + return rc; preply = malloc(sizeof(xListInstalledColormapsReply) + pWin->drawable.pScreen->maxInstalledCmaps * @@ -2574,9 +2516,7 @@ ProcListInstalledColormaps(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); free(preply); - rc = client->noClientException; -out: - return rc; + return Success; } int @@ -2601,17 +2541,12 @@ ProcAllocColor (ClientPtr client) acr.pixel = 0; if( (rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, &acr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; - } + return rc; #ifdef PANORAMIX if (noPanoramiXExtension || !pmap->pScreen->myNum) #endif WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); - return (client->noClientException); + return Success; } else @@ -2649,17 +2584,12 @@ ProcAllocNamedColor (ClientPtr client) if( (rc = AllocColor(pcmp, &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, &ancr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; - } + return rc; #ifdef PANORAMIX if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); - return (client->noClientException); + return Success; } else return(BadName); @@ -2711,10 +2641,7 @@ ProcAllocColorCells (ClientPtr client) (Bool)stuff->contiguous, ppixels, pmasks)) ) { free(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return rc; } #ifdef PANORAMIX if (noPanoramiXExtension || !pcmp->pScreen->myNum) @@ -2730,7 +2657,7 @@ ProcAllocColorCells (ClientPtr client) WriteSwappedDataToClient(client, length, ppixels); } free(ppixels); - return (client->noClientException); + return Success; } else { @@ -2780,10 +2707,7 @@ ProcAllocColorPlanes(ClientPtr client) &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) { free(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return rc; } acpr.length = bytes_to_int32(length); #ifdef PANORAMIX @@ -2795,7 +2719,7 @@ ProcAllocColorPlanes(ClientPtr client) WriteSwappedDataToClient(client, length, ppixels); } free(ppixels); - return (client->noClientException); + return Success; } else { @@ -2821,13 +2745,8 @@ ProcFreeColors(ClientPtr client) if(pcmp->flags & AllAllocated) return(BadAccess); count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); - rc = FreeColors(pcmp, client->index, count, + return FreeColors(pcmp, client->index, count, (Pixel *)&stuff[1], (Pixel)stuff->planeMask); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; - } else { @@ -2854,11 +2773,7 @@ ProcStoreColors (ClientPtr client) if (count % sizeof(xColorItem)) return(BadLength); count /= sizeof(xColorItem); - rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1], client); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return StoreColors(pcmp, count, (xColorItem *)&stuff[1], client); } else { @@ -2886,11 +2801,7 @@ ProcStoreNamedColor (ClientPtr client) { def.flags = stuff->flags; def.pixel = stuff->pixel; - rc = StoreColors(pcmp, 1, &def, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return StoreColors(pcmp, 1, &def, client); } return (BadName); } @@ -2924,10 +2835,7 @@ ProcQueryColors(ClientPtr client) if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) ) { if (prgbs) free(prgbs); - if (client->noClientException != Success) - return(client->noClientException); - else - return rc; + return rc; } memset(&qcr, 0, sizeof(xQueryColorsReply)); qcr.type = X_Reply; @@ -2941,7 +2849,7 @@ ProcQueryColors(ClientPtr client) WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); } if (prgbs) free(prgbs); - return(client->noClientException); + return Success; } else @@ -2979,7 +2887,7 @@ ProcLookupColor(ClientPtr client) &lcr.screenBlue, pcmp->pVisual); WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); - return(client->noClientException); + return Success; } return (BadName); } @@ -3078,7 +2986,7 @@ ProcCreateCursor (ClientPtr client) if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) return BadAlloc; - return client->noClientException; + return Success; } int @@ -3100,7 +3008,7 @@ ProcCreateGlyphCursor (ClientPtr client) if (res != Success) return res; if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; + return Success; return BadAlloc; } @@ -3118,7 +3026,7 @@ ProcFreeCursor (ClientPtr client) if (rc == Success) { FreeResource(stuff->id, RT_NONE); - return (client->noClientException); + return Success; } else { @@ -3164,7 +3072,7 @@ ProcQueryBestSize (ClientPtr client) reply.width = stuff->width; reply.height = stuff->height; WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); - return (client->noClientException); + return Success; } @@ -3228,7 +3136,7 @@ ProcSetScreenSaver (ClientPtr client) ScreenSaverInterval = defaultScreenSaverInterval; SetScreenSaverTimer(); - return (client->noClientException); + return Success; } int @@ -3253,31 +3161,24 @@ ProcGetScreenSaver(ClientPtr client) rep.preferBlanking = ScreenSaverBlanking; rep.allowExposures = ScreenSaverAllowExposures; WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); - return (client->noClientException); + return Success; } int ProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); - int result; REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); if(stuff->mode == HostInsert) - result = AddHost(client, (int)stuff->hostFamily, + return AddHost(client, (int)stuff->hostFamily, stuff->hostLength, (pointer)&stuff[1]); - else if (stuff->mode == HostDelete) - result = RemoveHost(client, (int)stuff->hostFamily, + if (stuff->mode == HostDelete) + return RemoveHost(client, (int)stuff->hostFamily, stuff->hostLength, (pointer)&stuff[1]); - else - { - client->errorValue = stuff->mode; - return BadValue; - } - if (!result) - result = client->noClientException; - return (result); + client->errorValue = stuff->mode; + return BadValue; } int @@ -3309,13 +3210,12 @@ ProcListHosts(ClientPtr client) WriteSwappedDataToClient(client, len, pdata); } free(pdata); - return (client->noClientException); + return Success; } int ProcChangeAccessControl(ClientPtr client) { - int result; REQUEST(xSetAccessControlReq); REQUEST_SIZE_MATCH(xSetAccessControlReq); @@ -3324,10 +3224,7 @@ ProcChangeAccessControl(ClientPtr client) client->errorValue = stuff->mode; return BadValue; } - result = ChangeAccessControl(client, stuff->mode == EnableAccess); - if (!result) - result = client->noClientException; - return (result); + return ChangeAccessControl(client, stuff->mode == EnableAccess); } /********************* @@ -3363,7 +3260,7 @@ ProcKillClient(ClientPtr client) if (stuff->id == AllTemporary) { CloseDownRetainedResources(); - return (client->noClientException); + return Success; } rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); @@ -3378,7 +3275,7 @@ ProcKillClient(ClientPtr client) isItTimeToYield = TRUE; return (Success); } - return (client->noClientException); + return Success; } else return rc; @@ -3390,7 +3287,7 @@ ProcSetFontPath(ClientPtr client) unsigned char *ptr; unsigned long nbytes, total; long nfonts; - int n, result; + int n; REQUEST(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); @@ -3408,10 +3305,7 @@ ProcSetFontPath(ClientPtr client) } if (total >= 4) return(BadLength); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]); - if (!result) - result = client->noClientException; - return (result); + return SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]); } int @@ -3435,7 +3329,7 @@ ProcGetFontPath(ClientPtr client) WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); if (stringLens || numpaths) (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); - return(client->noClientException); + return Success; } int @@ -3454,7 +3348,7 @@ ProcChangeCloseDownMode(ClientPtr client) (stuff->mode == RetainTemporary)) { client->closeDownMode = stuff->mode; - return (client->noClientException); + return Success; } else { @@ -3479,7 +3373,7 @@ int ProcForceScreenSaver(ClientPtr client) rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int)stuff->mode); if (rc != Success) return rc; - return client->noClientException; + return Success; } int ProcNoOperation(ClientPtr client) @@ -3487,7 +3381,7 @@ int ProcNoOperation(ClientPtr client) REQUEST_AT_LEAST_SIZE(xReq); /* noop -- don't do anything */ - return(client->noClientException); + return Success; } void @@ -3705,7 +3599,7 @@ ProcInitialConnection(ClientPtr client) swaps(&stuff->length, whichbyte); } ResetCurrentRequest(client); - return (client->noClientException); + return Success; } static int @@ -3802,7 +3696,7 @@ SendConnSetup(ClientPtr client, char *reason) clientinfo.setup = (xConnSetup *)lConnectionInfo; CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); } - return (client->noClientException); + return Success; } int @@ -3836,7 +3730,7 @@ ProcEstablishConnection(ClientPtr client) client->clientState = ClientStateCheckedSecurity; else if (client->clientState != ClientStateAuthenticating) return(SendConnSetup(client, reason)); - return(client->noClientException); + return Success; } void diff --git a/dix/extension.c b/dix/extension.c index 6940b68b0e..d3d4db0425 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -293,7 +293,7 @@ ProcQueryExtension(ClientPtr client) } } WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); - return(client->noClientException); + return Success; } int @@ -354,5 +354,5 @@ ProcListExtensions(ClientPtr client) WriteToClient(client, total_length, buffer); free(buffer); } - return(client->noClientException); + return Success; } diff --git a/dix/property.c b/dix/property.c index 74d3d78264..03b70efc61 100644 --- a/dix/property.c +++ b/dix/property.c @@ -244,7 +244,7 @@ ProcChangeProperty(ClientPtr client) if (err != Success) return err; else - return client->noClientException; + return Success; } int @@ -442,7 +442,7 @@ NullPropertyReply( reply->propertyType = propertyType; reply->format = format; WriteReplyToClient(client, sizeof(xGenericReply), reply); - return(client->noClientException); + return Success; } /***************** @@ -574,7 +574,7 @@ ProcGetProperty(ClientPtr client) free(pProp->data); free(pProp); } - return(client->noClientException); + return Success; } int @@ -620,7 +620,7 @@ ProcListProperties(ClientPtr client) WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); } free(pAtoms); - return(client->noClientException); + return Success; } int @@ -641,9 +641,5 @@ ProcDeleteProperty(ClientPtr client) return (BadAtom); } - result = DeleteProperty(client, pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return DeleteProperty(client, pWin, stuff->property); } diff --git a/dix/selection.c b/dix/selection.c index 6a13572fb0..4f592d123a 100644 --- a/dix/selection.c +++ b/dix/selection.c @@ -225,7 +225,7 @@ ProcSetSelectionOwner(ClientPtr client) pSel->client = (pWin ? client : NullClient); CallSelectionCallback(pSel, client, SelectionSetOwner); - return client->noClientException; + return Success; } int @@ -257,7 +257,7 @@ ProcGetSelectionOwner(ClientPtr client) return rc; WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); - return client->noClientException; + return Success; } int @@ -298,7 +298,7 @@ ProcConvertSelection(ClientPtr client) event.u.selectionRequest.property = stuff->property; if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask, NoEventMask /* CantBeFiltered */, NullGrab)) - return client->noClientException; + return Success; } event.u.u.type = SelectionNotify; @@ -309,5 +309,5 @@ ProcConvertSelection(ClientPtr client) event.u.selectionNotify.property = None; TryClientEvents(client, NULL, &event, 1, NoEventMask, NoEventMask /* CantBeFiltered */, NullGrab); - return client->noClientException; + return Success; } diff --git a/glx/glxext.c b/glx/glxext.c index 593e05309b..b234afcd0d 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -583,7 +583,7 @@ static int __glXDispatch(ClientPtr client) ResetCurrentRequest(client); client->sequence--; IgnoreClient(client); - return(client->noClientException); + return Success; } /* diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index 95e7adca92..5718b6a598 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -235,7 +235,7 @@ static int ProcDMXQueryVersion(ClientPtr client) swapl(&rep.patchVersion, n); } WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXSync(ClientPtr client) @@ -257,7 +257,7 @@ static int ProcDMXSync(ClientPtr client) swapl(&rep.status, n); } WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXForceWindowCreation(ClientPtr client) @@ -326,7 +326,7 @@ static int ProcDMXGetScreenCount(ClientPtr client) swapl(&rep.screenCount, n); } WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXGetScreenAttributes(ClientPtr client) @@ -384,7 +384,7 @@ static int ProcDMXGetScreenAttributes(ClientPtr client) } WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep); if (length) WriteToClient(client, length, (char *)attr.displayName); - return client->noClientException; + return Success; } static int ProcDMXChangeScreensAttributes(ClientPtr client) @@ -457,7 +457,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXAddScreen(ClientPtr client) @@ -508,7 +508,7 @@ static int ProcDMXAddScreen(ClientPtr client) WriteToClient(client, sizeof(xDMXAddScreenReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXRemoveScreen(ClientPtr client) @@ -534,7 +534,7 @@ static int ProcDMXRemoveScreen(ClientPtr client) WriteToClient(client, sizeof(xDMXRemoveScreenReply), (char *)&rep); - return client->noClientException; + return Success; } @@ -678,7 +678,7 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) free(windows); free(screens); - return client->noClientException; + return Success; } static int ProcDMXGetDesktopAttributes(ClientPtr client) @@ -709,7 +709,7 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client) swapl(&rep.shiftY, n); } WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXChangeDesktopAttributes(ClientPtr client) @@ -752,7 +752,7 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client) WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXGetInputCount(ClientPtr client) @@ -772,7 +772,7 @@ static int ProcDMXGetInputCount(ClientPtr client) swapl(&rep.inputCount, n); } WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXGetInputAttributes(ClientPtr client) @@ -810,7 +810,7 @@ static int ProcDMXGetInputAttributes(ClientPtr client) } WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep); if (length) WriteToClient(client, length, (char *)attr.name); - return client->noClientException; + return Success; } static int ProcDMXAddInput(ClientPtr client) @@ -861,7 +861,7 @@ static int ProcDMXAddInput(ClientPtr client) swapl(&rep.physicalId, n); } WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXRemoveInput(ClientPtr client) @@ -887,7 +887,7 @@ static int ProcDMXRemoveInput(ClientPtr client) swapl(&rep.status, n); } WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep); - return client->noClientException; + return Success; } static int ProcDMXDispatch(ClientPtr client) diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c index b6b2e3111d..7a418c813e 100644 --- a/hw/dmx/dmxfont.c +++ b/hw/dmx/dmxfont.c @@ -208,8 +208,6 @@ static int dmxProcSetFontPath(ClientPtr client) /* Restore old fontpath in the DMX server */ SetFontPath(client, nOldPaths, oldFontPath); client->errorValue = error; - } else { - result = client->noClientException; } } diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 07733381ff..55cc0f128a 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -636,7 +636,7 @@ ProcXF86DRIQueryVersion (register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -674,7 +674,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -717,7 +717,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client) if (rep.busIdStringLength) WriteToClient(client, rep.busIdStringLength, busIdString); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -744,7 +744,7 @@ ProcXF86DRIAuthConnection (register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -763,7 +763,7 @@ ProcXF86DRICloseConnection (register ClientPtr client) */ EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -802,7 +802,7 @@ ProcXF86DRIGetClientDriverName (register ClientPtr client) rep.clientDriverNameLength, clientDriverName); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -848,7 +848,7 @@ ProcXF86DRICreateContext (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -868,7 +868,7 @@ ProcXF86DRIDestroyContext (register ClientPtr client) } EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static Bool @@ -1079,7 +1079,7 @@ ProcXF86DRICreateDrawable (ClientPtr client) WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1123,7 +1123,7 @@ ProcXF86DRIDestroyDrawable (register ClientPtr client) pair->remote=0; EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1257,7 +1257,7 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1308,7 +1308,7 @@ ProcXF86DRIGetDeviceInfo (register ClientPtr client) WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); } EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index 711a9cb75d..6587af9473 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -129,7 +129,7 @@ ProcXDGAQueryVersion(ClientPtr client) rep.minorVersion = SERVER_XDGA_MINOR_VERSION; WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -166,7 +166,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client) if(rep.length) WriteToClient(client, nameSize, deviceName); - return (client->noClientException); + return Success; } @@ -185,7 +185,7 @@ ProcXDGACloseFramebuffer(ClientPtr client) DGACloseFramebuffer(stuff->screen); - return (client->noClientException); + return Success; } static int @@ -210,12 +210,12 @@ ProcXDGAQueryModes(ClientPtr client) rep.number = 0; rep.length = 0; WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); - return (client->noClientException); + return Success; } if(!(num = DGAGetModes(stuff->screen))) { WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); - return (client->noClientException); + return Success; } if(!(mode = (XDGAModePtr)malloc(num * sizeof(XDGAModeRec)))) @@ -269,7 +269,7 @@ ProcXDGAQueryModes(ClientPtr client) free(mode); - return (client->noClientException); + return Success; } @@ -342,7 +342,7 @@ ProcXDGASetMode(ClientPtr client) DGASelectInput(stuff->screen, NULL, 0); DGASetMode(stuff->screen, 0, &mode, &pPix); WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); - return (client->noClientException); + return Success; } if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) @@ -397,7 +397,7 @@ ProcXDGASetMode(ClientPtr client) WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); WriteToClient(client, size, mode.name); - return (client->noClientException); + return Success; } static int @@ -415,7 +415,7 @@ ProcXDGASetViewport(ClientPtr client) DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); - return (client->noClientException); + return Success; } static int @@ -435,14 +435,10 @@ ProcXDGAInstallColormap(ClientPtr client) rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP, client, DixInstallAccess); - if (rc == Success) { - DGAInstallCmap(cmap); - return (client->noClientException); - } else { + if (rc != Success) return (rc == BadValue) ? BadColor : rc; - } - - return (client->noClientException); + DGAInstallCmap(cmap); + return Success; } @@ -462,7 +458,7 @@ ProcXDGASelectInput(ClientPtr client) if(DGA_GETCLIENT(stuff->screen) == client) DGASelectInput(stuff->screen, client, stuff->mask); - return (client->noClientException); + return Success; } @@ -483,7 +479,7 @@ ProcXDGAFillRectangle(ClientPtr client) stuff->width, stuff->height, stuff->color)) return BadMatch; - return (client->noClientException); + return Success; } static int @@ -503,7 +499,7 @@ ProcXDGACopyArea(ClientPtr client) stuff->width, stuff->height, stuff->dstx, stuff->dsty)) return BadMatch; - return (client->noClientException); + return Success; } @@ -524,7 +520,7 @@ ProcXDGACopyTransparentArea(ClientPtr client) stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key)) return BadMatch; - return (client->noClientException); + return Success; } @@ -548,7 +544,7 @@ ProcXDGAGetViewportStatus(ClientPtr client) rep.status = DGAGetViewportStatus(stuff->screen); WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -571,7 +567,7 @@ ProcXDGASync(ClientPtr client) DGASync(stuff->screen); WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -592,7 +588,7 @@ ProcXDGASetClientVersion(ClientPtr client) pPriv->major = stuff->major; pPriv->minor = stuff->minor; - return (client->noClientException); + return Success; } static int @@ -623,7 +619,7 @@ ProcXDGAChangePixmapMode(ClientPtr client) rep.y = y; WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -649,7 +645,7 @@ ProcXDGACreateColormap(ClientPtr client) if(result != Success) return result; - return (client->noClientException); + return Success; } /* @@ -707,7 +703,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client) rep.ram_size = rep.bank_size >> 10; WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -762,7 +758,7 @@ ProcXF86DGADirectVideo(ClientPtr client) DGA_SETCLIENT(stuff->screen, NULL); } - return (client->noClientException); + return Success; } static int @@ -793,7 +789,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client) rep.height = mode.viewportHeight; WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -819,7 +815,7 @@ ProcXF86DGASetViewPort(ClientPtr client) != Success) return DGAErrorBase + XF86DGADirectNotActivated; - return (client->noClientException); + return Success; } static int @@ -838,7 +834,7 @@ ProcXF86DGAGetVidPage(ClientPtr client) rep.vpage = 0; /* silently fail */ WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -854,7 +850,7 @@ ProcXF86DGASetVidPage(ClientPtr client) /* silently fail */ - return (client->noClientException); + return Success; } @@ -880,7 +876,7 @@ ProcXF86DGAInstallColormap(ClientPtr client) client, DixInstallAccess); if (rc == Success) { DGAInstallCmap(pcmp); - return (client->noClientException); + return Success; } else { return (rc == BadValue) ? BadColor : rc; } @@ -905,7 +901,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client) rep.flags = XF86DGADirectPresent; WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -931,7 +927,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client) rep.result = 1; WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep); - return (client->noClientException); + return Success; } #endif /* DGA_PROTOCOL_OLD_SUPPORT */ diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 5bdd88c0ad..665f743965 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -394,7 +394,7 @@ ProcXF86VidModeQueryVersion(ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -495,7 +495,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply), (char *)&rep); } - return (client->noClientException); + return Success; } static int @@ -590,7 +590,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); - return (client->noClientException); + return Success; } #define MODEMATCH(mode,stuff) \ @@ -761,7 +761,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("AddModeLine - Succeeded\n"); - return client->noClientException; + return Success; } static int @@ -874,7 +874,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) VidModeDeleteModeline(stuff->screen, mode); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("DeleteModeLine - Succeeded\n"); - return(client->noClientException); + return Success; } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); @@ -1002,7 +1002,7 @@ ProcXF86VidModeModModeLine(ClientPtr client) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ModModeLine - Succeeded\n"); - return(client->noClientException); + return Success; } static int @@ -1120,7 +1120,7 @@ status_reply: WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status); - return(client->noClientException); + return Success; } static int @@ -1137,7 +1137,7 @@ ProcXF86VidModeSwitchMode(ClientPtr client) VidModeZoomViewport(stuff->screen, (short)stuff->zoom); - return (client->noClientException); + return Success; } static int @@ -1201,7 +1201,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) - return (client->noClientException); + return Success; if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; @@ -1230,7 +1230,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("SwitchToMode - Succeeded\n"); - return(client->noClientException); + return Success; } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); @@ -1252,7 +1252,7 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client) if (!VidModeLockZoom(stuff->screen, (short)stuff->lock)) return VidModeErrorBase + XF86VidModeZoomLocked; - return (client->noClientException); + return Success; } static int @@ -1339,7 +1339,7 @@ ProcXF86VidModeGetMonitor(ClientPtr client) free(hsyncdata); free(vsyncdata); - return (client->noClientException); + return Success; } static int @@ -1371,7 +1371,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client) swapl(&rep.y, n); } WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -1389,7 +1389,7 @@ ProcXF86VidModeSetViewPort(ClientPtr client) if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y)) return BadValue; - return (client->noClientException); + return Success; } static int @@ -1453,7 +1453,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) } free(Clocks); - return (client->noClientException); + return Success; } static int @@ -1472,7 +1472,7 @@ ProcXF86VidModeSetGamma(ClientPtr client) ((float)stuff->green)/10000., ((float)stuff->blue)/10000.)) return BadValue; - return (client->noClientException); + return Success; } static int @@ -1506,7 +1506,7 @@ ProcXF86VidModeGetGamma(ClientPtr client) swapl(&rep.blue, n); } WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -1533,7 +1533,7 @@ ProcXF86VidModeSetGammaRamp(ClientPtr client) if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b)) return BadValue; - return (client->noClientException); + return Success; } static int @@ -1584,7 +1584,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) free(ramp); } - return (client->noClientException); + return Success; } @@ -1611,7 +1611,7 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client) } WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep); - return (client->noClientException); + return Success; } static int @@ -1641,7 +1641,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client) } WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep); - return (client->noClientException); + return Success; } @@ -1665,7 +1665,7 @@ ProcXF86VidModeSetClientVersion(ClientPtr client) pPriv->major = stuff->major; pPriv->minor = stuff->minor; - return (client->noClientException); + return Success; } static int diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 4e5a15fca5..f32565d3cb 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -146,7 +146,7 @@ ProcXF86DRIQueryVersion( swapl(&rep.patchVersion, n); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -185,7 +185,7 @@ ProcXF86DRIQueryDirectRenderingCapable( WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -228,7 +228,7 @@ ProcXF86DRIOpenConnection( WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); if (rep.busIdStringLength) WriteToClient(client, rep.busIdStringLength, busIdString); - return (client->noClientException); + return Success; } static int @@ -255,7 +255,7 @@ ProcXF86DRIAuthConnection( rep.authenticated = 0; } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -272,7 +272,7 @@ ProcXF86DRICloseConnection( DRICloseConnection( screenInfo.screens[stuff->screen]); - return (client->noClientException); + return Success; } static int @@ -311,7 +311,7 @@ ProcXF86DRIGetClientDriverName( WriteToClient(client, rep.clientDriverNameLength, clientDriverName); - return (client->noClientException); + return Success; } static int @@ -343,7 +343,7 @@ ProcXF86DRICreateContext( } WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -363,7 +363,7 @@ ProcXF86DRIDestroyContext( return BadValue; } - return (client->noClientException); + return Success; } static int @@ -397,7 +397,7 @@ ProcXF86DRICreateDrawable( } WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -425,7 +425,7 @@ ProcXF86DRIDestroyDrawable( return BadValue; } - return (client->noClientException); + return Success; } static int @@ -533,7 +533,7 @@ ProcXF86DRIGetDrawableInfo( (char *)pBackClipRects); } - return (client->noClientException); + return Success; } static int @@ -584,7 +584,7 @@ ProcXF86DRIGetDeviceInfo( if (rep.length) { WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); } - return (client->noClientException); + return Success; } static int diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 94193266bd..602eb6653d 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -91,7 +91,7 @@ ProcDRI2QueryVersion(ClientPtr client) WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep); - return client->noClientException; + return Success; } static int @@ -129,7 +129,7 @@ ProcDRI2Connect(ClientPtr client) WriteToClient(client, rep.driverNameLength, driverName); WriteToClient(client, rep.deviceNameLength, deviceName); - return client->noClientException; + return Success; } static int @@ -151,7 +151,7 @@ ProcDRI2Authenticate(ClientPtr client) rep.authenticated = DRI2Authenticate(pDraw->pScreen, stuff->magic); WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep); - return client->noClientException; + return Success; } static void @@ -188,7 +188,7 @@ ProcDRI2CreateDrawable(ClientPtr client) if (status != Success) return status; - return client->noClientException; + return Success; } static int @@ -203,7 +203,7 @@ ProcDRI2DestroyDrawable(ClientPtr client) &pDrawable, &status)) return status; - return client->noClientException; + return Success; } @@ -269,7 +269,7 @@ ProcDRI2GetBuffers(ClientPtr client) return status; if (DRI2ThrottleClient(client, pDrawable)) - return client->noClientException; + return Success; attachments = (unsigned int *) &stuff[1]; buffers = DRI2GetBuffers(pDrawable, &width, &height, @@ -278,7 +278,7 @@ ProcDRI2GetBuffers(ClientPtr client) send_buffers_reply(client, pDrawable, buffers, count, width, height); - return client->noClientException; + return Success; } static int @@ -296,7 +296,7 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client) return status; if (DRI2ThrottleClient(client, pDrawable)) - return client->noClientException; + return Success; attachments = (unsigned int *) &stuff[1]; buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height, @@ -304,7 +304,7 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client) send_buffers_reply(client, pDrawable, buffers, count, width, height); - return client->noClientException; + return Success; } static int @@ -341,7 +341,7 @@ ProcDRI2CopyRegion(ClientPtr client) WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep); - return client->noClientException; + return Success; } static void @@ -398,7 +398,7 @@ ProcDRI2SwapBuffers(ClientPtr client) * also orders swaps. */ if (DRI2ThrottleClient(client, pDrawable)) - return client->noClientException; + return Success; target_msc = vals_to_card64(stuff->target_msc_lo, stuff->target_msc_hi); divisor = vals_to_card64(stuff->divisor_lo, stuff->divisor_hi); @@ -416,7 +416,7 @@ ProcDRI2SwapBuffers(ClientPtr client) WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep); - return client->noClientException; + return Success; } static void @@ -456,7 +456,7 @@ ProcDRI2GetMSC(ClientPtr client) WriteToClient(client, sizeof(xDRI2MSCReply), &rep); - return client->noClientException; + return Success; } static int @@ -483,7 +483,7 @@ ProcDRI2WaitMSC(ClientPtr client) if (status != Success) return status; - return client->noClientException; + return Success; } int @@ -498,7 +498,7 @@ ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc) WriteToClient(client, sizeof(xDRI2MSCReply), &rep); - return client->noClientException; + return Success; } static int @@ -518,7 +518,7 @@ ProcDRI2SwapInterval(ClientPtr client) DRI2SwapInterval(pDrawable, stuff->interval); - return client->noClientException; + return Success; } static int @@ -548,7 +548,7 @@ ProcDRI2WaitSBC(ClientPtr client) WriteToClient(client, sizeof(xDRI2MSCReply), &rep); - return client->noClientException; + return Success; } static int @@ -613,7 +613,7 @@ SProcDRI2Connect(ClientPtr client) rep.driverNameLength = 0; rep.deviceNameLength = 0; - return client->noClientException; + return Success; } static int diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 8750f5d007..53d167e5bb 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -192,7 +192,7 @@ ProcAppleWMQueryVersion( swapl(&rep.length, n); } WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -383,7 +383,7 @@ ProcAppleWMDisableUpdate( appleWMProcs->DisableUpdate(); - return (client->noClientException); + return Success; } static int @@ -395,7 +395,7 @@ ProcAppleWMReenableUpdate( appleWMProcs->EnableUpdate(); - return (client->noClientException); + return Success; } @@ -435,7 +435,7 @@ ProcAppleWMSetWindowMenu( free(items); free(shortcuts); - return (client->noClientException); + return Success; } static int @@ -447,7 +447,7 @@ ProcAppleWMSetWindowMenuCheck( REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq); X11ApplicationSetWindowMenuCheck(stuff->index); - return (client->noClientException); + return Success; } static int @@ -458,7 +458,7 @@ ProcAppleWMSetFrontProcess( REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq); X11ApplicationSetFrontProcess(); - return (client->noClientException); + return Success; } static int @@ -483,7 +483,7 @@ ProcAppleWMSetWindowLevel(register ClientPtr client) return err; } - return (client->noClientException); + return Success; } static int @@ -502,7 +502,7 @@ ProcAppleWMSendPSN(register ClientPtr client) return err; } - return (client->noClientException); + return Success; } static int @@ -532,7 +532,7 @@ ProcAppleWMAttachTransient(register ClientPtr client) return err; } - return (client->noClientException); + return Success; } static int @@ -545,7 +545,7 @@ ProcAppleWMSetCanQuit( REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq); X11ApplicationSetCanQuit(stuff->state); - return (client->noClientException); + return Success; } @@ -581,7 +581,7 @@ ProcAppleWMFrameGetRect( rep.h = rr.y2 - rr.y1; WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -611,7 +611,7 @@ ProcAppleWMFrameHitTest( rep.ret = ret; WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -649,7 +649,7 @@ ProcAppleWMFrameDraw( return errno; } - return (client->noClientException); + return Success; } diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index c3154b948f..5868ab1297 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -202,7 +202,7 @@ static int ProcPseudoramiXGetState(ClientPtr client) swaps (&rep.state, n); } WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -231,7 +231,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) swaps (&rep.ScreenCount, n); } WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); - return client->noClientException; + return Success; } @@ -265,7 +265,7 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client) swaps (&rep.height, n); } WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); - return client->noClientException; + return Success; } @@ -290,7 +290,7 @@ static int ProcPseudoramiXIsActive(ClientPtr client) swapl (&rep.state, n); } WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; + return Success; } @@ -337,7 +337,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) } } - return client->noClientException; + return Success; } diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index 74a4ec3157..71cfb591b2 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -128,7 +128,7 @@ ProcAppleDRIQueryVersion( swapl(&rep.length, n); } WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -159,7 +159,7 @@ ProcAppleDRIQueryDirectRenderingCapable( WriteToClient(client, sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -182,7 +182,7 @@ ProcAppleDRIAuthConnection( rep.authenticated = 0; } WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); - return (client->noClientException); + return Success; } static void surface_notify( @@ -247,7 +247,7 @@ ProcAppleDRICreateSurface( rep.uid = sid; WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); - return (client->noClientException); + return Success; } static int @@ -271,7 +271,7 @@ ProcAppleDRIDestroySurface( return BadValue; } - return (client->noClientException); + return Success; } static int @@ -323,7 +323,7 @@ ProcAppleDRICreatePixmap(ClientPtr client) WriteReplyToClient(client, sizeof(rep), &rep); (void)WriteToClient(client, rep.stringLength, path); - return (client->noClientException); + return Success; } static int @@ -342,7 +342,7 @@ ProcAppleDRIDestroyPixmap(ClientPtr client) DRIDestroyPixmap(pDrawable); - return (client->noClientException); + return Success; } /* dispatch */ diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index a996bc4ecc..d09e983528 100755 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -124,7 +124,7 @@ ProcWindowsWMQueryVersion(register ClientPtr client) swapl(&rep.length, n); } WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -335,7 +335,7 @@ ProcWindowsWMDisableUpdate (register ClientPtr client) //winDisableUpdate(); - return (client->noClientException); + return Success; } static int @@ -345,7 +345,7 @@ ProcWindowsWMReenableUpdate (register ClientPtr client) //winEnableUpdate(); - return (client->noClientException); + return Success; } @@ -358,7 +358,7 @@ ProcWindowsWMSetFrontProcess (register ClientPtr client) //QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0); - return (client->noClientException); + return Success; } @@ -414,7 +414,7 @@ ProcWindowsWMFrameGetRect (register ClientPtr client) #endif WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep); - return (client->noClientException); + return Success; } @@ -507,7 +507,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client) ErrorF ("ProcWindowsWMFrameDraw - done\n"); #endif - return (client->noClientException); + return Success; } static int @@ -566,7 +566,7 @@ ProcWindowsWMFrameSetTitle( ErrorF ("ProcWindowsWMFrameSetTitle - done\n"); #endif - return (client->noClientException); + return Success; } diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index f2b30ebafb..8543535337 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -752,7 +752,7 @@ ProcRRGetCrtcInfo (ClientPtr client) free(extra); } - return client->noClientException; + return Success; } int @@ -997,7 +997,7 @@ sendReply: } WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); - return client->noClientException; + return Success; } int @@ -1066,7 +1066,7 @@ ProcRRGetPanning (ClientPtr client) swaps(&rep.border_bottom, n); } WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep); - return client->noClientException; + return Success; } int @@ -1145,7 +1145,7 @@ sendReply: swaps(&rep.newTimestamp, n); } WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep); - return client->noClientException; + return Success; } int @@ -1173,7 +1173,7 @@ ProcRRGetCrtcGammaSize (ClientPtr client) swaps (&reply.size, n); } WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); - return client->noClientException; + return Success; } int @@ -1218,7 +1218,7 @@ ProcRRGetCrtcGamma (ClientPtr client) WriteSwappedDataToClient (client, len, extra); free(extra); } - return client->noClientException; + return Success; } int @@ -1383,5 +1383,5 @@ ProcRRGetCrtcTransform (ClientPtr client) } WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply); free(reply); - return client->noClientException; + return Success; } diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index ad1439d785..ebfda5717b 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -65,7 +65,7 @@ ProcRRQueryVersion (ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static int diff --git a/randr/rrmode.c b/randr/rrmode.c index 01511e2fd7..e73d1acd8d 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -320,7 +320,7 @@ ProcRRCreateMode (ClientPtr client) WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep); /* Drop out reference to this mode */ RRModeDestroy (mode); - return client->noClientException; + return Success; } int diff --git a/randr/rroutput.c b/randr/rroutput.c index b1a5dbb6e8..e9ab2b904a 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -527,7 +527,7 @@ ProcRRGetOutputInfo (ClientPtr client) free(extra); } - return client->noClientException; + return Success; } static void @@ -581,7 +581,7 @@ ProcRRSetOutputPrimary(ClientPtr client) pScrPriv = rrGetScrPriv(pWin->drawable.pScreen); RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); - return client->noClientException; + return Success; } int @@ -617,5 +617,5 @@ ProcRRGetOutputPrimary(ClientPtr client) WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep); - return client->noClientException; + return Success; } diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 5fc04a9ea8..ff0bca0147 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -447,7 +447,7 @@ ProcRRListOutputProperties (ClientPtr client) WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); free(pAtoms); } - return(client->noClientException); + return Success; } int @@ -493,7 +493,7 @@ ProcRRQueryOutputProperty (ClientPtr client) extra); free(extra); } - return(client->noClientException); + return Success; } int @@ -566,7 +566,7 @@ ProcRRChangeOutputProperty (ClientPtr client) if (err != Success) return err; else - return client->noClientException; + return Success; } int @@ -587,7 +587,7 @@ ProcRRDeleteOutputProperty (ClientPtr client) RRDeleteOutputProperty(output, stuff->property); - return client->noClientException; + return Success; } int @@ -646,7 +646,7 @@ ProcRRGetOutputProperty (ClientPtr client) swapl(&reply.nItems, n); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); - return(client->noClientException); + return Success; } if (prop->immutable && stuff->delete) @@ -678,7 +678,7 @@ ProcRRGetOutputProperty (ClientPtr client) swapl(&reply.nItems, n); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); - return(client->noClientException); + return Success; } /* @@ -753,6 +753,6 @@ ProcRRGetOutputProperty (ClientPtr client) *prev = prop->next; RRDestroyOutputProperty (prop); } - return(client->noClientException); + return Success; } diff --git a/randr/rrscreen.c b/randr/rrscreen.c index c372d46694..051d51410d 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -244,7 +244,7 @@ ProcRRGetScreenSizeRange (ClientPtr client) swaps(&rep.maxHeight, n); } WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); - return (client->noClientException); + return Success; } int @@ -470,7 +470,7 @@ rrGetScreenResources(ClientPtr client, Bool query) WriteToClient (client, extraLen, (char *) extra); free(extra); } - return client->noClientException; + return Success; } int @@ -740,7 +740,7 @@ ProcRRGetScreenInfo (ClientPtr client) WriteToClient (client, extraLen, (char *) extra); free(extra); } - return (client->noClientException); + return Success; } int @@ -975,7 +975,7 @@ sendReply: } WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - return (client->noClientException); + return Success; } static CARD16 diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 94c8e54e5f..457b2b40f0 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -105,7 +105,7 @@ ProcRRXineramaQueryVersion(ClientPtr client) swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } int @@ -143,7 +143,7 @@ ProcRRXineramaGetState(ClientPtr client) swapl (&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); - return client->noClientException; + return Success; } static Bool @@ -198,7 +198,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) swapl(&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); - return client->noClientException; + return Success; } int @@ -234,7 +234,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) swapl(&rep.screen, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); - return client->noClientException; + return Success; } int @@ -256,7 +256,7 @@ ProcRRXineramaIsActive(ClientPtr client) swapl(&rep.state, n); } WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; + return Success; } static void @@ -341,7 +341,7 @@ ProcRRXineramaQueryScreens(ClientPtr client) } } - return client->noClientException; + return Success; } static int diff --git a/record/record.c b/record/record.c index 930374001c..1b55d6bf0d 100644 --- a/record/record.c +++ b/record/record.c @@ -1903,7 +1903,7 @@ ProcRecordQueryVersion(ClientPtr client) } (void)WriteToClient(client, sizeof(xRecordQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } /* ProcRecordQueryVersion */ @@ -2347,7 +2347,7 @@ ProcRecordGetContext(ClientPtr client) (char *)pri->pRanges); } } - err = client->noClientException; + err = Success; bailout: for (i = 0; i < nRCAPs; i++) diff --git a/render/render.c b/render/render.c index c9d3e8e8c9..bba1ce1e6d 100644 --- a/render/render.c +++ b/render/render.c @@ -290,7 +290,7 @@ ProcRenderQueryVersion (ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); + return Success; } static VisualPtr @@ -513,7 +513,7 @@ ProcRenderQueryPictFormats (ClientPtr client) } WriteToClient(client, rlength, (char *) reply); free(reply); - return client->noClientException; + return Success; } static int @@ -572,7 +572,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) WriteToClient(client, rlength, (char *) reply); free(reply); - return (client->noClientException); + return Success; } static int @@ -647,7 +647,6 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) REQUEST(xRenderSetPictureClipRectanglesReq); PicturePtr pPicture; int nr; - int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess); @@ -658,13 +657,9 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) if (nr & 4) return BadLength; nr >>= 3; - result = SetPictureClipRects (pPicture, + return SetPictureClipRects (pPicture, stuff->xOrigin, stuff->yOrigin, nr, (xRectangle *) &stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); } static int @@ -677,7 +672,7 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess); FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); + return Success; } static Bool @@ -772,7 +767,7 @@ ProcRenderTrapezoids (ClientPtr client) CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, ntraps, (xTrapezoid *) &stuff[1]); - return client->noClientException; + return Success; } static int @@ -812,7 +807,7 @@ ProcRenderTriangles (ClientPtr client) CompositeTriangles (stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, ntris, (xTriangle *) &stuff[1]); - return client->noClientException; + return Success; } static int @@ -852,7 +847,7 @@ ProcRenderTriStrip (ClientPtr client) CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; + return Success; } static int @@ -892,7 +887,7 @@ ProcRenderTriFan (ClientPtr client) CompositeTriFan (stuff->op, pSrc, pDst, pFormat, stuff->xSrc, stuff->ySrc, npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; + return Success; } static int @@ -984,7 +979,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet->refcnt++; if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) return BadAlloc; - return client->noClientException; + return Success; } #define NLOCALDELTA 64 @@ -1006,7 +1001,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; } FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; + return Success; } typedef struct _GlyphNew { @@ -1201,7 +1196,7 @@ ProcRenderAddGlyphs (ClientPtr client) if (glyphsBase != glyphsLocal) free(glyphsBase); - return client->noClientException; + return Success; bail: if (pSrc) FreePicture ((pointer) pSrc, 0); @@ -1249,7 +1244,7 @@ ProcRenderFreeGlyphs (ClientPtr client) return RenderErrBase + BadGlyph; } } - return client->noClientException; + return Success; } static int @@ -1426,7 +1421,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) if (listsBase != listsLocal) free(listsBase); - return client->noClientException; + return Success; } static int @@ -1457,7 +1452,7 @@ ProcRenderFillRectangles (ClientPtr client) things, (xRectangle *) &stuff[1]); - return client->noClientException; + return Success; } static void @@ -1682,7 +1677,7 @@ ProcRenderCreateCursor (ClientPtr client) if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) return BadAlloc; - return client->noClientException; + return Success; } static int @@ -1690,15 +1685,10 @@ ProcRenderSetPictureTransform (ClientPtr client) { REQUEST(xRenderSetPictureTransformReq); PicturePtr pPicture; - int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); } static int @@ -1808,7 +1798,7 @@ ProcRenderQueryFilters (ClientPtr client) WriteToClient(client, total_bytes, (char *) reply); free(reply); - return(client->noClientException); + return Success; } static int @@ -1871,7 +1861,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) return ret; if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; + return Success; return BadAlloc; } @@ -1894,7 +1884,7 @@ ProcRenderAddTraps (ClientPtr client) AddTraps (pPicture, stuff->xOff, stuff->yOff, ntraps, (xTrap *) &stuff[1]); - return client->noClientException; + return Success; } static int ProcRenderCreateSolidFill(ClientPtr client) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index b7e6c7b8cc..d5f8b290b0 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -424,7 +424,7 @@ ProcXFixesGetCursorImage (ClientPtr client) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + (npixels << 2), (char *) rep); free(rep); - return client->noClientException; + return Success; } int @@ -452,7 +452,7 @@ ProcXFixesSetCursorName (ClientPtr client) return BadAlloc; pCursor->name = atom; - return(client->noClientException); + return Success; } int @@ -501,7 +501,7 @@ ProcXFixesGetCursorName (ClientPtr client) WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); WriteToClient(client, len, str); - return(client->noClientException); + return Success; } int @@ -584,7 +584,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + (npixels << 2) + nbytesRound, (char *) rep); free(rep); - return client->noClientException; + return Success; } int @@ -719,7 +719,7 @@ ProcXFixesChangeCursor (ClientPtr client) DixWriteAccess|DixSetAttrAccess); ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); - return (client->noClientException); + return Success; } int @@ -757,7 +757,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) ReplaceCursor (pSource, TestForCursorName, &name); - return (client->noClientException); + return Success; } int @@ -895,7 +895,7 @@ ProcXFixesHideCursor (ClientPtr client) pChc = findCursorHideCount(client, pWin->drawable.pScreen); if (pChc != NULL) { pChc->hideCount++; - return client->noClientException; + return Success; } /* @@ -969,7 +969,7 @@ ProcXFixesShowCursor (ClientPtr client) FreeResource(pChc->resource, 0); } - return (client->noClientException); + return Success; } int diff --git a/xfixes/region.c b/xfixes/region.c index d5f583f1b4..5f0c2c432e 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -87,7 +87,7 @@ ProcXFixesCreateRegion (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -132,7 +132,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -194,7 +194,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -244,7 +244,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -291,7 +291,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); FreeResource (stuff->region, RT_NONE); - return(client->noClientException); + return Success; } int @@ -355,7 +355,7 @@ ProcXFixesSetRegion (ClientPtr client) return BadAlloc; } REGION_DESTROY (0, pNew); - return(client->noClientException); + return Success; } int @@ -383,7 +383,7 @@ ProcXFixesCopyRegion (ClientPtr client) if (!REGION_COPY(pScreen, pDestination, pSource)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -403,7 +403,6 @@ int ProcXFixesCombineRegion (ClientPtr client) { RegionPtr pSource1, pSource2, pDestination; - int ret = Success; REQUEST (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); @@ -414,21 +413,19 @@ ProcXFixesCombineRegion (ClientPtr client) switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: if (!REGION_UNION (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; case X_XFixesIntersectRegion: if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; case X_XFixesSubtractRegion: if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; } - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int @@ -450,7 +447,6 @@ ProcXFixesInvertRegion (ClientPtr client) { RegionPtr pSource, pDestination; BoxRec bounds; - int ret = Success; REQUEST(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); @@ -471,11 +467,9 @@ ProcXFixesInvertRegion (ClientPtr client) bounds.y2 = stuff->y + stuff->height; if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) - ret = BadAlloc; + return BadAlloc; - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int @@ -505,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client) VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); - return (client->noClientException); + return Success; } int @@ -534,7 +528,7 @@ ProcXFixesRegionExtents (ClientPtr client) REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); - return (client->noClientException); + return Success; } int @@ -602,7 +596,7 @@ ProcXFixesFetchRegion (ClientPtr client) (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle), (char *) reply); free(reply); - return (client->noClientException); + return Success; } int @@ -645,7 +639,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals); (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); - return (client->noClientException); + return Success; } int @@ -741,7 +735,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) *pDestRegion = pRegion; (*pScreen->SetShape) (pWin); SendShapeNotify (pWin, stuff->destKind); - return (client->noClientException); + return Success; } int @@ -797,7 +791,6 @@ int ProcXFixesExpandRegion (ClientPtr client) { RegionPtr pSource, pDestination; - int ret = Success; REQUEST (xXFixesExpandRegionReq); BoxPtr pTmp; BoxPtr pSrc; @@ -831,9 +824,7 @@ ProcXFixesExpandRegion (ClientPtr client) } free(pTmp); } - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int diff --git a/xfixes/saveset.c b/xfixes/saveset.c index 29de0d8f23..3c0504f7f4 100644 --- a/xfixes/saveset.c +++ b/xfixes/saveset.c @@ -57,11 +57,7 @@ ProcXFixesChangeSaveSet(ClientPtr client) } toRoot = (stuff->target == SaveSetRoot); map = (stuff->map == SaveSetMap); - result = AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map); } int diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index 5163dc11e7..49ed5a0d56 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -92,7 +92,7 @@ ProcXFixesQueryVersion(ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } /* Major version controls available requests */ diff --git a/xkb/xkb.c b/xkb/xkb.c index e354b7448f..5a425bd737 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -194,7 +194,7 @@ ProcXkbUseExtension(ClientPtr client) swaps(&rep.serverMinor, n); } WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); - return client->noClientException; + return Success; } /***====================================================================***/ @@ -219,7 +219,7 @@ ProcXkbSelectEvents(ClientPtr client) client->mapNotifyMask|= (stuff->affectMap&stuff->map); } if ((stuff->affectWhich&(~XkbMapNotifyMask))==0) - return client->noClientException; + return Success; masks = XkbFindClientResource((DevicePtr)dev,client); if (!masks){ @@ -343,7 +343,7 @@ ProcXkbSelectEvents(ClientPtr client) ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft); return BadLength; } - return client->noClientException; + return Success; } return BadAlloc; } @@ -578,7 +578,7 @@ ProcXkbGetState(ClientPtr client) swaps(&rep.ptrBtnState,n); } WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); - return client->noClientException; + return Success; } /***====================================================================***/ @@ -646,7 +646,7 @@ ProcXkbLatchLockState(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -722,7 +722,7 @@ ProcXkbGetControls(ClientPtr client) swaps(&rep.axOptions, n); } WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); - return(client->noClientException); + return Success; } int @@ -942,7 +942,7 @@ ProcXkbSetControls(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -1406,7 +1406,7 @@ char *desc,*start; WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); WriteToClient(client, len, start); free((char *)start); - return client->noClientException; + return Success; } int @@ -2594,7 +2594,7 @@ ProcXkbSetMap(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -2682,7 +2682,7 @@ int size; WriteToClient(client, size, data); free((char *)data); } - return client->noClientException; + return Success; } int @@ -2923,7 +2923,7 @@ ProcXkbSetCompatMap(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -2960,7 +2960,7 @@ ProcXkbGetIndicatorState(ClientPtr client) swapl(&rep.state,i); } WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); - return client->noClientException; + return Success; } /***====================================================================***/ @@ -3036,7 +3036,7 @@ register unsigned bit; WriteToClient(client, length, (char *)map); free((char *)map); } - return client->noClientException; + return Success; } int @@ -3130,7 +3130,7 @@ ProcXkbSetIndicatorMap(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); if (stuff->which==0) - return client->noClientException; + return Success; for (nIndicators=i=0,bit=1;iwhich&bit) @@ -3257,7 +3257,7 @@ ProcXkbGetNamedIndicator(ClientPtr client) } WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); - return client->noClientException; + return Success; } @@ -3467,7 +3467,7 @@ ProcXkbSetNamedIndicator(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -3757,7 +3757,7 @@ register int n; WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); WriteToClient(client, length, start); free((char *)start); - return client->noClientException; + return Success; } int @@ -4286,7 +4286,7 @@ ProcXkbSetNames(ClientPtr client) /* everything is okay -- update names */ - return client->noClientException; + return Success; } /***====================================================================***/ @@ -4787,7 +4787,7 @@ XkbSendGeometry( ClientPtr client, free((char *)start); if (freeGeom) XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); - return client->noClientException; + return Success; } int @@ -5414,7 +5414,7 @@ ProcXkbPerClientFlags(ClientPtr client) swapl(&rep.autoCtrlValues,n); } WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); - return client->noClientException; + return Success; } /***====================================================================***/ @@ -5548,7 +5548,7 @@ ProcXkbListComponents(ClientPtr client) free(list.pool); list.pool= NULL; } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -5891,7 +5891,7 @@ ProcXkbGetKbdByName(ClientPtr client) if (names.compat) { free(names.compat); names.compat= NULL; } if (names.symbols) { free(names.symbols); names.symbols= NULL; } if (names.geometry) { free(names.geometry); names.geometry= NULL; } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -6231,7 +6231,7 @@ char * str; ErrorF("[xkb] Wrote %d fewer bytes than expected\n",length); return BadLength; } - return client->noClientException; + return Success; } static char * @@ -6556,7 +6556,7 @@ ProcXkbSetDeviceInfo(ClientPtr client) } } - return client->noClientException; + return Success; } /***====================================================================***/ @@ -6619,7 +6619,7 @@ int rc; swapl(&rep.supportedCtrls, n); } WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); - return client->noClientException; + return Success; } /***====================================================================***/