[Xquartz-changes] xserver: Branch 'server-1.9-apple' - 22 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Fri May 14 14:16:14 PDT 2010


Rebased ref, commits from common ancestor:
commit cd7a60941c102f0c15a42dfe9450c2ec9346104c
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Feb 12 19:48:52 2010 -0800

    fb: Revert fb changes that broke XQuartz
    
    http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
    Revert "fb: Adjust transform or composite coordinates for pixman operations"
    
    http://bugs.freedesktop.org/26124
    
    This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
    This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fb.h b/fb/fb.h
index 91c91ee..6d15b79 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2078,11 +2078,8 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr	pict,
-		 Bool		has_clip,
-		 int		*xoff,
-		 int		*yoff);
-
+image_from_pict (PicturePtr pict,
+		 Bool       has_clip);
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 896d33e..00f9ada 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -156,24 +156,19 @@ fbComposite (CARD8      op,
 	     CARD16     height)
 {
     pixman_image_t *src, *mask, *dest;
-    int src_xoff, src_yoff;
-    int msk_xoff, msk_yoff;
-    int dst_xoff, dst_yoff;
     
     miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
     if (pMask)
 	miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
     
-    src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-    mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
-    dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, TRUE);
+    mask = image_from_pict (pMask, TRUE);
+    dest = image_from_pict (pDst, TRUE);
 
     if (src && dest && !(pMask && !mask))
     {
 	pixman_image_composite (op, src, mask, dest,
-				xSrc + src_xoff, ySrc + src_yoff,
-				xMask + msk_xoff, yMask + msk_yoff,
-				xDst + dst_xoff, yDst + dst_yoff,
+				xSrc, ySrc, xMask, yMask, xDst, yDst,
 				width, height);
     }
 
@@ -271,22 +266,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip,
-		     int	*xoff,
-		     int	*yoff)
+		     Bool       has_clip)
 {
-    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp;
+    int bpp, xoff, yoff;
     pixman_image_t *image;
     
-    fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
-    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
+
+    bits = (FbBits*)((CARD8*)bits +
+		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+		     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
 	pict->format,
-	pixmap->drawable.width, pixmap->drawable.height,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -312,52 +307,30 @@ create_bits_picture (PicturePtr pict,
 	if (pict->clientClipType != CT_NONE)
 	    pixman_image_set_has_client_clip (image, TRUE);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
+	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
 	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
+	pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
     }
     
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
 	pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
 
-    /* Add in drawable origin to position within the image */
-    *xoff += pict->pDrawable->x;
-    *yoff += pict->pDrawable->y;
-
     return image;
 }
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+set_image_properties (pixman_image_t *image, PicturePtr pict)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
     
     if (pict->transform)
     {
-	/* For source images, adjust the transform to account
-	 * for the drawable offset within the pixman image,
-	 * then set the offset to 0 as it will be used
-	 * to compute positions within the transformed image.
-	 */
-	if (!has_clip) {
-	    struct pixman_transform	adjusted;
-
-	    adjusted = *pict->transform;
-	    pixman_transform_translate(&adjusted,
-				       NULL,
-				       pixman_int_to_fixed(*xoff),
-				       pixman_int_to_fixed(*yoff));
-	    pixman_image_set_transform (image, &adjusted);
-	    *xoff = 0;
-	    *yoff = 0;
-	} else
-	    pixman_image_set_transform (image, pict->transform);
+	pixman_image_set_transform (
+	    image, (pixman_transform_t *)pict->transform);
     }
     
     switch (pict->repeatType)
@@ -384,8 +357,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
     
     if (pict->alphaMap)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
+	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -418,7 +390,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict,
+		 Bool has_clip)
 {
     pixman_image_t *image = NULL;
 
@@ -427,7 +400,7 @@ image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, xoff, yoff);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
@@ -448,11 +421,10 @@ image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 	    else if (sp->type == SourcePictTypeConical)
 		image = create_conical_gradient_image (gradient);
 	}
-	*xoff = *yoff = 0;
     }
     
     if (image)
-	set_image_properties (image, pict, has_clip, xoff, yoff);
+	set_image_properties (image, pict);
     
     return image;
 }
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 9f5c39f..9c55236 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -38,8 +38,7 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    int image_xoff, image_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;
@@ -55,8 +54,7 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    int	mask_xoff, mask_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;
commit 55588e7418a53e89335b39ce16c532c630dbacc8
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

    Workaround the GC clipping problem in miPaintWindow and add some debugging output.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index a50dc5e..b20535f 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -524,6 +524,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -551,24 +552,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
 	return;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -590,6 +604,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	PixmapPtr   pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	tile_x_off = drawable->x;
 	tile_y_off = drawable->y;
 	
@@ -598,6 +624,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	    return;
 	pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
 	drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+	ErrorF("     Draw: %d %d %d %d\n",
+	       drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
 	draw_x_off = pixmap->screen_x;
 	draw_y_off = pixmap->screen_y;
@@ -660,6 +692,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = REGION_NUM_RECTS(prgn);
     pbox = REGION_RECTS(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit 1461b31e40a3e44f6327199d23cf2ab70d8f5176
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date:   Fri May 14 16:25:43 2010 +0300

    dri2: Fix xserver crash if dri2 buffer allocation fails.
    
    If driver fails to allocate memory for dri2 buffer server would crash
    in send_buffers_reply.
    
    Solution is to handle the allocation failure and return BadAlloc to
    client.
    
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e3bec33..68982fe 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -326,6 +326,31 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
     }
 }
 
+static void
+update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw,
+			     DRI2BufferPtr *buffers, int *out_count, int *width, int *height)
+{
+    DRI2ScreenPtr   ds = DRI2GetScreen(pDraw->pScreen);
+    int i;
+
+    if (pPriv->buffers != NULL) {
+	for (i = 0; i < pPriv->bufferCount; i++) {
+	    if (pPriv->buffers[i] != NULL) {
+		(*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
+	    }
+	}
+
+	free(pPriv->buffers);
+    }
+
+    pPriv->buffers = buffers;
+    pPriv->bufferCount = *out_count;
+    pPriv->width = pDraw->width;
+    pPriv->height = pDraw->height;
+    *width = pPriv->width;
+    *height = pPriv->height;
+}
+
 static DRI2BufferPtr *
 do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 	       unsigned int *attachments, int count, int *out_count,
@@ -363,6 +388,9 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 				     &buffers[i]))
 		buffers_changed = 1;
 
+	if (buffers[i] == NULL)
+	    goto err_out;
+
 	/* If the drawable is a window and the front-buffer is requested,
 	 * silently add the fake front-buffer to the list of requested
 	 * attachments.  The counting logic in the loop accounts for the case
@@ -395,6 +423,9 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 				     front_format, dimensions_match,
 				     &buffers[i++]))
 	    buffers_changed = 1;
+
+	if (buffers[i] == NULL)
+	    goto err_out;
     }
 
     if (need_fake_front > 0) {
@@ -403,29 +434,15 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 				     &buffers[i++]))
 	    buffers_changed = 1;
 
+	if (buffers[i] == NULL)
+	    goto err_out;
+
 	have_fake_front = 1;
     }
 
     *out_count = i;
 
-
-    if (pPriv->buffers != NULL) {
-	for (i = 0; i < pPriv->bufferCount; i++) {
-	    if (pPriv->buffers[i] != NULL) {
-		(*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
-	    }
-	}
-
-	free(pPriv->buffers);
-    }
-
-    pPriv->buffers = buffers;
-    pPriv->bufferCount = *out_count;
-    pPriv->width = pDraw->width;
-    pPriv->height = pDraw->height;
-    *width = pPriv->width;
-    *height = pPriv->height;
-
+    update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
 
     /* If the client is getting a fake front-buffer, pre-fill it with the
      * contents of the real front-buffer.  This ensures correct operation of
@@ -446,6 +463,22 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     }
 
     return pPriv->buffers;
+
+err_out:
+
+    *out_count = 0;
+
+    for (i = 0; i < count; i++) {
+	    if (buffers[i] != NULL)
+		    (*ds->DestroyBuffer)(pDraw, buffers[i]);
+    }
+
+    free(buffers);
+    buffers = NULL;
+
+    update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
+
+    return buffers;
 }
 
 DRI2BufferPtr *
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 602eb66..44a47cc 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -207,7 +207,7 @@ ProcDRI2DestroyDrawable(ClientPtr client)
 }
 
 
-static void
+static int
 send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
 		   DRI2BufferPtr *buffers, int count, int width, int height)
 {
@@ -215,6 +215,9 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
     int skip = 0;
     int i;
 
+    if (buffers == NULL)
+	    return BadAlloc;
+
     if (pDrawable->type == DRAWABLE_WINDOW) {
 	for (i = 0; i < count; i++) {
 	    /* Do not send the real front buffer of a window to the client.
@@ -251,6 +254,7 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
 	buffer.flags = buffers[i]->flags;
 	WriteToClient(client, sizeof(xDRI2Buffer), &buffer);
     }
+    return Success;
 }
 
 
@@ -276,9 +280,8 @@ ProcDRI2GetBuffers(ClientPtr client)
 			     attachments, stuff->count, &count);
 
 
-    send_buffers_reply(client, pDrawable, buffers, count, width, height);
+    return send_buffers_reply(client, pDrawable, buffers, count, width, height);
 
-    return Success;
 }
 
 static int
@@ -302,9 +305,7 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client)
     buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height,
 				       attachments, stuff->count, &count);
 
-    send_buffers_reply(client, pDrawable, buffers, count, width, height);
-
-    return Success;
+    return send_buffers_reply(client, pDrawable, buffers, count, width, height);
 }
 
 static int
commit f87002cb7d8729b1da4cbefe7653f4cfd3a2d956
Merge: a4fbc0f... 890f536...
Author: Keith Packard <keithp at keithp.com>
Date:   Fri May 14 11:46:29 2010 -0700

    Merge remote branch 'jamey/for-keith'

commit 890f536f8d66f08e7d6a5685659eef4001a8757d
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 14 00:18:14 2010 -0700

    Bugfix for "Pre-validate ChangeGC XIDs": off-by-one in loop index.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/dix/gc.c b/dix/gc.c
index 00b63bd..5a0d00d 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -439,7 +439,7 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
 	client->errorValue = mask;
 	return BadValue;
     }
-    for (i = Ones(mask); i; --i)
+    for (i = Ones(mask); i--; )
 	vals[i].val = pC32[i];
     for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i)
     {
commit a4fbc0fedafda6df98f647173a2deccb86ef0479
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Fri May 14 07:49:31 2010 +0300

    scrnintstr.h: removed unused PaintWindow function pointers.
    
    Please note this patch breaks the ABI.
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/doc/dmx.sgml b/hw/dmx/doc/dmx.sgml
index ef66d11..6aa0ec5 100644
--- a/hw/dmx/doc/dmx.sgml
+++ b/hw/dmx/doc/dmx.sgml
@@ -1001,8 +1001,7 @@ default routine is chosen during GC validation.
 
 <p>Note that some pointers to functions that draw to the screen are
 stored in the Screen structure.  They include GetImage(), GetSpans(),
-PaintWindowBackground(), PaintWindowBorder(), CopyWindow() and
-RestoreAreas().
+CopyWindow() and RestoreAreas().
 
 <sect2>Xnest
 
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 462be87..36d18eb 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -279,7 +279,6 @@ void QuartzUpdateScreens(void) {
     pRoot = WindowTable[pScreen->myNum];
     AppleWMSetScreenOrigin(pRoot);
     pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
-    //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
 
     /* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index a4ca0c6..3a77e0c 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -168,14 +168,6 @@ typedef    void (* WindowExposuresProcPtr)(
 	RegionPtr /*prgn*/,
 	RegionPtr /*other_exposed*/);
 
-typedef    void (* PaintWindowProcPtr)(
-	WindowPtr /*pWindow*/,
-	RegionPtr /*pRegion*/,
-	int /*what*/);
-
-typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
-typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
-
 typedef    void (* CopyWindowProcPtr)(
 	WindowPtr /*pWindow*/,
 	DDXPointRec /*ptOldOrg*/,
@@ -497,8 +489,6 @@ typedef struct _Screen {
     ValidateTreeProcPtr		ValidateTree;
     PostValidateTreeProcPtr	PostValidateTree;
     WindowExposuresProcPtr	WindowExposures;
-    PaintWindowBackgroundProcPtr PaintWindowBackground; /** unused */
-    PaintWindowBorderProcPtr	PaintWindowBorder; /** unused */
     CopyWindowProcPtr		CopyWindow;
     ClearToBackgroundProcPtr	ClearToBackground;
     ClipNotifyProcPtr		ClipNotify;
diff --git a/mi/miexpose.c b/mi/miexpose.c
index a99e530..a50dc5e 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -297,7 +297,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 
 	if (extents)
 	{
-	    /* PaintWindowBackground doesn't clip, so we have to */
+	    /* miPaintWindow doesn't clip, so we have to */
 	    REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList);
 	}
 	miPaintWindow((WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND);
@@ -497,7 +497,7 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
 		REGION_RESET( pWin->drawable.pScreen, exposures, &box);
 		REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures);
 	    }
-	    /* PaintWindowBackground doesn't clip, so we have to */
+	    /* miPaintWindow doesn't clip, so we have to */
 	    REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList);
 	}
 	if (prgn && !REGION_NIL(prgn))
commit 71296885b0bb946e7ab986169f5b872952c221a0
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Thu May 13 07:12:43 2010 +0300

    mi: removed unused PointerNonInterestBox functions.
    
    Please note this patch breaks the ABI.
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 8c1c244..62255b8 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -260,7 +260,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
   pScreen->SaveScreen = xnestSaveScreen;
   pScreen->GetImage = xnestGetImage;
   pScreen->GetSpans = xnestGetSpans;
-  pScreen->PointerNonInterestBox = NULL;
   pScreen->SourceValidate = NULL;
 
   /* Window Procedures */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 5538936..a4ca0c6 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -121,11 +121,6 @@ typedef    void (* GetSpansProcPtr)(
 	int /*nspans*/,
 	char * /*pdstStart*/);
 
-typedef    void (* PointerNonInterestBoxProcPtr)(
-        DeviceIntPtr /*pDev*/,
-	ScreenPtr /*pScreen*/,
-	BoxPtr /*pBox*/);
-
 typedef    void (* SourceValidateProcPtr)(
 	DrawablePtr /*pDrawable*/,
 	int /*x*/,
@@ -489,7 +484,6 @@ typedef struct _Screen {
     SaveScreenProcPtr		SaveScreen;
     GetImageProcPtr		GetImage;
     GetSpansProcPtr		GetSpans;
-    PointerNonInterestBoxProcPtr PointerNonInterestBox;
     SourceValidateProcPtr	SourceValidate;
 
     /* Window Procedures */
diff --git a/mi/mipointer.c b/mi/mipointer.c
index ad7b3db..296c57f 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -63,8 +63,6 @@ static Bool miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
                                    CursorPtr pCursor);
 static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
                                      BoxPtr pBox); 
-static void miPointerPointerNonInterestBox(DeviceIntPtr pDev, 
-                                           ScreenPtr pScreen, BoxPtr pBox);
 static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen,
                                   CursorPtr pCursor, BoxPtr pHotBox, 
                                   BoxPtr pTopLeftBox);
@@ -115,7 +113,6 @@ miPointerInitialize (ScreenPtr                  pScreen,
     pScreen->UnrealizeCursor = miPointerUnrealizeCursor;
     pScreen->SetCursorPosition = miPointerSetCursorPosition;
     pScreen->RecolorCursor = miRecolorCursor;
-    pScreen->PointerNonInterestBox = miPointerPointerNonInterestBox;
     pScreen->DeviceCursorInitialize = miPointerDeviceInitialize;
     pScreen->DeviceCursorCleanup = miPointerDeviceCleanup;
 
@@ -211,15 +208,6 @@ miPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox)
 
 /*ARGSUSED*/
 static void
-miPointerPointerNonInterestBox (DeviceIntPtr    pDev,
-                                ScreenPtr       pScreen,
-                                BoxPtr          pBox)
-{
-    /* until DIX uses this, this will remain a stub */
-}
-
-/*ARGSUSED*/
-static void
 miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
                       BoxPtr pHotBox, BoxPtr pTopLeftBox)
 {
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index d46b9f5..1b88ecb 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -246,7 +246,6 @@ miScreenInit(
     }
     /* else CloseScreen */
     /* QueryBestSize, SaveScreen, GetImage, GetSpans */
-    pScreen->PointerNonInterestBox = (PointerNonInterestBoxProcPtr) 0;
     pScreen->SourceValidate = (SourceValidateProcPtr) 0;
     /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
     /* RealizeWindow, UnrealizeWindow */
commit 795432d4a92ed5b9fa4d9163e73c8e4fe4c74534
Merge: f2a0c32... 92ed75a...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu May 13 18:22:49 2010 -0700

    Merge remote branch 'jamey/cleanups'

commit 92ed75ac59e2d3af149cddb962efd05fc8487750
Author: Jamey Sharp <jamey at minilop.net>
Date:   Mon May 10 20:22:05 2010 -0700

    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 <jamey at minilop.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/Xext/bigreq.c b/Xext/bigreq.c
index f9f15ed..ce3734e 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 df63a8b..33a6e26 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 f0a3d87..b7f32c0 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 38b2f48..31286d4 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 47362df..a181695 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 f89ee18..4b43a30 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 2685815..7995ff2 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 f21d633..cd75658 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 39b3929..25043fa 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 94ac5df..0534728 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 6e6461a..364b92a 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 1c8e3f2..986c870 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 312fcc9..8c4a7eb 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 14641f7..06639a2 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 4d55e15..93c1b59 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 bb5bae6..09c4677 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 b8d8d17..fd633f1 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 3ddee77..b24204d 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 17c4bae..3bb9a37 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 f2630fe..af4fef6 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 f4d088c..b28b3a0 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 db5c4a1..de72c88 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 aee9143..fe9ddb2 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 6940b68..d3d4db0 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 74d3d78..03b70ef 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 6a13572..4f592d1 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 593e053..b234afc 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 95e7adc..5718b6a 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 b6b2e31..7a418c8 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 0773338..55cc0f1 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 711a9cb..6587af9 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 5bdd88c..665f743 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 4e5a15f..f32565d 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 9419326..602eb66 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 8750f5d..53d167e 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 c3154b9..5868ab1 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 74a4ec3..71cfb59 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 a996bc4..d09e983 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 f2b30eb..8543535 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 ad1439d..ebfda57 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 01511e2..e73d1ac 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 b1a5dbb..e9ab2b9 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 5fc04a9..ff0bca0 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 c372d46..051d514 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 94c8e54..457b2b4 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 9303740..1b55d6b 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 c9d3e8e..bba1ce1 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 b7e6c7b..d5f8b29 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 d5f583f..5f0c2c4 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 29de0d8..3c0504f 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 5163dc1..49ed5a0 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 e354b74..5a425bd 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;i<XkbNumIndicators;i++,bit<<=1) {
 	if (stuff->which&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;
 }
 
 /***====================================================================***/
commit 11c69880c7c48ef9e755c4e09fadef7a629d7bc7
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 22:16:32 2010 -0700

    Quit using clientErrorValue in dix/colormap.c.
    
    And that's it! No more clientErrorValue kludge.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/colormap.c b/dix/colormap.c
index 9a4ff28..f75eefe 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 fddfb70..aee9143 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 57cebf4..20cf452 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 40697e0..9bfdd78 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 7af5f93..0f0edb2 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 dad71b9..4720f4d 100644
--- a/hw/xfree86/vgahw/vgaCmap.c
+++ b/hw/xfree86/vgahw/vgaCmap.c
@@ -246,7 +246,7 @@ vgaInstallColormap(pmap)
 
   for ( i=0; i<entries; i++) ppix[i] = i;
 
-  QueryColors( pmap, entries, ppix, prgb);
+  QueryColors(pmap, entries, ppix, prgb, serverClient);
 
   for ( i=0; i<entries; i++) /* convert xrgbs to xColorItems */
     {
diff --git a/include/colormap.h b/include/colormap.h
index de48ce8..1b15748 100644
--- a/include/colormap.h
+++ b/include/colormap.h
@@ -135,7 +135,8 @@ extern _X_EXPORT int QueryColors(
     ColormapPtr /*pmap*/,
     int /*count*/,
     Pixel* /*ppixIn*/,
-    xrgb* /*prgbList*/);
+    xrgb* /*prgbList*/,
+    ClientPtr client);
 
 extern _X_EXPORT int FreeClientPixels(
     pointer /*pcr*/,
@@ -173,7 +174,8 @@ extern _X_EXPORT int FreeColors(
 extern _X_EXPORT int StoreColors(
     ColormapPtr /*pmap*/,
     int /*count*/,
-    xColorItem* /*defs*/);
+    xColorItem* /*defs*/,
+    ClientPtr client);
 
 extern _X_EXPORT int IsMapInstalled(
     Colormap /*map*/,
diff --git a/render/miindex.c b/render/miindex.c
index c42a15b..5e2e06c 100644
--- a/render/miindex.c
+++ b/render/miindex.c
@@ -276,7 +276,7 @@ miInitIndexed (ScreenPtr	pScreen,
     /*
      * Build mapping from pixel value to ARGB
      */
-    QueryColors (pColormap, num, pixels, rgb);
+    QueryColors (pColormap, num, pixels, rgb, serverClient);
     for (i = 0; i < num; i++)
     {
 	p = pixels[i];
commit a3d948ddbb54b9e831e67f22d5031922a3c44107
Author: Jamey Sharp <jamey at minilop.net>
Date:   Thu May 6 12:35:52 2010 -0700

    clientErrorValue is never used outside dix. Stop importing it.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 75f758d..47362df 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 13cd600..72678f7 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 35fad4d..f0b5644 100644
--- a/glx/xfont.c
+++ b/glx/xfont.c
@@ -46,8 +46,6 @@
 #include <windowstr.h>
 #include <dixfontstr.h>
 
-extern XID clientErrorValue;	/* imported kludge from dix layer */
-
 /*
 ** Make a single GL bitmap from a single X glyph
 */
commit 653e4878c4cc03613172a93ad4800e1eacc98f17
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 19:18:11 2010 -0700

    Quit using clientErrorValue in dix/gc.c.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index d6a8a5a..fddfb70 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 43d16db..00b63bd 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -66,7 +66,6 @@ SOFTWARE.
 #include "xace.h"
 #include <assert.h>
 
-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;
 	}
     }
commit 5193f25ea33eed31d6a75cdc1a86427c23d8033c
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 19:08:47 2010 -0700

    Define GCAllBits as the union of all valid CreateGC masks.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/gc.c b/dix/gc.c
index 1f2d4d0..43d16db 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 8d9b055..b9fc5ca 100644
--- a/include/gcstruct.h
+++ b/include/gcstruct.h
@@ -59,6 +59,8 @@ SOFTWARE.
 #include "privates.h"
 #include <X11/Xprotostr.h>
 
+#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 460862f..2d8fd12 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;
 }
commit 6a84cd943430cfc9df55c83aef6a7f8dea6dbb94
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 7 19:38:05 2010 -0700

    Replace dixChangeGC with calls directly to the right variant.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 7a8019e..3694ab8 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 1d14bb3..f4d088c 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 4dc9ecd..d6a8a5a 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 01123c3..585754b 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 6d7a92d..1f2d4d0 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);
- * 
- *     example calling dixChangeGC using pUnion parameter;
- *     same effect as above
- *
- *     ChangeGCVal v[2];
- *     v[0].val = foreground;
- *     v[1].val = background;
- *     dixChangeGC(client, pGC, GCForeground|GCBackground, NULL, v);
+ *     v[0] = FillTiled;
+ *     v[1] = pid;
+ *     ChangeGCXIDs(client, pGC, GCFillStyle|GCTile, v);
  * 
- * However, if you need to pass a pointer to a pixmap or font, you MUST
- * use the pUnion parameter.
+ * However, if you need to pass a pointer to a pixmap or font, you must
+ * use ChangeGC:
  * 
- *     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);
+ *     ChangeGC(client, pGC, GCFillStyle|GCTile, v);
  * 
- * Note: we could have gotten by with just the pUnion parameter, but on
- * 64 bit machines that would have forced us to copy the value list that
- * comes in the ChangeGC request.
+ * If you have neither XIDs nor pointers, you can use either function,
+ * but ChangeGC will do less work.
+ *
+ *     ChangeGCVal v[2];
+ *     v[0].val = foreground;
+ *     v[1].val = background;
+ *     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 f10400f..fa2aeca 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 595c608..57cebf4 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 28a9cf0..999be1c 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 e6cb1ee..ac8fd47 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 f5a3247..b1982a5 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 aedf068..c81d7da 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 2ea305b..2b33f25 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 7580c26..598a1be 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 3fa953d..63eecbd 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 bdcbdf1..7e8ec1f 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 b767a05..9c6e03d 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 865b60b..1acc469 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 03ce896..a99e530 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 acb4327..13efb0c 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 99ba68a..3e43a52 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 c08f964..5f3d582 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 8d84878..e08aa68 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 6233472..5adf3dd 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 c3bcdc8..460862f 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 38452ec..13d7fa6 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 8ed7fa1..d5f583f 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);
commit 2d7eb4a19b773d0406c0c2e018a7da97f3565fd5
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 7 18:11:36 2010 -0700

    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 <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/gc.c b/dix/gc.c
index e5e6b4f..6d7a92d 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.
commit e2929db7b737413cf93fbebdf4d15abdfebff05c
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 14:10:51 2010 -0700

    dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
    
    The exceptions are ProcChangeGC and CreateGC.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index a764972..7a8019e 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 332fb97..01123c3 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 c9b704a..e5e6b4f 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 313593b..595c608 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 80dd480..28a9cf0 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 a005451..e6cb1ee 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 672e0e4..f5a3247 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 bf6600a..aedf068 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 e2d9c15..2ea305b 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 e62f280..7580c26 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 f2959c7..bdcbdf1 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 f02c04f..b767a05 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -646,7 +646,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     unsigned char	depth;
     int			i, linelength, width, srcx, srcy;
     DDXPointRec		pt = {0, 0};
-    XID			gcv[2];
     PixmapPtr		pPixmap = NULL;
     GCPtr		pGC = NULL;
 
@@ -655,6 +654,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     {
 	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
 	{
+	    ChangeGCVal gcv;
 	    xPoint pt;
 
 	    pGC = GetScratchGC(depth, pDraw->pScreen);
@@ -678,8 +678,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
 				   TRUE);
  
 	    /* alu is already GXCopy */
-	    gcv[0] = (XID)planeMask;
-	    dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+	    gcv.val = (XID)planeMask;
+	    dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, &gcv);
 	    ValidateGC((DrawablePtr)pPixmap, pGC);
 	}
 
@@ -747,7 +747,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
     RegionPtr		prgnSrc;
     BoxRec		box;
     unsigned long	oldFg, oldBg;
-    XID			gcv[3];
+    ChangeGCVal		gcv[3];
     unsigned long	oldPlanemask;
     unsigned long	i;
     long		bytesPer;
@@ -774,26 +774,26 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	oldPlanemask = pGC->planemask;
 	oldFg = pGC->fgPixel;
 	oldBg = pGC->bgPixel;
-	gcv[0] = (XID)~0;
-	gcv[1] = (XID)0;
-	dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL);
+	gcv[0].val = (XID)~0;
+	gcv[1].val = (XID)0;
+	dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcv);
 	bytesPer = (long)h * BitmapBytePad(w + leftPad);
 
 	for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
 	{
 	    if (i & oldPlanemask)
 	    {
-	        gcv[0] = (XID)i;
-	        dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+	        gcv[0].val = (XID)i;
+	        dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, gcv);
 	        ValidateGC(pDraw, pGC);
 	        (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
 			         XYBitmap, (char *)pImage);
 	    }
 	}
-	gcv[0] = (XID)oldPlanemask;
-	gcv[1] = (XID)oldFg;
-	gcv[2] = (XID)oldBg;
-	dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL);
+	gcv[0].val = (XID)oldPlanemask;
+	gcv[1].val = (XID)oldFg;
+	gcv[2].val = (XID)oldBg;
+	dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, NULL, gcv);
 	ValidateGC(pDraw, pGC);
 	break;
 
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 11547db..865b60b 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 b4d489a..03ce896 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 22a170a..acb4327 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 b54a9fd..99ba68a 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 cabc0c1..c08f964 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 2ff36ed..8d84878 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 feaa3cb..6233472 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 1959c8b..c3bcdc8 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 0030eff..38452ec 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 5e16369..8ed7fa1 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);
commit 95728ca09d45afc84c8d1828c09c6b6725f1a58d
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 09:25:34 2010 -0700

    Don't statically allocate the ChangeGC parameter array.
    
    Because that's insane.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/miarc.c b/mi/miarc.c
index 36b71bf..f2959c7 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 */
commit bff8525f8483304d5f93e83e36b47209381da721
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 12:06:50 2010 -0700

    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 <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/miwideline.c b/mi/miwideline.c
index 22e15cf..cabc0c1 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -106,6 +106,31 @@ static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
  */
 
 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,
 		  PolyEdgePtr left, PolyEdgePtr right,
@@ -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
commit 83f7ec97279405958aed86c6a57704a460c3bfba
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sat May 8 13:38:00 2010 -0700

    miwideline: Factor out span buffer allocation.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/mi/miwideline.c b/mi/miwideline.c
index c54e2de..22e15cf 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
commit f2a0c324e37c9fa3eb9087adbf963addb7f21d88
Author: Keith Packard <keithp at keithp.com>
Date:   Thu May 13 10:33:39 2010 -0700

    Remove devPrivates init and delete callback lists.
    
    XSELinux was the only consumer of these interfaces and it no longer
    needs them.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/dix/privates.c b/dix/privates.c
index 27694cb..4a8a186 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -47,8 +47,6 @@ struct _Private {
 typedef struct _PrivateDesc {
     DevPrivateKey key;
     unsigned size;
-    CallbackListPtr initfuncs;
-    CallbackListPtr deletefuncs;
 } PrivateDescRec;
 
 #define PRIV_MAX 256
@@ -102,7 +100,6 @@ pointer *
 dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
 {
     PrivateDescRec *item = findItem(key);
-    PrivateCallbackRec calldata;
     PrivateRec *ptr;
     pointer value;
     int oldsize, newsize;
@@ -144,10 +141,6 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
 	ptr->value = value;
     }
 
-    calldata.key = key;
-    calldata.value = &ptr->value;
-    CallCallbacks(&item->initfuncs, &calldata);
-
     return &ptr->value;
 }
 
@@ -202,16 +195,10 @@ void
 dixFreePrivates(PrivateRec *privates)
 {
     int i;
-    PrivateCallbackRec calldata;
 
     if (privates)
 	for (i = 1; i < privates->state; i++)
 	    if (privates[i].state) {
-		/* call the delete callbacks */
-		calldata.key = items[i].key;
-		calldata.value = &privates[i].value;
-		CallCallbacks(&items[i].deletefuncs, &calldata);
-
 		/* free pre-allocated memory */
 		if (items[i].size)
 		    free(privates[i].value);
@@ -220,31 +207,6 @@ dixFreePrivates(PrivateRec *privates)
     free(privates);
 }
 
-/*
- * Callback registration
- */
-int
-dixRegisterPrivateInitFunc(const DevPrivateKey key,
-			   CallbackProcPtr callback, pointer data)
-{
-    PrivateDescRec *item = findItem(key);
-    if (!item)
-	return FALSE;
-
-    return AddCallback(&item->initfuncs, callback, data);
-}
-
-int
-dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
-			     CallbackProcPtr callback, pointer data)
-{
-    PrivateDescRec *item = findItem(key);
-    if (!item)
-	return FALSE;
-
-    return AddCallback(&item->deletefuncs, callback, data);
-}
-
 /* Table of devPrivates offsets */
 static const int offsetDefaults[] = {
     -1,					/* RT_NONE */
@@ -304,8 +266,6 @@ dixResetPrivates(void)
     for (i = 1; i < nextPriv; i++) {
 	*items[i].key = 0;
 	items[i].size = 0;
-	DeleteCallbackList(&items[i].initfuncs);
-	DeleteCallbackList(&items[i].deletefuncs);
     }
     nextPriv = 1;
 
diff --git a/include/privates.h b/include/privates.h
index e6f788d..7850dea 100644
--- a/include/privates.h
+++ b/include/privates.h
@@ -94,33 +94,7 @@ extern _X_EXPORT int
 dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val);
 
 /*
- * Register callbacks to be called on private allocation/freeing.
- * The calldata argument to the callbacks is a PrivateCallbackPtr.
- */
-typedef struct _PrivateCallback {
-    DevPrivateKey key;	/* private registration key */
-    pointer *value;	/* address of private pointer */
-} PrivateCallbackRec;
-
-/*
- * Register a function to be called when dixAllocPrivate successfully associates
- * 'key' with a new PrivateRec.
- */
-extern _X_EXPORT int
-dixRegisterPrivateInitFunc(const DevPrivateKey key, 
-			   CallbackProcPtr callback, pointer userdata);
-
-/*
- * Register a function to be called when dixFreePrivates unassociates 'key' with
- * a PrivateRec.
- */
-extern _X_EXPORT int
-dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
-			     CallbackProcPtr callback, pointer userdata);
-
-/*
- * Unassociates all keys from 'privates', calls the callbacks registered with
- * dixRegisterPrivateDeleteFunc, and frees all private data automatically
+ * Unassociates all keys from 'privates' and frees all private data automatically
  * allocated via dixRequestPrivate.
  */
 extern _X_EXPORT void
commit c9e7ca4404803fe44d4684e0bb2ca2ee10fd4bb3
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed May 12 20:25:30 2010 -0400

    xselinux: Remove use of devPrivates init/free callbacks.
    
    Commit eb9210097efea81065c301e5b6b4da7a566deb4a removed the
    sidget/sidput calls which were the major reason for using the
    callbacks.  The remaining operations can be skipped or worked
    around.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 135992a..13e5243 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -151,12 +151,7 @@ SELinuxLabelClient(ClientPtr client)
 	if (bytes <= 0)
 	    goto finish;
 
-	subj->command = malloc(bytes);
-	if (!subj->command)
-	    goto finish;
-
-	memcpy(subj->command, path, bytes);
-	subj->command[bytes - 1] = 0;
+	strncpy(subj->command, path, COMMAND_LEN - 1);
     }
 
 finish:
@@ -464,7 +459,7 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
     /* If this is a new object that needs labeling, do it now */
     /* XXX there should be a separate callback for this */
-    if (obj->sid == unlabeled_sid) {
+    if (obj->sid == NULL) {
 	security_id_t sid;
 
 	serv = dixLookupPrivate(&serverClient->devPrivates, subjectKey);
@@ -809,39 +804,6 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 }
 
 
-/*
- * DevPrivates Callbacks
- */
-
-static void
-SELinuxSubjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
-    PrivateCallbackRec *rec = calldata;
-    SELinuxSubjectRec *subj = *rec->value;
-
-    subj->sid = unlabeled_sid;
-
-    avc_entry_ref_init(&subj->aeref);
-}
-
-static void
-SELinuxSubjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
-    PrivateCallbackRec *rec = calldata;
-    SELinuxSubjectRec *subj = *rec->value;
-
-    free(subj->command);
-}
-
-static void
-SELinuxObjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
-    PrivateCallbackRec *rec = calldata;
-    SELinuxObjectRec *obj = *rec->value;
-
-    obj->sid = unlabeled_sid;
-}
-
 static int netlink_fd;
 
 static void
@@ -953,11 +915,6 @@ SELinuxFlaskInit(void)
                                    NULL);
 
     /* Register callbacks */
-    ret &= dixRegisterPrivateInitFunc(subjectKey, SELinuxSubjectInit, NULL);
-    ret &= dixRegisterPrivateDeleteFunc(subjectKey, SELinuxSubjectFree, NULL);
-    ret &= dixRegisterPrivateInitFunc(objectKey, SELinuxObjectInit, NULL);
-    ret &= dixRegisterPrivateInitFunc(dataKey, SELinuxObjectInit, NULL);
-
     ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL);
     ret &= AddCallback(&ResourceStateCallback, SELinuxResourceState, NULL);
 
diff --git a/Xext/xselinuxint.h b/Xext/xselinuxint.h
index 854a57d..e5dbe11 100644
--- a/Xext/xselinuxint.h
+++ b/Xext/xselinuxint.h
@@ -36,6 +36,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * Types
  */
 
+#define COMMAND_LEN 64
+
 /* subject state (clients and devices only) */
 typedef struct {
     security_id_t sid;
@@ -46,7 +48,7 @@ typedef struct {
     security_id_t sel_use_sid;
     security_id_t prp_use_sid;
     struct avc_entry_ref aeref;
-    char *command;
+    char command[COMMAND_LEN];
     int privileged;
 } SELinuxSubjectRec;
 
commit bca85e2e127a8a23e3a2debcfeb3ae07cd3c66ac
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 13 08:32:00 2010 -0700

    Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN
    
    Use the values from xproto rather than duplicating the effort
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index e9266ab..4544a4f 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -210,14 +210,14 @@ extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
 extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
 		     const char *format, va_list args);
 extern _X_EXPORT void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
-		    const char *format, ...) _printf_attribute(4,5);
+		    const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5);
 extern _X_EXPORT void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
-		_printf_attribute(3,4);
+		_X_ATTRIBUTE_PRINTF(3,4);
 extern _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
-		_printf_attribute(3,4);
-extern _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
-extern _X_EXPORT void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
-extern _X_EXPORT void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
+		_X_ATTRIBUTE_PRINTF(3,4);
+extern _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3);
+extern _X_EXPORT void xf86ErrorFVerb(int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3);
+extern _X_EXPORT void xf86ErrorF(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern _X_EXPORT const char *xf86TokenToString(SymTabPtr table, int token);
 extern _X_EXPORT int xf86StringToToken(SymTabPtr table, const char *string);
 extern _X_EXPORT void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
diff --git a/include/misc.h b/include/misc.h
index e4bdee4..62d813e 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -100,18 +100,6 @@ typedef unsigned long ATOM;
 #define FALSE 0
 #endif
 
-#ifdef __GNUC__
-#define X_DEPRECATED __attribute__((deprecated))
-#else
-#define X_DEPRECATED
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ > 2)
-#define X_NORETURN __attribute__((noreturn))
-#else
-#define X_NORETURN
-#endif
-
 #ifndef _XTYPEDEF_CALLBACKLISTPTR
 typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
 #define _XTYPEDEF_CALLBACKLISTPTR
diff --git a/include/os.h b/include/os.h
index d34e056..efa202c 100644
--- a/include/os.h
+++ b/include/os.h
@@ -218,20 +218,20 @@ extern _X_EXPORT int set_font_authorizations(
 /*
  * Use malloc(3) instead.
  */
-extern _X_EXPORT void *Xalloc(unsigned long /*amount*/) X_DEPRECATED;
+extern _X_EXPORT void *Xalloc(unsigned long /*amount*/) _X_DEPRECATED;
 /*
  * Use calloc(3) instead
  */
-extern _X_EXPORT void *Xcalloc(unsigned long /*amount*/) X_DEPRECATED;
+extern _X_EXPORT void *Xcalloc(unsigned long /*amount*/) _X_DEPRECATED;
 /*
  * Use realloc(3) instead
  */
 extern _X_EXPORT void *Xrealloc(void * /*ptr*/, unsigned long /*amount*/)
-    X_DEPRECATED;
+    _X_DEPRECATED;
 /*
  * Use free(3) instead
  */
-extern _X_EXPORT void Xfree(void * /*ptr*/) X_DEPRECATED;
+extern _X_EXPORT void Xfree(void * /*ptr*/) _X_DEPRECATED;
 
 #endif
 
@@ -263,9 +263,9 @@ extern _X_EXPORT char *Xstrdup(const char *s);
  */
 extern _X_EXPORT char *XNFstrdup(const char *s);
 
-extern _X_EXPORT char *Xprintf(const char *fmt, ...);
+extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va);
-extern _X_EXPORT char *XNFprintf(const char *fmt, ...);
+extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va);
 
 typedef void (*OsSigHandlerPtr)(int /* sig */);
@@ -299,7 +299,7 @@ extern _X_EXPORT void OsBlockSignals (void);
 
 extern _X_EXPORT void OsReleaseSignals (void);
 
-extern _X_EXPORT void OsAbort (void) X_NORETURN;
+extern _X_EXPORT void OsAbort (void) _X_NORETURN;
 
 #if !defined(WIN32)
 extern _X_EXPORT int System(char *);
@@ -525,29 +525,21 @@ typedef enum {
     X_UNKNOWN = -1		/* unknown -- this must always be last */
 } MessageType;
 
-/* XXX Need to check which GCC versions have the format(printf) attribute. */
-#if defined(__GNUC__) && (__GNUC__ > 2)
-#define _printf_attribute(a,b) __attribute((format(__printf__,a,b)))
-#else
-#define _printf_attribute(a,b) /**/
-#endif
-
 extern _X_EXPORT const char *LogInit(const char *fname, const char *backup);
 extern _X_EXPORT void LogClose(void);
 extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value);
 extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args);
-extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _printf_attribute(2,3);
+extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
 extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format,
 			    va_list args);
 extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format,
-			   ...) _printf_attribute(3,4);
+			   ...) _X_ATTRIBUTE_PRINTF(3,4);
 extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...)
-			_printf_attribute(2,3);
+			_X_ATTRIBUTE_PRINTF(2,3);
 extern _X_EXPORT void FreeAuditTimer(void);
-extern _X_EXPORT void AuditF(const char *f, ...) _printf_attribute(1,2);
+extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern _X_EXPORT void VAuditF(const char *f, va_list args);
-extern _X_EXPORT void FatalError(const char *f, ...) _printf_attribute(1,2)
-    X_NORETURN;
+extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
 
 #ifdef DEBUG
 #define DebugF ErrorF
@@ -556,7 +548,7 @@ extern _X_EXPORT void FatalError(const char *f, ...) _printf_attribute(1,2)
 #endif
 
 extern _X_EXPORT void VErrorF(const char *f, va_list args);
-extern _X_EXPORT void ErrorF(const char *f, ...) _printf_attribute(1,2);
+extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern _X_EXPORT void Error(char *str);
 extern _X_EXPORT void LogPrintMarkers(void);
 
diff --git a/include/resource.h b/include/resource.h
index 56450d6..96f852a 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -256,24 +256,24 @@ extern _X_EXPORT pointer SecurityLookupIDByType(
     ClientPtr client,
     XID id,
     RESTYPE rtype,
-    Mask access_mode) X_DEPRECATED;
+    Mask access_mode) _X_DEPRECATED;
 
 /* replaced by dixLookupResourceByClass */
 extern _X_EXPORT pointer SecurityLookupIDByClass(
     ClientPtr client,
     XID id,
     RESTYPE classes,
-    Mask access_mode) X_DEPRECATED;
+    Mask access_mode) _X_DEPRECATED;
 
 /* replaced by dixLookupResourceByType */
 extern _X_EXPORT pointer LookupIDByType(
     XID id,
-    RESTYPE rtype) X_DEPRECATED;
+    RESTYPE rtype) _X_DEPRECATED;
 
 /* replaced by dixLookupResourceByClass */
 extern _X_EXPORT pointer LookupIDByClass(
     XID id,
-    RESTYPE classes) X_DEPRECATED;
+    RESTYPE classes) _X_DEPRECATED;
 
 #endif /* RESOURCE_H */
 
diff --git a/os/log.c b/os/log.c
index 0781659..ce43319 100644
--- a/os/log.c
+++ b/os/log.c
@@ -403,7 +403,7 @@ LogMessage(MessageType type, const char *format, ...)
 }
 
 void
-AbortServer(void) X_NORETURN;
+AbortServer(void) _X_NORETURN;
 
 void
 AbortServer(void)


More information about the Xquartz-changes mailing list