[Xquartz-changes] xserver: Branch 'server-1.12-apple' - 43 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Thu Sep 22 19:38:00 PDT 2011


Rebased ref, commits from common ancestor:
commit 573ce0278fca773f426a2f799bfeaf7f22df3c39
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 eaa21ad..e65a1c0 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2049,11 +2049,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 d1fd0cb..d2986c8 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -50,24 +50,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);
     if (pMask)
 	miCompositeSourceValidate (pMask);
     
-    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);
     }
 
@@ -146,22 +141,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 (
 	(pixman_format_code_t)pict->format,
-	pixmap->drawable.width, pixmap->drawable.height,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -187,55 +182,33 @@ 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 pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map);
+image_from_pict_internal (PicturePtr pict, Bool has_clip, Bool is_alpha_map);
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool is_alpha_map)
 {
     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)
@@ -265,8 +238,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
      */
     if (pict->alphaMap && !is_alpha_map)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE);
+	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -299,7 +271,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 static pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+image_from_pict_internal (PicturePtr pict,
+		 Bool has_clip, Bool is_alpha_map)
 {
     pixman_image_t *image = NULL;
 
@@ -308,7 +281,7 @@ image_from_pict_internal (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)
     {
@@ -329,19 +302,18 @@ image_from_pict_internal (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, is_alpha_map);
+	set_image_properties (image, pict, is_alpha_map);
     
     return image;
 }
 
 pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict, Bool has_clip)
 {
-    return image_from_pict_internal (pict, has_clip, xoff, yoff, FALSE);
+    return image_from_pict_internal (pict, has_clip, FALSE);
 }
 
 void
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 0b5a638..fbe2647 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -39,12 +39,11 @@ fbAddTraps (PicturePtr	pPicture,
 	    xTrap	*traps)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
     
-    pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
+    pixman_add_traps (image, x_off, y_off,
 		      ntrap, (pixman_trap_t *)traps);
 
     free_pixman_pict (pPicture, image);
@@ -57,14 +56,13 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    y_off)
 {
     pixman_image_t *image;
-    int	dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
 
     pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
-				x_off + dst_xoff,
-				y_off + dst_yoff);
+				x_off,
+				y_off);
 
     free_pixman_pict (pPicture, image);
 }
@@ -77,13 +75,12 @@ fbAddTriangles (PicturePtr  pPicture,
 		xTriangle *tris)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
     
     pixman_add_triangles (image,
-			  dst_xoff + x_off, dst_yoff + y_off,
+			  x_off, y_off,
 			  ntri, (pixman_triangle_t *)tris);
 
     free_pixman_pict (pPicture, image);
@@ -110,13 +107,11 @@ fbShapes (CompositeShapesFunc	composite,
 	  const uint8_t *	shapes)
 {
     pixman_image_t *src, *dst;
-    int src_xoff, src_yoff;
-    int dst_xoff, dst_yoff;
 
     miCompositeSourceValidate (pSrc);
 
-    src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-    dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, FALSE);
+    dst = image_from_pict (pDst, TRUE);
 
     if (src && dst)
     {
@@ -136,10 +131,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    for (i = 0; i < nshapes; ++i)
 	    {
 		composite (op, src, dst, format,
-			   xSrc + src_xoff,
-			   ySrc + src_yoff,
-			   dst_xoff,
-			   dst_yoff,
+			   xSrc,
+			   ySrc,
+			   0,
+			   0,
 			   1, shapes + i * shape_size);
 	    }
 	}
@@ -162,10 +157,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    }
 	    
 	    composite (op, src, dst, format,
-		       xSrc + src_xoff,
-		       ySrc + src_yoff,
-		       dst_xoff,
-		       dst_yoff,
+		       xSrc,
+		       ySrc,
+		       0,
+		       0,
 		       nshapes, shapes);
 	}
 
commit 7985a248f96bd96182413ea1668ab7dbd2639c8e
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 0f1ebe5..dcbfe1c 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -521,6 +521,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
@@ -548,24 +549,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;
 
@@ -591,6 +605,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;
 	
@@ -599,6 +625,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;
@@ -661,6 +693,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 = RegionNumRects(prgn);
     pbox = RegionRects(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit e9cc24fe12e7c0806a1f1c6461a3bf24d8062d42
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 811435d..1f3476b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,12 @@ XORG_PROG_RAWCPP
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit e66e1d42f060199eb1b9e643d3556c98e44860e2
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Sep 14 13:45:18 2011 -0500

    xorg-server.pc.in: Remove libpciaccess and pixman-1 from Requires
    
    Every module building against xorg-server does not *Require* pixman nor
    libpciaccess.  If such modules need pixman or pciaccess, they should be
    depending on them directly rather than inheriting a dependency from
    xorg-server.  To do this, they should use PKG_CHECK_MODULES in configure.ac
    to check for pixman-1 or pciaccess and include the apporpriate _LIBS variable
    to the appropriate _LDFLAGS variable in Makefile.am
    
    This also moves pixman-1 to Requires.private, so CPPFLAGS is set right to
    to satisfy include dependencies but avoid linking needlessly.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/configure.ac b/configure.ac
index deccd78..811435d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -783,11 +783,6 @@ VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
 WINDOWSWMPROTO="windowswmproto"
 APPLEWMPROTO="applewmproto >= 1.4"
 
-dnl Core modules for most extensions, et al.
-SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
-# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
-AC_SUBST(SDK_REQUIRED_MODULES)
-
 dnl List of libraries that require a specific version
 LIBAPPLEWM="applewm >= 1.4"
 LIBDMX="dmx >= 1.0.99.1"
@@ -809,6 +804,11 @@ dnl specific modules against it
 PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN)
 REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau"
 
+dnl Core modules for most extensions, et al.
+SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto $LIBPIXMAN"
+# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
+AC_SUBST(SDK_REQUIRED_MODULES)
+
 REQUIRED_MODULES="[fixesproto >= 5.0] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES"
 
 if test "x$CONFIG_UDEV" = xyes &&
@@ -1559,6 +1559,7 @@ if test "x$XORG" = xyes; then
 	if test "x$PCI" = xyes; then
 
 	PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
+	SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
 	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index fb238b5..a98eca8 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -15,7 +15,6 @@ abi_extension=@abi_extension@
 Name: xorg-server
 Description: Modular X.Org X Server
 Version: @PACKAGE_VERSION@
-Requires: pixman-1 pciaccess
 Requires.private: @SDK_REQUIRED_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
 Libs: -L${libdir}
commit 772432ef276b966bdb16196abc49a135092257c1
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Sep 14 10:37:38 2011 -0500

    darwin: configure: Force some irrelevant options to off on darwin
    
    This removes the need to pass the following to configure on darwin:
    --disable-pciaccess -disable-int10-module --disable-vbe --disable-vgahw --disable-libdrm
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index e72dffc..deccd78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -718,6 +718,11 @@ case $host_os in
 		XV=no
 		;;
 	darwin*)
+		PCI=no
+		INT10MODULE=no
+		VGAHW=no
+		VBE=no
+		DRM=no
 		DRI2=no
 
 		if test x$XQUARTZ = xauto; then
commit 22c661af07dc55df4ddf058623eaeda256c631dc
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Sep 14 15:42:19 2011 -0500

    xfree86: Link modules with -module
    
    This makes a difference on darwin (and apparently nowhere else)
    
    https://www.gnu.org/s/libtool/manual/libtool.html#Modules-for-libltdl
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 1a162ab..b6eb54f 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -30,21 +30,21 @@ INCLUDES = @XORG_INCS@ \
            -I$(top_srcdir)/miext/shadow \
            -I$(top_srcdir)/glx
 
-libdbe_la_LDFLAGS = -avoid-version
+libdbe_la_LDFLAGS = -module -avoid-version
 libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la
 libdbe_la_SOURCES = dbemodule.c
 
-libfb_la_LDFLAGS = -avoid-version
+libfb_la_LDFLAGS = -module -avoid-version
 libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
 libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libfb_la_CFLAGS = $(AM_CFLAGS)
 
-libwfb_la_LDFLAGS = -avoid-version
+libwfb_la_LDFLAGS = -module -avoid-version
 libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
 libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
 
-libglx_la_LDFLAGS = -avoid-version
+libglx_la_LDFLAGS = -module -avoid-version
 if AIGLX_DRI_LOADER
 GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la
 endif
@@ -53,11 +53,11 @@ libglx_la_LIBADD = \
 	$(GLXDRI_LIBRARY)
 libglx_la_SOURCES = glxmodule.c
 
-librecord_la_LDFLAGS = -avoid-version
+librecord_la_LDFLAGS = -module -avoid-version
 librecord_la_LIBADD = $(top_builddir)/record/librecord.la
 librecord_la_SOURCES = recordmod.c
 
-libshadow_la_LDFLAGS = -avoid-version
+libshadow_la_LDFLAGS = -module -avoid-version
 libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la
 libshadow_la_SOURCES = shmodule.c
 
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
index cce19f7..87c28a4 100644
--- a/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/hw/xfree86/dixmods/extmod/Makefile.am
@@ -21,7 +21,7 @@ INCLUDES = @XORG_INCS@ \
            -I$(top_srcdir)/hw/xfree86/loader \
            -I$(top_srcdir)/miext/shadow
 
-libextmod_la_LDFLAGS = -avoid-version
+libextmod_la_LDFLAGS = -module -avoid-version
 libextmod_la_SOURCES = modinit.c \
                        modinit.h \
                        $(DGA_SRCS) \
diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am
index 39f7a90..3ced531 100644
--- a/hw/xfree86/exa/Makefile.am
+++ b/hw/xfree86/exa/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libexa.la
 
-libexa_la_LDFLAGS = -avoid-version
+libexa_la_LDFLAGS = -module -avoid-version
 
 INCLUDES = \
 	$(XORG_INCS) \
diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am
index 2a03890..4472acd 100644
--- a/hw/xfree86/fbdevhw/Makefile.am
+++ b/hw/xfree86/fbdevhw/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libfbdevhw.la
 
-libfbdevhw_la_LDFLAGS = -avoid-version
+libfbdevhw_la_LDFLAGS = -module -avoid-version
 
 if FBDEVHW
 libfbdevhw_la_SOURCES = fbdevhw.c
diff --git a/hw/xfree86/shadowfb/Makefile.am b/hw/xfree86/shadowfb/Makefile.am
index 02d2dd4..39c6610 100644
--- a/hw/xfree86/shadowfb/Makefile.am
+++ b/hw/xfree86/shadowfb/Makefile.am
@@ -1,5 +1,5 @@
 module_LTLIBRARIES = libshadowfb.la
-libshadowfb_la_LDFLAGS = -avoid-version
+libshadowfb_la_LDFLAGS = -module -avoid-version
 libshadowfb_la_SOURCES = sfbmodule.c shadow.c
 
 sdk_HEADERS = shadowfb.h
diff --git a/hw/xfree86/vbe/Makefile.am b/hw/xfree86/vbe/Makefile.am
index 85c6fd8..4b794e6 100644
--- a/hw/xfree86/vbe/Makefile.am
+++ b/hw/xfree86/vbe/Makefile.am
@@ -1,5 +1,5 @@
 module_LTLIBRARIES = libvbe.la
-libvbe_la_LDFLAGS = -avoid-version
+libvbe_la_LDFLAGS = -module -avoid-version
 libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c
 
 sdk_HEADERS = vbe.h vbeModes.h
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
index 5bfb4e9..7ebe0b9 100644
--- a/hw/xfree86/xaa/Makefile.am
+++ b/hw/xfree86/xaa/Makefile.am
@@ -8,7 +8,7 @@ MSB_FIXED = mf-xaaBitmap.c mf-xaaStipple.c mf-xaaTEGlyph.c
 MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c
 POLYSEG = s-xaaLine.c s-xaaDashLine.c
 
-libxaa_la_LDFLAGS = -avoid-version
+libxaa_la_LDFLAGS = -module -avoid-version
 if COMPOSITE
 libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
 endif
commit 3dda20d51211776acfe68c933022abf90a121d40
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Sep 14 12:14:56 2011 -0500

    xfree86: fbdevhw: Remove unused include of pciaccess.h
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index bc46b9c..34870c2 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -5,8 +5,6 @@
 #include "xf86str.h"
 #include "colormapst.h"
 
-#include <pciaccess.h>
-
 #define FBDEVHW_PACKED_PIXELS		0	/* Packed Pixels	*/
 #define FBDEVHW_PLANES			1	/* Non interleaved planes */
 #define FBDEVHW_INTERLEAVED_PLANES	2	/* Interleaved planes	*/
commit 21944bde7101e98a512fb7f48a125b4050ebadba
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Tue Jun 1 13:05:47 2010 +0300

    configure: wrap PCI code with macro and set it at build time
    
    --disable-pciaccess, used together with --disable-module-int10, can be used to
    disable all pci code inside the server.
    
    Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and
    now it defines also whether the library is used inside the server. Also,
    XORG_BUS_PCI automake variable is introduced to track PCI code needs.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Built-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 0c0d4c5..e72dffc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -637,6 +637,7 @@ AC_ARG_ENABLE(int10-module,     AS_HELP_STRING([--enable-int10-module], [Build X
 AC_ARG_ENABLE(windowswm,      AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
 AC_ARG_ENABLE(libdrm,         AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
 AC_ARG_ENABLE(clientids,      AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
+AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
 
 dnl DDXes.
 AC_ARG_ENABLE(xorg,    	      AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
@@ -1549,6 +1550,9 @@ if test "x$XORG" = xyes; then
 	xorg_bus_bsdpci=no
 	xorg_bus_sparc=no
 
+	AC_MSG_CHECKING([whether to build Xorg PCI functions])
+	if test "x$PCI" = xyes; then
+
 	PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
 	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
@@ -1568,6 +1572,10 @@ if test "x$XORG" = xyes; then
         xorg_bus_sparc="yes"
         ;;
 	esac
+	fi
+	AC_MSG_RESULT([$PCI])
+
+	AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes])
 	AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
 	AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
 	AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index c031d4b..f634b2c 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -1,5 +1,10 @@
 noinst_LTLIBRARIES = libcommon.la
 
+if XORG_BUS_PCI
+PCI_SOURCES = xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \
+              xf86VGAarbiterPriv.h
+endif
+
 if XORG_BUS_SPARC
 SBUS_SOURCES = xf86sbusBus.c
 endif
@@ -19,7 +24,7 @@ endif
 
 RANDRSOURCES = xf86RandR.c
 
-BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
+BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES)
 
 MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
 
@@ -33,7 +38,7 @@ AM_LDFLAGS = -r
 libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
                       xf86Cursor.c $(DGASOURCES) xf86DPMS.c \
                       xf86Events.c xf86Globals.c xf86AutoConfig.c \
-                      xf86Option.c xf86Init.c xf86VGAarbiter.c \
+                      xf86Option.c xf86Init.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
                       xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
                       xf86Mode.c xorgHelper.c \
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index b1a5ab2..e9e218f 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -92,6 +92,7 @@ extern _X_EXPORT Bool VTSwitchEnabled;	/* kbd driver */
 #ifndef _NO_XF86_PROTOTYPES
 
 /* PCI related */
+#ifdef XSERVER_LIBPCIACCESS
 #include <pciaccess.h>
 extern _X_EXPORT Bool pciSlotClaimed;
 
@@ -118,6 +119,15 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
 extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
         int entityIndex,PciChipsets *p_chip, void *dummy, EntityProc init,
         EntityProc enter, EntityProc leave, pointer private);
+#else
+#define xf86VGAarbiterInit() do {} while (0)
+#define xf86VGAarbiterFini() do {} while (0)
+#define xf86VGAarbiterLock(x) do {} while (0)
+#define xf86VGAarbiterUnlock(x) do {} while (0)
+#define xf86VGAarbiterScrnInit(x) do {} while (0)
+#define xf86VGAarbiterDeviceDecodes() do {} while (0)
+#define xf86VGAarbiterWrapFunctions() do {} while (0)
+#endif
 
 /* xf86Bus.c */
 
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 5c6e721..7fc6518 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -255,9 +255,9 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
 	    matches[i++] = xnfstrdup(sbusDriver);
     }
 #endif
-
+#ifdef XSERVER_LIBPCIACCESS
     i = xf86PciMatchDriver(matches, nmatches);
-
+#endif
     /* Fallback to platform default hardware */
     if (i < (nmatches - 1)) {
 #if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 8749a29..c665a20 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -47,8 +47,9 @@
 
 #define XF86_OS_PRIVS
 #include "xf86_OSproc.h"
+#ifdef XSERVER_LIBPCIACCESS
 #include "xf86VGAarbiter.h"
-
+#endif
 /* Entity data */
 EntityPtr *xf86Entities = NULL;	/* Bus slots claimed by drivers */
 int xf86NumEntities = 0;
@@ -75,7 +76,7 @@ Bool
 xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
 {
     Bool     foundScreen = FALSE;
-
+#ifdef XSERVER_LIBPCIACCESS
     if (drv->PciProbe != NULL) {
         if (xf86DoConfigure && xf86DoConfigurePass1) {
             assert(detect_only);
@@ -86,7 +87,7 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
             foundScreen = xf86PciProbeDev(drv);
         }
     }
-
+#endif
     if (!foundScreen && (drv->Probe != NULL)) {
         xf86Msg( X_WARNING, "Falling back to old probe method for %s\n",
                              drv->driverName);
@@ -195,7 +196,9 @@ xf86BusConfig(void)
 void
 xf86BusProbe(void)
 {
+#ifdef XSERVER_LIBPCIACCESS
     xf86PciProbe();
+#endif
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
     xf86SbusProbe();
 #endif
@@ -504,9 +507,14 @@ xf86PostProbe(void)
 {
     int i;
 
-    if (fbSlotClaimed && (pciSlotClaimed
+    if (fbSlotClaimed && (
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
-	    || sbusSlotClaimed
+	    sbusSlotClaimed ||
+#endif
+#ifdef XSERVER_LIBPCIACCESS
+	    pciSlotClaimed
+#else
+        TRUE
 #endif
 	    ))
 	    FatalError("Cannot run in framebuffer mode. Please specify busIDs "
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3aa923a..a086a48 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2450,7 +2450,7 @@ xf86HandleConfigFile(Bool autoconfig)
     }
 
     xf86ProcessOptions(-1, xf86ConfigLayout.options, LayoutOptions);
-
+#ifdef XSERVER_LIBPCIACCESS
     if ((scanptr = xf86GetOptValString(LayoutOptions, LAYOUT_ISOLATEDEVICE))) {
        ; /* IsolateDevice specified; overrides SingleCard */
     } else {
@@ -2465,7 +2465,7 @@ xf86HandleConfigFile(Bool autoconfig)
        } else
            xf86PciIsolateDevice(scanptr);
     }
-
+#endif
     /* Now process everything else */
     if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
              ErrorF ("Problem when converting the config data structures\n");
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index ab07515..99b8b48 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -87,9 +87,11 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
     /* Check for duplicates */
     for (i = 0;  i < nDevToConfig;  i++) {
         switch (bus) {
+#ifdef XSERVER_LIBPCIACCESS
             case BUS_PCI:
                 ret = xf86PciConfigure(busData, DevToConfig[i].pVideo);
-                break;
+	            break;
+#endif
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
             case BUS_SBUS:
                 ret = xf86SbusConfigure(busData, DevToConfig[i].sVideo);
@@ -118,10 +120,12 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
     for (j = 0;  (DevToConfig[i].GDev.driver[j] = tolower(driver[j]));  j++);
 
     switch (bus) {
+#ifdef XSERVER_LIBPCIACCESS
         case BUS_PCI:
             xf86PciConfigureNewDev(busData, DevToConfig[i].pVideo,
                                    &DevToConfig[i].GDev, &chipset);
 	        break;
+#endif
 #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
         case BUS_SBUS:
             xf86SbusConfigureNewDev(busData, DevToConfig[i].sVideo,
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index cd025dc..613c7cf 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -42,8 +42,9 @@
 #include <X11/extensions/dpmsconst.h>
 #include "dpmsproc.h"
 #endif
+#ifdef XSERVER_LIBPCIACCESS
 #include "xf86VGAarbiter.h"
-
+#endif
 
 #ifdef DPMSExtension
 static DevPrivateKeyRec DPMSKeyRec;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 93ea333..9efa113 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -78,7 +78,9 @@
 #include "picturestr.h"
 
 #include "xf86Bus.h"
+#ifdef XSERVER_LIBPCIACCESS
 #include "xf86VGAarbiter.h"
+#endif
 #include "globals.h"
 
 #ifdef DPMSExtension
@@ -87,7 +89,6 @@
 #endif
 #include <hotplug.h>
 
-
 #ifdef XF86PM
 void (*xf86OSPMClose)(void) = NULL;
 #endif
@@ -1337,6 +1338,7 @@ ddxProcessArgument(int argc, char **argv, int i)
     xf86DoShowOptions = TRUE;
     return 1;
   }
+#ifdef XSERVER_LIBPCIACCESS
   if (!strcmp(argv[i], "-isolateDevice"))
   {
     CHECK_FOR_REQUIRED_ARGUMENT();
@@ -1346,6 +1348,7 @@ ddxProcessArgument(int argc, char **argv, int i)
     xf86PciIsolateDevice(argv[i]);
     return 2;
   }
+#endif
   /* Notice cmdline xkbdir, but pass to dix as well */
   if (!strcmp(argv[i], "-xkbdir"))
   {
@@ -1414,7 +1417,9 @@ ddxUseMsg(void)
 #endif
   ErrorF("-allowMouseOpenFail    start server even if the mouse can't be initialized\n");
   ErrorF("-ignoreABI             make module ABI mismatches non-fatal\n");
+#ifdef XSERVER_LIBPCIACCESS
   ErrorF("-isolateDevice bus_id  restrict device resets to bus_id (PCI only)\n");
+#endif
   ErrorF("-version               show the server version\n");
   ErrorF("-showDefaultModulePath show the server default module path\n");
   ErrorF("-showDefaultLibPath    show the server default library path\n");
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
index 059e378..4592980 100644
--- a/hw/xfree86/common/xf86fbBus.c
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -54,8 +54,10 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
     EntityPtr p;
     int num;
 
+#ifdef XSERVER_LIBPCIACCESS
     if (pciSlotClaimed)
 	return -1;
+#endif
 #if defined(__sparc__) || defined (__sparc64__)
     if (sbusSlotClaimed)
 	return -1;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 43e9d1d..e2ca558 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -41,9 +41,6 @@
 #include "colormapst.h"
 #include "xf86Module.h"
 #include "xf86Opt.h"
-#include "xf86Pci.h"
-
-#include <pciaccess.h>
 
 /**
  * Integer type that is of the size of the addressable memory (machine size).
@@ -309,6 +306,8 @@ typedef struct {
 struct _SymTabRec;
 struct _PciChipsets;
 
+struct pci_device;
+
 typedef struct _DriverRec {
     int			driverVersion;
     char *		driverName;
@@ -350,8 +349,6 @@ typedef enum {
     BUS_last    /* Keep last */
 } BusType;
 
-struct pci_device;
-
 typedef struct {
     int		fbNum;
 } SbusBusId;
diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index 16c1021..e09d4d2 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -1,7 +1,10 @@
 noinst_LTLIBRARIES = libbus.la
 sdk_HEADERS = xf86Pci.h
 
-PCI_SOURCES = Pci.c Pci.h
+PCI_SOURCES =
+if XORG_BUS_PCI
+PCI_SOURCES += Pci.c Pci.h
+endif
 
 if XORG_BUS_BSDPCI
 PCI_SOURCES += bsd_pci.c
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 18bb735..19795d5 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -118,14 +118,16 @@ cat > sdksyms.c << EOF
 #include "xf86.h"
 #include "xf86Module.h"
 #include "xf86Opt.h"
-#include "xf86PciInfo.h"
+#ifdef XSERVER_LIBPCIACCESS
+ #include "xf86PciInfo.h"
+ #include "xf86VGAarbiter.h"
+#endif
 #include "xf86Priv.h"
 #include "xf86Privstr.h"
 #include "xf86cmap.h"
 #include "xf86fbman.h"
 #include "xf86str.h"
 #include "xf86Xinput.h"
-#include "xf86VGAarbiter.h"
 #include "xisb.h"
 #if XV
 # include "xf86xv.h"
@@ -170,7 +172,9 @@ cat > sdksyms.c << EOF
 
 
 /* hw/xfree86/os-support/bus/Makefile.am */
-#include "xf86Pci.h"
+#ifdef XSERVER_LIBPCIACCESS
+# include "xf86Pci.h"
+#endif
 #if defined(__sparc__) || defined(__sparc)
 # include "xf86Sbus.h"
 #endif
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 33bf908..6b9230f 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -127,4 +127,7 @@
 /* Build with libdrm support */
 #undef WITH_LIBDRM
 
+/* Use libpciaccess */
+#undef XSERVER_LIBPCIACCESS
+
 #endif /* _XORG_CONFIG_H_ */
commit 7337c32779ca7a6b9ba1143d7ec340fbe48ffd61
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Mon May 31 19:27:07 2010 +0300

    configure: make PCI configuration more sane
    
    No semantical changes. Just moved code around, grouping PCI related stuff in a
    single chunk.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Built-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 7efc4c6..0c0d4c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1245,7 +1245,6 @@ if test "x$XDMAUTH" = xyes; then
 fi
 
 AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
-AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
 AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
 AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
 dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
@@ -1496,9 +1495,6 @@ if test "x$XORG" = xauto; then
 fi
 AC_MSG_RESULT([$XORG])
 
-xorg_bus_bsdpci=no
-xorg_bus_sparc=no
-
 if test "x$XORG" = xyes; then
 	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
@@ -1546,10 +1542,39 @@ if test "x$XORG" = xyes; then
 	AC_SUBST([symbol_visibility])
 	dnl ===================================================================
 
+	dnl ===================================================================
+	dnl ================= beginning of PCI configuration ==================
+	dnl ===================================================================
+	xorg_bus_linuxpci=no
+	xorg_bus_bsdpci=no
+	xorg_bus_sparc=no
+
 	PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
 	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
+	AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
+	AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
+    case $host_os in
+      linux*)
+		xorg_bus_linuxpci="yes"
+		;;
+	  gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
+		xorg_bus_bsdpci="yes"
+		;;
+	esac
+    case $host_cpu in
+      sparc*)
+        xorg_bus_sparc="yes"
+        ;;
+	esac
+	AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
+	AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
+	AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
+	dnl ===================================================================
+	dnl ==================== end of PCI configuration =====================
+	dnl ===================================================================
+
 	case $host_os in
 	  linux*)
 		if test "x$LNXAPM" = xyes; then
@@ -1570,11 +1595,9 @@ if test "x$XORG" = xyes; then
 		;;
 	  freebsd* | kfreebsd*-gnu | dragonfly*)
 		XORG_OS_SUBDIR="bsd"
-		xorg_bus_bsdpci="yes"
 		;;
 	  netbsd*)
 		XORG_OS_SUBDIR="bsd"
-		xorg_bus_bsdpci="yes"
 		;;
 	  openbsd*)
 		if test "x$ac_cv_BSD_APM" = xyes \
@@ -1582,14 +1605,10 @@ if test "x$XORG" = xyes; then
 			XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
 		fi
 		XORG_OS_SUBDIR="bsd"
-		xorg_bus_bsdpci="yes"
 		;;
 	  solaris*)
 		XORG_OS_SUBDIR="solaris"
 		XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
-		# Use the same stubs as BSD for old functions, since we now
-		# use libpciaccess for PCI
-		xorg_bus_bsdpci="yes"
 		AC_CHECK_HEADERS([sys/kd.h])
 		AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no])
 		# Check for minimum supported release
@@ -1634,9 +1653,6 @@ if test "x$XORG" = xyes; then
 		;;
 	  gnu*)
 		XORG_OS_SUBDIR="hurd"
-		# Use the same stubs as BSD for old functions, since we now
-		# use libpciaccess for PCI
-		xorg_bus_bsdpci="yes"
 		;;
 	  *)
 		XORG_OS_SUBDIR="stub"
@@ -1649,9 +1665,6 @@ if test "x$XORG" = xyes; then
 	esac
 
 	case $host_cpu in
-	  sparc*)
-		xorg_bus_sparc="yes"
-		;;
 	  i*86)
 		;;
 	esac
@@ -1708,7 +1721,6 @@ if test "x$XORG" = xyes; then
 	AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
 	AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
 	AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
-	AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
 	if test "x$VGAHW" = xyes; then
 		AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module])
 	fi
@@ -1738,8 +1750,6 @@ if test "x$XORG" = xyes; then
 	AC_SUBST([abi_extension])
 fi
 AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
-AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
-AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
 AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
 AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
 AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
commit 7f6e46f9a3f054309a57cc0dbbd336a39c0ddac3
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Mon May 31 18:50:50 2010 +0300

    configure: change PCI function checking by a meaningful version of the library
    
    Version 0.10.7 of libpciaccess contains all functions being checked by
    autoconf, so use it instead.
    
    People that don't want VGA arbiter active can go to the library and enable the
    stubs there.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Built-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index d22bd4e..7efc4c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -792,7 +792,7 @@ LIBXEXT="xext >= 1.0.99.4"
 LIBXFONT="xfont >= 1.4.2"
 LIBXI="xi >= 1.2.99.1"
 LIBXTST="xtst >= 1.0.99.2"
-LIBPCIACCESS="pciaccess >= 0.8.0"
+LIBPCIACCESS="pciaccess >= 0.10.7"
 LIBUDEV="libudev >= 143"
 LIBSELINUX="libselinux >= 2.0.86"
 LIBDBUS="dbus-1 >= 1.0"
@@ -1547,16 +1547,6 @@ if test "x$XORG" = xyes; then
 	dnl ===================================================================
 
 	PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
-	SAVE_LIBS=$LIBS
-	SAVE_CFLAGS=$CFLAGS
-	CFLAGS=$PCIACCESS_CFLAGS
-	LIBS=$PCIACCESS_LIBS
-	AC_CHECK_FUNCS([pci_system_init_dev_mem])
-	AC_CHECK_FUNCS([pci_device_enable])
-	AC_CHECK_FUNCS([pci_device_is_boot_vga])
-	AC_CHECK_FUNCS([pci_device_vgaarb_init])
-	LIBS=$SAVE_LIBS
-	CFLAGS=$SAVE_CFLAGS
 	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 215e845..819ad6e 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -31,8 +31,6 @@
 #include "xorg-config.h"
 
 #include "xf86VGAarbiter.h"
-
-#ifdef HAVE_PCI_DEVICE_VGAARB_INIT
 #include "xf86VGAarbiterPriv.h"
 #include "xf86Bus.h"
 #include "xf86Priv.h"
@@ -1112,16 +1110,3 @@ VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRe
     VGAPut();
     PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects);
 }
-#else
-/* dummy functions */
-void xf86VGAarbiterInit(void) {}
-void xf86VGAarbiterFini(void) {}
-
-void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {}
-void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
-Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { return TRUE; }
-void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
-void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc) {}
-Bool xf86VGAarbiterWrapFunctions(void) { return FALSE; }
-
-#endif
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 2acf486..eb5323c 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -121,12 +121,10 @@ xf86PciProbe(void)
 	    xf86PciVideoInfo[num - 1] = info;
 
 	    pci_device_probe(info);
-#ifdef HAVE_PCI_DEVICE_IS_BOOT_VGA
 	    if (pci_device_is_boot_vga(info)) {
                 primaryBus.type = BUS_PCI;
                 primaryBus.id.pci = info;
             }
-#endif
 	    info->user_data = 0;
 	}
     }
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7b4cea7..d54656f 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -175,10 +175,8 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 	checkDevMem(TRUE);
 	pVidMem->linearSupported = useDevMem;
 
-#if HAVE_PCI_SYSTEM_INIT_DEV_MEM
 	if (useDevMem)
 		pci_system_init_dev_mem(devMemFd);
-#endif
 
 #ifdef HAS_MTRR_SUPPORT
 	if (useDevMem) {
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
index 2965b37..564447f 100644
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -261,10 +261,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
 	    struct pci_device *rom_device =
 		xf86GetPciInfoForEntity(pInt->entityIndex);
 
-#if HAVE_PCI_DEVICE_ENABLE
 	    pci_device_enable(rom_device);
-#endif
-
 	    err = pci_device_read_rom(rom_device, (unsigned char *)(V_BIOS));
 	    if (err) {
 		xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (%s)\n",
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 0d1ea91..33bf908 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -118,18 +118,6 @@
 /* Have execinfo.h */
 #undef HAVE_EXECINFO_H
 
-/* Have pci_system_init_dev_mem() */
-#undef HAVE_PCI_SYSTEM_INIT_DEV_MEM
-
-/* Define to 1 if you have the `pci_device_is_boot_vga' function. */
-#undef HAVE_PCI_DEVICE_IS_BOOT_VGA
-
-/* Have pci_enable_device */
-#undef HAVE_PCI_DEVICE_ENABLE
-
-/* Define to 1 if you have the `pci_device_vgaarb_init' function. */
-#undef HAVE_PCI_DEVICE_VGAARB_INIT
-
 /* Path to text files containing PCI IDs */
 #undef PCI_TXT_IDS_PATH
 
commit e3c8db13e9c92cc98ad3bd638cd0f81e20a642ce
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Sep 13 15:32:16 2011 -0500

    xfree86: Work around issue where ar may be told to make an archive with no contents
    
    Automake:
    
     "Be careful when selecting library components conditionally. Because building
     an empty library is not portable, you should ensure that any library
     always contains at least one object."
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index b1ca8f9..16c1021 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -12,7 +12,7 @@ PLATFORM_SOURCES = Sbus.c
 sdk_HEADERS += xf86Sbus.h
 endif
 
-libbus_la_SOURCES = $(PCI_SOURCES) $(PLATFORM_SOURCES)
+libbus_la_SOURCES = $(PCI_SOURCES) $(PLATFORM_SOURCES) nobus.c
 
 INCLUDES = $(XORG_INCS)
 
diff --git a/hw/xfree86/os-support/bus/nobus.c b/hw/xfree86/os-support/bus/nobus.c
new file mode 100644
index 0000000..ad23f52
--- /dev/null
+++ b/hw/xfree86/os-support/bus/nobus.c
@@ -0,0 +1 @@
+static void __noop_to_appease_ar__() { return; }
commit 5f5f8ea32598c4c18ac5828f2b5c8b8228c2645d
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Sep 13 15:38:45 2011 -0500

    xfree86: Add stubs for os-support to help adding new architecture support
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

diff --git a/configure.ac b/configure.ac
index 7232098..d22bd4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1649,8 +1649,8 @@ if test "x$XORG" = xyes; then
 		xorg_bus_bsdpci="yes"
 		;;
 	  *)
-		XORG_OS_SUBDIR="unknown"
-		AC_MSG_ERROR([m4_text_wrap(m4_join([ ],
+		XORG_OS_SUBDIR="stub"
+		AC_MSG_NOTICE([m4_text_wrap(m4_join([ ],
 		[Your OS is unknown. Xorg currently only supports Linux,],
 		[Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.],
 		[If you are interested in porting Xorg to your platform,],
@@ -2151,6 +2151,7 @@ hw/xfree86/os-support/hurd/Makefile
 hw/xfree86/os-support/misc/Makefile
 hw/xfree86/os-support/linux/Makefile
 hw/xfree86/os-support/solaris/Makefile
+hw/xfree86/os-support/stub/Makefile
 hw/xfree86/parser/Makefile
 hw/xfree86/ramdac/Makefile
 hw/xfree86/shadowfb/Makefile
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 094563d..a0140a1 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -1,5 +1,5 @@
 SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
-DIST_SUBDIRS = bsd bus misc linux solaris hurd
+DIST_SUBDIRS = bsd bus misc linux solaris stub hurd
 
 sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h
 
diff --git a/hw/xfree86/os-support/stub/Makefile.am b/hw/xfree86/os-support/stub/Makefile.am
new file mode 100644
index 0000000..a1156ef
--- /dev/null
+++ b/hw/xfree86/os-support/stub/Makefile.am
@@ -0,0 +1,19 @@
+noinst_LTLIBRARIES = libstub.la
+
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
+
+libstub_la_SOURCES = \
+	$(srcdir)/../shared/VTsw_noop.c \
+	$(srcdir)/../shared/agp_noop.c \
+	$(srcdir)/../shared/ioperm_noop.c \
+	$(srcdir)/../shared/kmod_noop.c \
+	$(srcdir)/../shared/pm_noop.c \
+	$(srcdir)/../shared/vidmem.c \
+	$(srcdir)/../shared/posix_tty.c \
+	$(srcdir)/../shared/sigio.c \
+	stub_bell.c \
+	stub_bios.c \
+	stub_init.c \
+	stub_video.c
diff --git a/hw/xfree86/os-support/stub/stub_bell.c b/hw/xfree86/os-support/stub/stub_bell.c
new file mode 100644
index 0000000..4862592
--- /dev/null
+++ b/hw/xfree86/os-support/stub/stub_bell.c
@@ -0,0 +1,10 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86_OSlib.h"
+
+void
+xf86OSRingBell(int loudness, int pitch, int duration)
+{
+}
diff --git a/hw/xfree86/os-support/stub/stub_bios.c b/hw/xfree86/os-support/stub/stub_bios.c
new file mode 100644
index 0000000..8628316
--- /dev/null
+++ b/hw/xfree86/os-support/stub/stub_bios.c
@@ -0,0 +1,12 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86_OSlib.h"
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+		int Len)
+{
+	return -1;
+}
diff --git a/hw/xfree86/os-support/stub/stub_init.c b/hw/xfree86/os-support/stub/stub_init.c
new file mode 100644
index 0000000..36fd2b8
--- /dev/null
+++ b/hw/xfree86/os-support/stub/stub_init.c
@@ -0,0 +1,26 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86_OSlib.h"
+
+void
+xf86OpenConsole()
+{
+}
+
+void
+xf86CloseConsole()
+{
+}
+
+int
+xf86ProcessArgument(int argc, char *argv[], int i)
+{
+	return 0;
+}
+
+void
+xf86UseMsg()
+{
+}
diff --git a/hw/xfree86/os-support/stub/stub_video.c b/hw/xfree86/os-support/stub/stub_video.c
new file mode 100644
index 0000000..3274968
--- /dev/null
+++ b/hw/xfree86/os-support/stub/stub_video.c
@@ -0,0 +1,13 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+	pVidMem->initialised = TRUE;
+	return;
+}
commit 57ec589f0190021bb06eb380718067b5c0ce4fb8
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 10 19:26:13 2011 -0400

    incomplete: Remove xf86{Un,}MapVidMem
    
    And man does a lot of support code just fall away when you do that.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index bb3a5cb..860bbd4 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -67,32 +67,6 @@ static unsigned long hae_mask;
 static unsigned long bus_base;
 static unsigned long sparse_size;
 
-static unsigned long
-memory_base(void)
-{
-    static unsigned long base = 0;
-
-    if (base == 0) {
-	size_t len = sizeof(base);
-	int error;
-#ifdef __OpenBSD__
-       int mib[3];
-
-       mib[0] = CTL_MACHDEP;
-       mib[1] = CPU_CHIPSET;
-       mib[2] = CPU_CHIPSET_MEM;
-
-       if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0)
-#else
-	if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
-				  0, 0)) < 0)
-#endif
-	    FatalError("xf86MapVidMem: can't find memory\n");
-    }
-
-    return base;
-}
-
 static int
 has_bwx(void)
 {
@@ -156,30 +130,9 @@ dense_base(void)
 	return abw[0].abw_abst.abst_sys_start;
 }
 
-static unsigned long
-memory_base(void)
-{
-	if (abw_count < 0)
-		init_abw();
-	
-	if (abw_count > 1) {
-		xf86Msg(X_INFO, "memory base = %#lx\n", 
-			abw[1].abw_abst.abst_sys_start); /* XXXX */
-		return abw[1].abw_abst.abst_sys_start;
-	} else if (abw_count == 1) {
-		/* assume memory_base == dense_base */
-		xf86Msg(X_INFO, "memory base = %#lx\n",
-			abw[0].abw_abst.abst_sys_start); /* XXXX */
-		return abw[0].abw_abst.abst_sys_start;
-	} else {
-		xf86Msg(X_INFO, "no memory base\n"); /* XXXX */
-		return 0;
-	}
-}
 #endif /* __NetBSD__ */
 
 #define BUS_BASE	dense_base()
-#define BUS_BASE_BWX	memory_base()
 
 /***************************************************************************/
 /* Video Memory Mapping section                                            */
@@ -199,11 +152,6 @@ static int  devMemFd = -1;
 #endif
 #define DEV_MEM "/dev/mem"
 
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
-static void unmapVidMemSparse(int, pointer, unsigned long);
-
 /*
  * Check if /dev/mem can be mmap'd.  If it can't print a warning when
  * "warn" is TRUE.
@@ -286,12 +234,8 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 
 	if (has_bwx()) {
 	    xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n");
-	    pVidMem->mapMem = mapVidMem;
-	    pVidMem->unmapMem = unmapVidMem;
 	} else {
 	    xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
-	    pVidMem->mapMem = mapVidMemSparse;
-	    pVidMem->unmapMem = unmapVidMemSparse;
 #ifndef __NetBSD__
 	    if (axpSystem == -1)
                 axpSystem = bsdGetAXP(); 
@@ -303,59 +247,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 	pVidMem->initialised = TRUE;
 }
 
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	pointer base;
-
-	checkDevMem(FALSE);
-	Base = Base & ((1L<<32) - 1);
-
-	if (useDevMem)
-	{
-	    if (devMemFd < 0) 
-	    {
-		FatalError("xf86MapVidMem: failed to open %s (%s)\n",
-			   DEV_MEM, strerror(errno));
-	    }
-	    base = mmap((caddr_t)0, Size,
-			(flags & VIDMEM_READONLY) ?
-			 PROT_READ : (PROT_READ | PROT_WRITE),
-			 MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
-	    if (base == MAP_FAILED)
-	    {
-		FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n",
-			   "xf86MapVidMem", DEV_MEM, Size, Base, 
-			   strerror(errno));
-	    }
-	    return base;
-	}
-		
-	/* else, mmap /dev/vga */
-	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
-	{
-		FatalError("%s: Address 0x%lx outside allowable range\n",
-			   "xf86MapVidMem", Base);
-	}
-	base = mmap(0, Size,
-		    (flags & VIDMEM_READONLY) ?
-		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
-		    (unsigned long)Base + BUS_BASE);
-	if (base == MAP_FAILED)
-	{
-	    FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
-		       strerror(errno));
-	}
-	return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	munmap((caddr_t)Base, Size);
-}
-
 /*
  * Read BIOS via mmap()ing DEV_MEM
  */
@@ -502,48 +393,6 @@ sethae(u_int64_t hae)
 }
 #endif /* __NetBSD__ */
 
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-    static Bool was_here = FALSE;
-
-    if (!was_here) {
-      was_here = TRUE;
-
-      checkDevMem(FALSE);
-
-      xf86WriteMmio8 = writeSparse8;
-      xf86WriteMmio16 = writeSparse16;
-      xf86WriteMmio32 = writeSparse32;
-      xf86WriteMmioNB8 = writeSparseNB8;
-      xf86WriteMmioNB16 = writeSparseNB16;
-      xf86WriteMmioNB32 = writeSparseNB32;
-      xf86ReadMmio8 = readSparse8;
-      xf86ReadMmio16 = readSparse16;
-      xf86ReadMmio32 = readSparse32;
-	
-      memBase = mmap((caddr_t)0, 0x100000000,
-		     PROT_READ | PROT_WRITE,
-		     MAP_SHARED, devMemFd,
-		     (off_t) BUS_BASE);
-      memSBase = mmap((caddr_t)0, 0x100000000,
-		      PROT_READ | PROT_WRITE,
-		      MAP_SHARED, devMemFd,
-		      (off_t) BUS_BASE_BWX);
-      
-      if (memSBase == MAP_FAILED || memBase == MAP_FAILED)	{
-	FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
-		   strerror(errno));
-      }
-    }
-    return (pointer)((unsigned long)memBase + Base);
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
-}
-
 static int
 readSparse8(pointer Base, register unsigned long Offset)
 {
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 482d53f..4d43ba2 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -115,9 +115,6 @@ static int  devMemFd = -1;
 
 #define DEV_MEM "/dev/mem"
 
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
 /*
  * Check if /dev/mem can be mmap'd.  If it can't print a warning when
  * "warn" is TRUE.
@@ -171,64 +168,9 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 
 	checkDevMem(TRUE);
 	pVidMem->linearSupported = useDevMem;
-	pVidMem->mapMem = armMapVidMem;
-	pVidMem->unmapVidMem = armUnmapVidMem;
-
 	pVidMem->initialised = TRUE;
 }
 
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	pointer base;
-
-	checkDevMem(FALSE);
-
-	if (useDevMem)
-	{
-	    if (devMemFd < 0) 
-	    {
-		FatalError("xf86MapVidMem: failed to open %s (%s)\n",
-			   DEV_MEM, strerror(errno));
-	    }
-	    base = mmap((caddr_t)0, Size,
-			(flags & VIDMEM_READONLY) ?
-			 PROT_READ : (PROT_READ | PROT_WRITE),
-			MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
-	    if (base == MAP_FAILED)
-	    {
-		FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
-			   "xf86MapVidMem", DEV_MEM, Size, Base, 
-			   strerror(errno));
-	    }
-	    return base;
-	}
-		
-	/* else, mmap /dev/vga */
-	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
-	{
-		FatalError("%s: Address 0x%x outside allowable range\n",
-			   "xf86MapVidMem", Base);
-	}
-	base = mmap(0, Size,
-		    (flags & VIDMEM_READONLY) ?
-		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
-		    (unsigned long)Base - 0xA0000);
-	if (base == MAP_FAILED)
-	{
-	    FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
-		       strerror(errno));
-	}
-	return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	munmap((caddr_t)Base, Size);
-}
-
 /*
  * Read BIOS via mmap()ing DEV_MEM
  */
@@ -403,50 +345,6 @@ xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
     }
 }
 
-static pointer
-armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	struct memAccess *memInfoP;
-	
-	if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
-	{
-	    /*
-	     ** xf86 passes in a physical address offset from the start
-	     ** of physical memory, but xf86MapInfoMap expects an 
-	     ** offset from the start of the specified region - it gets 
-	     ** the physical address of the region from the display driver.
-	     */
-	    switch(Region)
-	    {
-	        case LINEAR_REGION:
-		    if (vgaPhysLinearBase)
-		    {
-			Base -= vgaPhysLinearBase;
-		    }
-		    break;
-		case VGA_REGION:
-		    Base -= 0xA0000;
-		    break;
-	    }
-	    
-	    base = xf86MapInfoMap(memInfoP, Base, Size);
-	    return base;
-	}
-	return mapVidMem(ScreenNum, Base, Size, flags);
-}
-
-static void
-armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-        struct memAccess *memInfoP;
-	
-	if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
-	{
-	    xf86MapInfoUnmap(memInfoP, Base, Size);
-	}
-	unmapVidMem(ScreenNum, Base, Size);
-}
-
 #ifdef USE_DEV_IO
 static int IoFd = -1;
 
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7aef079..7b4cea7 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -44,17 +44,6 @@
 #define X_MTRR_ID "XFree86"
 #endif
 
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-#include <machine/mtrr.h>
-#include <machine/sysarch.h>
-#include <sys/queue.h>
-#ifdef __x86_64__
-#define i386_set_mtrr x86_64_set_mtrr
-#define i386_get_mtrr x86_64_get_mtrr
-#define i386_iopl x86_64_iopl
-#endif
-#endif
-
 #include "xf86_OSlib.h"
 #include "xf86OSpriv.h"
 
@@ -90,20 +79,6 @@ static int  devMemFd = -1;
 #endif
 #define DEV_MEM "/dev/mem"
 
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
-#ifdef HAS_MTRR_SUPPORT
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-static Bool cleanMTRR(void);
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
-			   MessageType);
-static void NetBSDundoWC(int, pointer);
-#endif
-
 /*
  * Check if /dev/mem can be mmap'd.  If it can't print a warning when
  * "warn" is TRUE.
@@ -199,8 +174,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
 	checkDevMem(TRUE);
 	pVidMem->linearSupported = useDevMem;
-	pVidMem->mapMem = mapVidMem;
-	pVidMem->unmapMem = unmapVidMem;
 
 #if HAVE_PCI_SYSTEM_INIT_DEV_MEM
 	if (useDevMem)
@@ -210,71 +183,12 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 #ifdef HAS_MTRR_SUPPORT
 	if (useDevMem) {
 		if (cleanMTRR()) {
-			pVidMem->setWC = setWC;
-			pVidMem->undoWC = undoWC;
 		}
 	}
 #endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-	pVidMem->setWC = NetBSDsetWC;
-	pVidMem->undoWC = NetBSDundoWC;
-#endif
 	pVidMem->initialised = TRUE;
 }
 
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	pointer base;
-
-	checkDevMem(FALSE);
-
-	if (useDevMem)
-	{
-	    if (devMemFd < 0) 
-	    {
-		FatalError("xf86MapVidMem: failed to open %s (%s)",
-			   DEV_MEM, strerror(errno));
-	    }
-	    base = mmap((caddr_t)0, Size,
-			(flags & VIDMEM_READONLY) ?
-			 PROT_READ : (PROT_READ | PROT_WRITE),
-			MAP_FLAGS, devMemFd, (off_t)Base);
-	    if (base == MAP_FAILED)
-	    {
-		FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)",
-			   "xf86MapVidMem", DEV_MEM, Size, Base, 
-			   strerror(errno));
-	    }
-	    return base;
-	}
-		
-	/* else, mmap /dev/vga */
-	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
-	{
-		FatalError("%s: Address 0x%lx outside allowable range",
-			   "xf86MapVidMem", Base);
-	}
-	base = mmap(0, Size,
-		    (flags & VIDMEM_READONLY) ?
-		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
-		    (unsigned long)Base - 0xA0000
-	    );
-	if (base == MAP_FAILED)
-	{
-	    FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
-		       strerror(errno));
-	}
-	return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	munmap((caddr_t)Base, Size);
-}
-
 /*
  * Read BIOS via mmap()ing DEV_MEM
  */
@@ -580,329 +494,4 @@ cleanMTRR()
 	return TRUE;
 }
 
-typedef struct x_RangeRec {
-	struct mem_range_desc	mrd;
-	Bool			wasWC;
-	struct x_RangeRec *	next;
-} RangeRec, *RangePtr;
-
-static void
-freeRangeList(RangePtr range)
-{
-	RangePtr rp;
-
-	while (range) {
-		rp = range;
-		range = rp->next;
-		free(rp);
-	}
-}
-
-static RangePtr
-dupRangeList(RangePtr list)
-{
-	RangePtr new = NULL, rp, p;
-
-	rp = list;
-	while (rp) {
-		p = xnfalloc(sizeof(RangeRec));
-		*p = *rp;
-		p->next = new;
-		new = p;
-		rp = rp->next;
-	}
-	return new;
-}
-
-static RangePtr
-sortRangeList(RangePtr list)
-{
-	RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
-	unsigned long minBase;
-
-	/* Sort by base address */
-	rp1 = copy = dupRangeList(list);
-	while (rp1) {
-		minBase = rp1->mrd.mr_base;
-		minp = rp1;
-		minprev = NULL;
-		prev = rp1;
-		rp2 = rp1->next;
-		while (rp2) {
-			if (rp2->mrd.mr_base < minBase) {
-				minBase = rp2->mrd.mr_base;
-				minp = rp2;
-				minprev = prev;
-			}
-			prev = rp2;
-			rp2 = rp2->next;
-		}
-		if (minprev) {
-			minprev->next = minp->next;
-			rp1 = copy;
-		} else {
-			rp1 = minp->next;
-		}
-		minp->next = sorted;
-		sorted = minp;
-	}
-	return sorted;
-}
-
-/*
- * findRanges returns a list of ranges that overlap the specified range.
- */
-
-static void
-findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
-{
-	struct mem_range_desc *mrd;
-	int nmr, i;
-	RangePtr rp, *p;
-	
-	if (!(mrd = getAllRanges(&nmr)))
-		return;
-
-	for (i = 0; i < nmr; i++) {
-		if ((mrd[i].mr_flags & MDF_ACTIVE) &&
-		    mrd[i].mr_base < base + size &&
-		    mrd[i].mr_base + mrd[i].mr_len > base) {
-			if (mrd[i].mr_flags & MDF_WRITECOMBINE)
-				p = wcp;
-			else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
-				p = ucp;
-			else
-				continue;
-			rp = xnfalloc(sizeof(RangeRec));
-			rp->mrd = mrd[i];
-			rp->next = *p;
-			*p = rp;
-		}
-	}
-	free(mrd);
-}
-
-/*
- * This checks if the existing overlapping ranges fully cover the requested
- * range.  Is this overkill?
- */
-
-static Bool
-fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
-{
-	RangePtr rp1, sorted = NULL;
-	unsigned long end;
-
-	sorted = sortRangeList(overlap);
-	/* Look for gaps */
-	rp1 = sorted;
-	end = base + size;
-	while (rp1) {
-		if (rp1->mrd.mr_base > base) {
-			freeRangeList(sorted);
-			return FALSE;
-		} else {
-			base = rp1->mrd.mr_base + rp1->mrd.mr_len;
-		}
-		if (base >= end) {
-			freeRangeList(sorted);
-			return TRUE;
-		}
-		rp1 = rp1->next;
-	}
-	freeRangeList(sorted);
-	return FALSE;
-}
-
-static pointer
-addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
-	RangePtr uc = NULL, wc = NULL, retlist = NULL;
-	struct mem_range_desc mrd;
-	struct mem_range_op mro;
-
-	findRanges(base, size, &uc, &wc);
-
-	/* See of the full range is already WC */
-	if (!uc && fullCoverage(base, size, wc)) {
-		xf86DrvMsg(screenNum, from, 
-		   "Write-combining range (0x%lx,0x%lx) was already set\n",
-		    base, size);
-		return NULL;
-	}
-
-	/* Otherwise, try to add the new range */
-	mrd.mr_base = base;
-	mrd.mr_len = size;
-	strcpy(mrd.mr_owner, X_MTRR_ID);
-	mrd.mr_flags = MDF_WRITECOMBINE;
-	mro.mo_desc = &mrd;
-	mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
-	if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
-		xf86DrvMsg(screenNum, X_WARNING,
-			   "Failed to set write-combining range "
-			   "(0x%lx,0x%lx)\n", base, size);
-		return NULL;
-	} else {
-		xf86DrvMsg(screenNum, from,
-			   "Write-combining range (0x%lx,0x%lx)\n", base, size);
-		retlist = xnfalloc(sizeof(RangeRec));
-		retlist->mrd = mrd;
-		retlist->wasWC = FALSE;
-		retlist->next = NULL;
-		return retlist;
-	}
-}
-
-static pointer
-delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
-	RangePtr uc = NULL, wc = NULL, retlist = NULL;
-	struct mem_range_desc mrd;
-	struct mem_range_op mro;
-
-	findRanges(base, size, &uc, &wc);
-
-	/*
-	 * See of the full range is already not WC, or if there is full
-	 * coverage from UC ranges.
-	 */
-	if (!wc || fullCoverage(base, size, uc)) {
-		xf86DrvMsg(screenNum, from, 
-		   "Write-combining range (0x%lx,0x%lx) was already clear\n",
-		    base, size);
-		return NULL;
-	}
-
-	/* Otherwise, try to add the new range */
-	mrd.mr_base = base;
-	mrd.mr_len = size;
-	strcpy(mrd.mr_owner, X_MTRR_ID);
-	mrd.mr_flags = MDF_UNCACHEABLE;
-	mro.mo_desc = &mrd;
-	mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
-	if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
-		xf86DrvMsg(screenNum, X_WARNING,
-			   "Failed to remove write-combining range "
-			   "(0x%lx,0x%lx)\n", base, size);
-		/* XXX Should then remove all of the overlapping WC ranges */
-		return NULL;
-	} else {
-		xf86DrvMsg(screenNum, from,
-			   "Removed Write-combining range (0x%lx,0x%lx)\n",
-			   base, size);
-		retlist = xnfalloc(sizeof(RangeRec));
-		retlist->mrd = mrd;
-		retlist->wasWC = TRUE;
-		retlist->next = NULL;
-		return retlist;
-	}
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
-	MessageType from)
-{
-	if (enable)
-		return addWC(screenNum, base, size, from);
-	else
-		return delWC(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer list)
-{
-	RangePtr rp;
-	struct mem_range_op mro;
-	Bool failed;
-
-	rp = list;
-	while (rp) {
-#ifdef DEBUG
-		ErrorF("Undo for (0x%lx,0x%lx), %d\n",
-			(unsigned long)rp->mrd.mr_base,
-			(unsigned long)rp->mrd.mr_len, rp->wasWC);
-#endif
-		failed = FALSE;
-		if (rp->wasWC) {
-			mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
-			rp->mrd.mr_flags = MDF_WRITECOMBINE;
-			strcpy(rp->mrd.mr_owner, "unknown");
-		} else {
-			mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
-		}
-		mro.mo_desc = &rp->mrd;
-
-		if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
-			if (!rp->wasWC) {
-				mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
-				rp->mrd.mr_flags = MDF_UNCACHEABLE;
-				strcpy(rp->mrd.mr_owner, "unknown");
-				if (ioctl(devMemFd, MEMRANGE_SET, &mro))
-					failed = TRUE;
-			} else
-				failed = TRUE;
-		}
-		if (failed) {
-			xf86DrvMsg(screenNum, X_WARNING,
-				"Failed to restore MTRR range (0x%lx,0x%lx)\n",
-				(unsigned long)rp->mrd.mr_base,
-				(unsigned long)rp->mrd.mr_len);
-		}
-		rp = rp->next;
-	}
-}
-
 #endif /* HAS_MTRR_SUPPORT */
-
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer
-NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
-	    MessageType from)
-{
-	struct mtrr *mtrrp;
-	int n;
-
-	xf86DrvMsg(screenNum, X_WARNING,
-		   "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
-		   base, (base + size));
-
-	mtrrp = xnfalloc(sizeof (struct mtrr));
-	mtrrp->base = base;
-	mtrrp->len = size;
-	mtrrp->type = MTRR_TYPE_WC;
-
-	/*
-	 * MTRR_PRIVATE will make this MTRR get reset automatically
-	 * if this process exits, so we have no need for an explicit
-	 * cleanup operation when starting a new server.
-	 */
-
-	if (enable)
-		mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
-	else
-		mtrrp->flags = 0;
-	n = 1;
-
-	if (i386_set_mtrr(mtrrp, &n) < 0) {
-		free(mtrrp);
-		return NULL;
-	}
-	return mtrrp;
-}
-
-static void
-NetBSDundoWC(int screenNum, pointer list)
-{
-	struct mtrr *mtrrp = (struct mtrr *)list;
-	int n;
-
-	if (mtrrp == NULL)
-		return;
-	n = 1;
-	mtrrp->flags &= ~MTRR_VALID;
-	i386_set_mtrr(mtrrp, &n);
-	free(mtrrp);
-}
-#endif
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 7e3fcdb..3000187 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -51,9 +51,6 @@
 #define DEV_MEM "/dev/xf86"
 #endif
 
-static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
-static void ppcUnmapVidMem(int, pointer, unsigned long);
-
 Bool xf86EnableIO(void);
 void xf86DisableIO(void);
 
@@ -61,42 +58,12 @@ void
 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
 	pVidMem->linearSupported = TRUE;
-	pVidMem->mapMem = ppcMapVidMem;
-	pVidMem->unmapMem = ppcUnmapVidMem;
 	pVidMem->initialised = TRUE;
 	xf86EnableIO();
 }
 
-
 volatile unsigned char *ioBase = MAP_FAILED;
 
-static pointer
-ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	int fd = xf86Info.screenFd;
-	pointer base;
-#ifdef DEBUG
-	xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", 
-		    Base, Size, fd);
-#endif
-
-	base = mmap(0, Size,
-		    (flags & VIDMEM_READONLY) ?
-		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_SHARED, fd, Base);
-	if (base == MAP_FAILED)
-		FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
-			   "xf86MapVidMem", Size, Base, strerror(errno));
-
-	return base;
-}
-
-static void
-ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	munmap(Base, Size);
-}
-
 int
 xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
 	     int Len)
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index c838792..e61ad13 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -42,50 +42,16 @@
 /* Video Memory Mapping section                                            */
 /***************************************************************************/
 
-static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
-static void sparc64UnmapVidMem(int, pointer, unsigned long);
-
 void
 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
 	pVidMem->linearSupported = TRUE;
-	pVidMem->mapMem = sparc64MapVidMem;
-	pVidMem->unmapMem = sparc64UnmapVidMem;
 	pVidMem->initialised = TRUE;
 }
 
-static pointer
-sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, 
-		 int flags)
-{
-	int fd = xf86Info.screenFd;
-	pointer base;
-
-#ifdef DEBUG
-	xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", 
-		    Base, Size, fd);
-#endif
-
-	base = mmap(0, Size,
-		    (flags & VIDMEM_READONLY) ?
-		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_SHARED, fd, Base);
-	if (base == MAP_FAILED)
-		FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
-			   "xf86MapVidMem", Size, Base, strerror(errno));
-	return base;
-}
-
-static void
-sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	munmap(Base, Size);
-}
-
 int
 xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
 	     int Len)
 {
-
 	return 0;
 }
diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
index 39f353b..db280b5 100644
--- a/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -39,75 +39,6 @@
 #include "xf86OSpriv.h"
 
 /**************************************************************************
- * Video Memory Mapping section                                            
- ***************************************************************************/
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
-{
-    mach_port_t device,mem_dev;
-    memory_object_t mem_obj;
-    kern_return_t err;
-    vm_address_t addr=(vm_address_t)0;
-
-    err = get_privileged_ports (NULL, &device);
-    if( err )
-    {
-	errno = err;
-	FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno));
-    }
-    err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev);
-    mach_port_deallocate (mach_task_self(), device);
-    if( err )
-    {
-	errno = err;
-	FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno));
-    }
-
-    err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&mem_obj,0);
-    if( err )
-    {
-	errno = err;
-	FatalError("xf86MapVidMem() can't device_map. (%s)\n",strerror(errno));
-    }
-    err = vm_map(mach_task_self(),
-		 &addr,
-		 Size,
-		 0,     /* mask */
-		 TRUE,  /* anywhere */
-		 mem_obj,
-		 (vm_offset_t)Base,
-		 FALSE, /* copy on write */
-		 VM_PROT_READ|VM_PROT_WRITE,
-		 VM_PROT_READ|VM_PROT_WRITE,
-		 VM_INHERIT_SHARE);
-    mach_port_deallocate(mach_task_self(),mem_obj);
-    if( err )
-    {
-	errno = err;
-	FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n",strerror(errno));
-    }
-    mach_port_deallocate(mach_task_self(),mem_dev);
-    if( err )
-    {
-	errno = err;
-	FatalError("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n",strerror(errno));
-    }
-    return (pointer)addr;
-}
-
-static void
-unmapVidMem(int ScreenNum,pointer Base,unsigned long Size)
-{
-    kern_return_t err = vm_deallocate(mach_task_self(), (int)Base, Size);
-    if( err )
-    {
-	errno = err;
-	ErrorF("xf86UnMapVidMem: can't dealloc framebuffer space (%s)\n",strerror(errno));
-    }
-    return;
-}
-
-/**************************************************************************
  * I/O Permissions section                                                 
  ***************************************************************************/
 
@@ -149,7 +80,5 @@ void
 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
 	pVidMem->linearSupported = TRUE;
-	pVidMem->mapMem = mapVidMem;
-	pVidMem->unmapMem = unmapVidMem;
 	pVidMem->initialised = TRUE;
 }
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 3d45511..18116bd 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -42,10 +42,6 @@
 #include "shared/xf86Axp.h"
 #endif
 
-#ifdef HAS_MTRR_SUPPORT
-#include <asm/mtrr.h>
-#endif
-
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *)-1)
 #endif
@@ -83,16 +79,12 @@ extern int iopl(int __level);
 /* Video Memory Mapping section                                            */
 /***************************************************************************/
 
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
 #if defined (__alpha__) 
 extern void sethae(unsigned long hae);
 extern unsigned long _bus_base __P ((void)) __attribute__ ((const));
 extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const));
 
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
 extern axpDevice lnxGetAXP(void);
-static void unmapVidMemSparse(int, pointer, unsigned long);
 static axpDevice axpSystem = -1;
 static Bool needSparse;
 static unsigned long hae_thresh;
@@ -100,269 +92,6 @@ static unsigned long hae_mask;
 static unsigned long bus_base;
 #endif
 
-#ifdef HAS_MTRR_SUPPORT
-
-#define SPLIT_WC_REGIONS 1
-
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-
-/* The file desc for /proc/mtrr. Once opened, left opened, and the mtrr
-   driver will clean up when we exit. */
-#define MTRR_FD_UNOPENED (-1)	/* We have yet to open /proc/mtrr */
-#define MTRR_FD_PROBLEM (-2)	/* We tried to open /proc/mtrr, but had
-				   a problem. */
-static int mtrr_fd = MTRR_FD_UNOPENED;
-
-/* Open /proc/mtrr. FALSE on failure. Will always fail on Linux 2.0, 
-   and will fail on Linux 2.2 with MTRR support configured out,
-   so verbosity should be chosen appropriately. */
-static Bool
-mtrr_open(int verbosity)
-{
-	/* Only report absence of /proc/mtrr once. */
-	static Bool warned = FALSE;
-
-	if (mtrr_fd == MTRR_FD_UNOPENED) { 
-		mtrr_fd = open("/proc/mtrr", O_WRONLY);
-
-		if (mtrr_fd < 0)
-			mtrr_fd = MTRR_FD_PROBLEM;
-	}
-
-	if (mtrr_fd == MTRR_FD_PROBLEM) {
-		/* To make sure we only ever warn once, need to check
-		   verbosity outside xf86MsgVerb */
-		if (!warned && verbosity <= xf86GetVerbosity()) {
-			xf86MsgVerb(X_WARNING, verbosity,
-				  "System lacks support for changing MTRRs\n");
-			warned = TRUE;
-		}
-
-		return FALSE;
-	}
-	else
-		return TRUE;
-}
-
-/*
- * We maintain a list of WC regions for each physical mapping so they can
- * be undone when unmapping.
- */
-
-struct mtrr_wc_region {
-	struct mtrr_sentry	sentry;
-	Bool			added;		/* added WC or removed it */
-	struct mtrr_wc_region *	next;
-};
-
-
-static struct mtrr_wc_region *
-mtrr_cull_wc_region(int screenNum, unsigned long base, unsigned long size,
-		      MessageType from)
-{
-	/* Some BIOS writers thought that setting wc over the mmio
-	   region of a graphics devices was a good idea. Try to fix
-	   it. */
-
-	struct mtrr_gentry gent;
-	struct mtrr_wc_region *wcreturn = NULL, *wcr;
-	int count, ret=0;
-
-	/* Linux 2.0 users should not get a warning without -verbose */
-	if (!mtrr_open(2))
-		return NULL;
-
-	for (gent.regnum = 0; 
-	     ioctl(mtrr_fd, MTRRIOC_GET_ENTRY, &gent) >= 0;
-	     gent.regnum++) {
-		if (gent.type != MTRR_TYPE_WRCOMB
-		    || gent.base + gent.size <= base
-		    || base + size <= gent.base)
-			continue;
-
-		/* Found an overlapping region. Delete it. */
-		
-		wcr = malloc(sizeof(*wcr));
-		if (!wcr)
-			return NULL;
-		wcr->sentry.base = gent.base;
-		wcr->sentry.size = gent.size;
-		wcr->sentry.type = MTRR_TYPE_WRCOMB;
-		wcr->added = FALSE;
-		
-		count = 3;
-		while (count-- && 
-		       (ret = ioctl(mtrr_fd, MTRRIOC_KILL_ENTRY, &(wcr->sentry))) < 0);
-		
-		if (ret >= 0) {
-			xf86DrvMsg(screenNum, from,
-				   "Removed MMIO write-combining range "
-				   "(0x%lx,0x%lx)\n",
-				   (unsigned long) gent.base, (unsigned long) gent.size);
-			wcr->next = wcreturn;
-			wcreturn = wcr;
-			gent.regnum--;
-		} else {
-			free(wcr);
-			xf86DrvMsgVerb(screenNum, X_WARNING, 0,
-				   "Failed to remove MMIO "
-				   "write-combining range (0x%lx,0x%lx)\n",
-				       gent.base, (unsigned long) gent.size);
-		}
-	}
-	return wcreturn;
-}
-
-
-static struct mtrr_wc_region *
-mtrr_remove_offending(int screenNum, unsigned long base, unsigned long size,
-		      MessageType from)
-{
-    struct mtrr_gentry gent;
-    struct mtrr_wc_region *wcreturn = NULL, **wcr;
-
-    if (!mtrr_open(2))
-	return NULL;
-
-    wcr = &wcreturn;
-    for (gent.regnum = 0; 
-	 ioctl(mtrr_fd, MTRRIOC_GET_ENTRY, &gent) >= 0; gent.regnum++ ) {
-	if (gent.type == MTRR_TYPE_WRCOMB
-	    && ((gent.base >= base && gent.base + gent.size < base + size) || 
-		(gent.base >  base && gent.base + gent.size <= base + size))) {
-	    *wcr = mtrr_cull_wc_region(screenNum, gent.base, gent.size, from);
-	    if (*wcr) gent.regnum--;
-	    while(*wcr) {
-		wcr = &((*wcr)->next);
-	    }
-	}
-    }
-    return wcreturn;
-}
-
-
-static struct mtrr_wc_region *
-mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
-		   MessageType from)
-{
-        struct mtrr_wc_region **wcr, *wcreturn, *curwcr;
-
-       /*
-        * There can be only one....
-        */
-
-	wcreturn = mtrr_remove_offending(screenNum, base, size, from);
-	wcr = &wcreturn;
-	while (*wcr) {
-	    wcr = &((*wcr)->next);
-	} 
-
-	/* Linux 2.0 should not warn, unless the user explicitly asks for
-	   WC. */
-
-	if (!mtrr_open(from == X_CONFIG ? 0 : 2))
-		return wcreturn;
-
-	*wcr = curwcr = malloc(sizeof(**wcr));
-	if (!curwcr)
-	    return wcreturn;
-
-	curwcr->sentry.base = base;
-	curwcr->sentry.size = size;
-	curwcr->sentry.type = MTRR_TYPE_WRCOMB;
-	curwcr->added = TRUE;
-	curwcr->next = NULL;
-
-#if SPLIT_WC_REGIONS
-	/*
-	 * Splits up the write-combining region if it is not aligned on a
- 	 * size boundary.
-	 */
-
-	{
-	    unsigned long lbase, d_size = 1;
-	    unsigned long n_size = size;
-	    unsigned long n_base = base;
-
-	    for (lbase = n_base, d_size = 1; !(lbase & 1);
-		 lbase = lbase >> 1, d_size <<= 1);
-	    while (d_size > n_size)
-		d_size = d_size >> 1;
-	    DebugF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
-	    n_base += d_size;
-	    n_size -= d_size;
-	    if (n_size) {
-		xf86DrvMsgVerb(screenNum,X_INFO,3,"Splitting WC range: "
-			       "base: 0x%lx, size: 0x%lx\n",base,size);
-		curwcr->next = mtrr_add_wc_region(screenNum, n_base, n_size,from);
-	    }
-	    curwcr->sentry.size = d_size;
-	} 
-	
-	/*****************************************************************/
-#endif /* SPLIT_WC_REGIONS */
-
-	if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &curwcr->sentry) >= 0) {
-		/* Avoid printing on every VT switch */
-		if (xf86ServerIsInitialising()) {
-			xf86DrvMsg(screenNum, from,
-				   "Write-combining range (0x%lx,0x%lx)\n",
-				   base, size);
-		}
-		return wcreturn;
-	}
-	else {
-	        *wcr = curwcr->next;
-		free(curwcr);
-		
-		/* Don't complain about the VGA region: MTRR fixed
-		   regions aren't currently supported, but might be in
-		   the future. */
-		if ((unsigned long)base >= 0x100000) {
-			xf86DrvMsgVerb(screenNum, X_WARNING, 0,
-				"Failed to set up write-combining range "
-				"(0x%lx,0x%lx)\n", base, size);
-		}
-		return wcreturn;
-	}
-}
-
-static void
-mtrr_undo_wc_region(int screenNum, struct mtrr_wc_region *wcr)
-{
-	struct mtrr_wc_region *p, *prev;
-
-	if (mtrr_fd >= 0) {
-		p = wcr;
-		while (p) {
-			if (p->added)
-				ioctl(mtrr_fd, MTRRIOC_DEL_ENTRY, &p->sentry);
-			prev = p;
-			p = p->next;
-			free(prev);
-		}
-	}
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
-      MessageType from)
-{
-	if (enable)
-		return mtrr_add_wc_region(screenNum, base, size, from);
-	else
-		return mtrr_cull_wc_region(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer regioninfo)
-{
-	mtrr_undo_wc_region(screenNum, regioninfo);
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
 void
 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
@@ -378,105 +107,14 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 	}
 	if (needSparse) {
 	  xf86Msg(X_INFO,"Machine needs sparse mapping\n");
-	  pVidMem->mapMem = mapVidMemSparse;
-	  pVidMem->unmapMem = unmapVidMemSparse;
 	} else {
 	  xf86Msg(X_INFO,"Machine type has 8/16 bit access\n");
-	  pVidMem->mapMem = mapVidMem;
-	  pVidMem->unmapMem = unmapVidMem;
 	}	
-#else
-	pVidMem->mapMem = mapVidMem;
-	pVidMem->unmapMem = unmapVidMem;
 #endif /* __alpha__ */
 
-
-#ifdef HAS_MTRR_SUPPORT
-	pVidMem->setWC = setWC;
-	pVidMem->undoWC = undoWC;
-#endif
 	pVidMem->initialised = TRUE;
 }
 
-#ifdef __sparc__
-/* Basically, you simply cannot do this on Sparc.  You have to do something portable
- * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM
- */
-static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-	return NULL;
-}
-#else
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-    pointer base;
-    int fd;
-    int mapflags = MAP_SHARED; 
-    int prot;
-    memType realBase, alignOff;
-
-    realBase = Base & ~(getpagesize() - 1);
-    alignOff = Base - realBase;
-    DebugF("base: %lx, realBase: %lx, alignOff: %lx \n",
-	   Base,realBase,alignOff);
-
-#if defined(__ia64__) || defined(__arm__) || defined(__s390__)
-#ifndef MAP_WRITECOMBINED
-#define MAP_WRITECOMBINED 0x00010000
-#endif
-#ifndef MAP_NONCACHED
-#define MAP_NONCACHED 0x00020000
-#endif
-    if(flags & VIDMEM_FRAMEBUFFER) 
-        mapflags |= MAP_WRITECOMBINED; 
-    else
-        mapflags |= MAP_NONCACHED; 
-#endif
-
-#if 0
-    /* this will disappear when people upgrade their kernels */
-    fd = open(DEV_MEM,
-	      ((flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR) | O_SYNC);
-#else
-    fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
-#endif
-    if (fd < 0)
-    {
-	FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
-		   strerror(errno));
-    }
-
-    if (flags & VIDMEM_READONLY)
-	prot = PROT_READ;
-    else
-	prot = PROT_READ | PROT_WRITE;
-
-    /* This requires linux-0.99.pl10 or above */
-    base = mmap((caddr_t)0, Size + alignOff, prot, mapflags, fd,
- 		(off_t)realBase  + BUS_BASE);
-    close(fd);
-    if (base == MAP_FAILED) {
-        FatalError("xf86MapVidMem: Could not mmap framebuffer"
-		   " (0x%08lx,0x%lx) (%s)\n", Base, Size,
-		   strerror(errno));
-    }
-    DebugF("base: %lx aligned base: %lx\n",base, (char *)base + alignOff);
-    return (char *)base + alignOff;
-}
-#endif /* !(__sparc__) */
-    
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-    memType alignOff = (memType)Base 
-	- ((memType)Base & ~(getpagesize() - 1));
-
-    DebugF("alignment offset: %lx\n",alignOff);
-    munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
-}
-
-
 /***************************************************************************/
 /* I/O Permissions section                                                 */
 /***************************************************************************/
@@ -599,115 +237,6 @@ writeSparse32(int Value, pointer Base, register unsigned long Offset);
 
 static unsigned long msb_set = 0;
 
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-    int fd, prot;
-    unsigned long ret, rets = 0;
-
-    static Bool was_here = FALSE;
-
-    if (!was_here) {
-      was_here = TRUE;
-
-      xf86WriteMmio8 = writeSparse8;
-      xf86WriteMmio16 = writeSparse16;
-      xf86WriteMmio32 = writeSparse32;
-      xf86WriteMmioNB8 = writeSparseNB8;
-      xf86WriteMmioNB16 = writeSparseNB16;
-      xf86WriteMmioNB32 = writeSparseNB32;
-      xf86ReadMmio8 = readSparse8;
-      xf86ReadMmio16 = readSparse16;
-      xf86ReadMmio32 = readSparse32;
-    }
-	
-    fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
-    if (fd < 0) {
-        FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
-		   strerror(errno));
-    }
-
-#if 0
-    xf86Msg(X_INFO,"mapVidMemSparse: try Base 0x%lx size 0x%lx flags 0x%x\n",
-	    Base, Size, flags);
-#endif
-
-    if (flags & VIDMEM_READONLY)
-	prot = PROT_READ;
-    else
-	prot = PROT_READ | PROT_WRITE;
-
-    /* This requirers linux-0.99.pl10 or above */
-
-    /*
-     * Always do DENSE mmap, since read32/write32 currently require it.
-     */
-    ret = (unsigned long)mmap((caddr_t)(DENSE_BASE + Base), Size,
-		   prot, MAP_SHARED, fd,
-		   (off_t) (bus_base + Base));
-
-    /*
-     * Do SPARSE mmap only when MMIO and not MMIO_32BIT, or FRAMEBUFFER
-     * and SPARSE (which should require the use of read/write macros).
-     *
-     * By not SPARSE mmapping an 8MB framebuffer, we can save approx. 256K
-     * bytes worth of pagetable (32 pages).
-     */
-    if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) ||
-	((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE)))
-    {
-        rets = (unsigned long)mmap((caddr_t)(SPARSE_BASE + (Base << 5)),
-				   Size << 5, prot, MAP_SHARED, fd,
-				   (off_t) _bus_base_sparse() + (Base << 5));
-    }
-
-    close(fd);
-      
-    if (ret == (unsigned long)MAP_FAILED) {
-        FatalError("xf86MapVidMemSparse: Could not (dense) mmap fb (%s)\n",
-		   strerror(errno));
-    }
-
-    if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) ||
-	((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE)))
-    {
-        if (rets == (unsigned long)MAP_FAILED ||
-	    rets != (SPARSE_BASE + (Base << 5)))
-	{
-	    FatalError("mapVidMemSparse: Could not (sparse) mmap fb (%s)\n",
-		       strerror(errno));
-	}
-    }
-
-#if 1
-    if (rets)
-        xf86Msg(X_INFO,"mapVidMemSparse: mapped Base 0x%lx size 0x%lx"
-		" to DENSE at 0x%lx and SPARSE at 0x%lx\n",
-		Base, Size, ret, rets);
-    else
-        xf86Msg(X_INFO,"mapVidMemSparse: mapped Base 0x%lx size 0x%lx"
-		" to DENSE only at 0x%lx\n",
-		Base, Size, ret);
-
-#endif
-    return (pointer) ret;
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
-    unsigned long Offset = (unsigned long)Base - DENSE_BASE;
-#if 1
-    xf86Msg(X_INFO,"unmapVidMemSparse: unmapping Base 0x%lx Size 0x%lx\n",
-	    Base, Size);
-#endif
-    /* Unmap DENSE always. */
-    munmap((caddr_t)Base, Size);
-
-    /* Unmap SPARSE always, and ignore error in case we did not map it. */
-    munmap((caddr_t)(SPARSE_BASE + (Offset << 5)), Size << 5);
-}
-
 static int
 readSparse8(pointer Base, register unsigned long Offset)
 {
diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c
index 54f6c64..146ce8b 100644
--- a/hw/xfree86/os-support/shared/vidmem.c
+++ b/hw/xfree86/os-support/shared/vidmem.c
@@ -25,7 +25,6 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
 #endif
@@ -43,133 +42,7 @@
  * This file contains the common part of the video memory mapping functions
  */
 
-/*
- * Get a piece of the ScrnInfoRec.  At the moment, this is only used to hold
- * the MTRR option information, but it is likely to be expanded if we do
- * auto unmapping of memory at VT switch.
- *
- */
-
-typedef struct {
-	unsigned long 	size;
-	pointer		virtBase;
-	pointer 	mtrrInfo;
-} MappingRec, *MappingPtr;
-	
-typedef struct {
-	int		numMappings;
-	MappingPtr *	mappings;
-	Bool		mtrrEnabled;
-	MessageType	mtrrFrom;
-	Bool		mtrrOptChecked;
-	ScrnInfoPtr	pScrn;
-} VidMapRec, *VidMapPtr;
-
-static int vidMapIndex = -1;
-
-#define VIDMAPPTR(p) ((VidMapPtr)((p)->privates[vidMapIndex].ptr))
-
 static VidMemInfo vidMemInfo = {FALSE, };
-static VidMapRec  vidMapRec  = {0, NULL, TRUE, X_DEFAULT, FALSE, NULL};
-
-static VidMapPtr
-getVidMapRec(int scrnIndex)
-{
-	VidMapPtr vp;
-	ScrnInfoPtr pScrn;
-
-	if ((scrnIndex < 0) ||
-	    !(pScrn = xf86Screens[scrnIndex]))
-		return &vidMapRec;
-
-	if (vidMapIndex < 0)
-		vidMapIndex = xf86AllocateScrnInfoPrivateIndex();
-
-	if (VIDMAPPTR(pScrn) != NULL)
-		return VIDMAPPTR(pScrn);
-
-	vp = pScrn->privates[vidMapIndex].ptr = xnfcalloc(sizeof(VidMapRec), 1);
-	vp->mtrrEnabled = TRUE;	/* default to enabled */
-	vp->mtrrFrom = X_DEFAULT;
-	vp->mtrrOptChecked = FALSE;
-	vp->pScrn = pScrn;
-	return vp;
-}
-
-static MappingPtr
-newMapping(VidMapPtr vp)
-{
-	vp->mappings = xnfrealloc(vp->mappings, sizeof(MappingPtr) *
-				  (vp->numMappings + 1));
-	vp->mappings[vp->numMappings] = xnfcalloc(sizeof(MappingRec), 1);
-	return vp->mappings[vp->numMappings++];
-}
-
-static MappingPtr
-findMapping(VidMapPtr vp, pointer vbase, unsigned long size)
-{
-	int i;
-
-	for (i = 0; i < vp->numMappings; i++) {
-		if (vp->mappings[i]->virtBase == vbase &&
-		    vp->mappings[i]->size == size)
-			return vp->mappings[i];
-	}
-	return NULL;
-}
-
-static void
-removeMapping(VidMapPtr vp, MappingPtr mp)
-{
-	int i, found = 0;
-
-	for (i = 0; i < vp->numMappings; i++) {
-		if (vp->mappings[i] == mp) {
-			found = 1;
-			free(vp->mappings[i]);
-		} else if (found) {
-			vp->mappings[i - 1] = vp->mappings[i];
-		}
-	}
-	vp->numMappings--;
-	vp->mappings[vp->numMappings] = NULL;
-}
-
-enum { OPTION_MTRR };
-static const OptionInfoRec opts[] =
-{
-	{ OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE },
-	{ -1, NULL, OPTV_NONE, {0}, FALSE }
-};
-
-static void
-checkMtrrOption(VidMapPtr vp)
-{
-	if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) {
-		OptionInfoPtr options;
-
-		options = xnfalloc(sizeof(opts));
-		(void)memcpy(options, opts, sizeof(opts));
-		xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options,
-					options);
-		if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled))
-			vp->mtrrFrom = X_CONFIG;
-		free(options);
-		vp->mtrrOptChecked = TRUE;
-	}
-}
-
-void
-xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base, unsigned long Size, pointer Vbase)
-{
-	VidMapPtr vp;
-	MappingPtr mp;
-
-	vp = getVidMapRec(ScreenNum);
-	mp = newMapping(vp);
-	mp->size = Size;
-	mp->virtBase = Vbase;
-}
 
 void
 xf86InitVidMem(void)
@@ -180,111 +53,9 @@ xf86InitVidMem(void)
 	}
 }
 
-pointer
-xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
-{
-	pointer vbase = NULL;
-	VidMapPtr vp;
-	MappingPtr mp;
-
-	if (((Flags & VIDMEM_FRAMEBUFFER) &&
-	     (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))))
-	    FatalError("Mapping memory with more than one type\n");
-	    
-	xf86InitVidMem();
-	if (!vidMemInfo.initialised || !vidMemInfo.mapMem)
-		return NULL;
-
-	vbase = vidMemInfo.mapMem(ScreenNum, Base, Size, Flags);
-
-	if (!vbase || vbase == (pointer)-1)
-		return NULL;
-
-	vp = getVidMapRec(ScreenNum);
-	mp = newMapping(vp);
-	mp->size = Size;
-	mp->virtBase = vbase;
-
-	/*
-	 * Check the "mtrr" option even when MTRR isn't supported to avoid
-	 * warnings about unrecognised options.
-	 */
-	checkMtrrOption(vp);
-
-	if (vp->mtrrEnabled && vidMemInfo.setWC) {
-		if (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))
-			mp->mtrrInfo =
-				vidMemInfo.setWC(ScreenNum, Base, Size, FALSE,
-						 vp->mtrrFrom);
-		else if (Flags & VIDMEM_FRAMEBUFFER)
-			mp->mtrrInfo =
-				vidMemInfo.setWC(ScreenNum, Base, Size, TRUE,
-						 vp->mtrrFrom);
-	}
-	return vbase;
-}
-
-void
-xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	VidMapPtr vp;
-	MappingPtr mp;
-
-	if (!vidMemInfo.initialised || !vidMemInfo.unmapMem) {
-		xf86DrvMsg(ScreenNum, X_WARNING,
-		  "xf86UnMapVidMem() called before xf86MapVidMem()\n");
-		return;
-	}
-
-	vp = getVidMapRec(ScreenNum);
-	mp = findMapping(vp, Base, Size);
-	if (!mp) {
-		xf86DrvMsg(ScreenNum, X_WARNING,
-		  "xf86UnMapVidMem: cannot find region for [%p,0x%lx]\n",
-		  Base, Size);
-		return;
-	}
-	if (vp->mtrrEnabled && vidMemInfo.undoWC && mp)
-		vidMemInfo.undoWC(ScreenNum, mp->mtrrInfo);
-
-	vidMemInfo.unmapMem(ScreenNum, Base, Size);
-	removeMapping(vp, mp);
-}
-
-Bool
-xf86CheckMTRR(int ScreenNum)
-{
-	VidMapPtr vp = getVidMapRec(ScreenNum);
-
-	/*
-	 * Check the "mtrr" option even when MTRR isn't supported to avoid
-	 * warnings about unrecognised options.
-	 */
-	checkMtrrOption(vp);
-
-	if (vp->mtrrEnabled && vidMemInfo.setWC)
-		return TRUE;
-		
-	return FALSE;
-}
-
 Bool
 xf86LinearVidMem(void)
 {
 	xf86InitVidMem();
 	return vidMemInfo.linearSupported;
 }
-
-void
-xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base,
-			unsigned long Size)
-{
-	if (!(Flags & VIDMEM_READSIDEEFFECT))
-		return;
-
-	if (!vidMemInfo.initialised || !vidMemInfo.readSideEffects)
-		return;
-
-	vidMemInfo.readSideEffects(ScreenNum, base, Size);
-}
-
diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h
index 754128d..cb85602 100644
--- a/hw/xfree86/os-support/xf86OSpriv.h
+++ b/hw/xfree86/os-support/xf86OSpriv.h
@@ -32,22 +32,8 @@
 #ifndef _XF86OSPRIV_H
 #define _XF86OSPRIV_H
 
-typedef pointer (*MapMemProcPtr)(int, unsigned long, unsigned long, int);
-typedef void (*UnmapMemProcPtr)(int, pointer, unsigned long);
-typedef pointer (*SetWCProcPtr)(int, unsigned long, unsigned long, Bool,
-				MessageType);
-typedef void (*ProtectMemProcPtr)(int, pointer, unsigned long, Bool); 
-typedef void (*UndoWCProcPtr)(int, pointer);
-typedef void (*ReadSideEffectsProcPtr)(int, pointer, unsigned long);
-
 typedef struct {
 	Bool			initialised;
-	MapMemProcPtr		mapMem;
-	UnmapMemProcPtr		unmapMem;
-	ProtectMemProcPtr	protectMem;
-	SetWCProcPtr		setWC;
-	UndoWCProcPtr		undoWC;
-	ReadSideEffectsProcPtr	readSideEffects;
 	Bool			linearSupported;
 } VidMemInfo, *VidMemInfoPtr;
 
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index f0cb768..66f09d0 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -75,24 +75,6 @@
  */ 
 
 /*
- * Flags for xf86MapVidMem().  Multiple flags can be or'd together.  The
- * flags may be used as hints.  For example it would be permissible to
- * enable write combining for memory marked only for framebuffer use.
- */
-
-#define VIDMEM_FRAMEBUFFER	0x01	/* memory for framebuffer use */
-#define VIDMEM_MMIO		0x02	/* memory for I/O use */
-#define VIDMEM_MMIO_32BIT	0x04	/* memory accesses >= 32bit */
-#define VIDMEM_READSIDEEFFECT	0x08	/* reads can have side-effects */
-#define VIDMEM_SPARSE		0x10	/* sparse mapping required
-					 * assumed when VIDMEM_MMIO is
-					 * set. May be used with
-					 * VIDMEM_FRAMEBUFFER) */
-#define VIDMEM_READONLY		0x20	/* read-only mapping
-					 * used when reading BIOS images
-					 * through xf86MapVidMem() */
-
-/*
  * OS-independent modem state flags for xf86SetSerialModemState() and
  * xf86GetSerialModemState().
  */
@@ -131,10 +113,6 @@ _XFUNCPROTOBEGIN
 
 /* public functions */
 extern _X_EXPORT Bool xf86LinearVidMem(void);
-extern _X_EXPORT Bool xf86CheckMTRR(int);
-extern _X_EXPORT pointer xf86MapVidMem(int, int, unsigned long, unsigned long);
-extern _X_EXPORT void xf86UnMapVidMem(int, pointer, unsigned long);
-extern _X_EXPORT void xf86MapReadSideEffects(int, int, pointer, unsigned long);
 extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int);
 extern _X_EXPORT Bool xf86EnableIO(void);
 extern _X_EXPORT void xf86DisableIO(void);
@@ -208,7 +186,6 @@ extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
 extern _X_EXPORT void xf86UseMsg(void);
 extern _X_EXPORT PMClose xf86OSPMOpen(void);
 
-extern _X_EXPORT void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
 extern _X_EXPORT void xf86InitVidMem(void);
 
 #endif /* XF86_OS_PRIVS */
commit 78ff91b2abe278451e54802b8c749d8a11e19875
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 10 19:00:02 2011 -0400

    int10: Port internal users off xf86MapVidMem
    
    This API is apparently semi-deprecated even by XFree86 standards, and
    there are only four drivers left using it.  Let's start chopping it off.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 20a07fc..22ebd47 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -103,8 +103,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
     MapVRam(pInt);
 #ifdef _PC
     if (!sysMem)
-	sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS,
-			       BIOS_SIZE + SYS_BIOS - V_BIOS);
+	pci_device_map_legacy(pInt->dev, V_BIOS, BIOS_SIZE + SYS_BIOS - V_BIOS,
+			      1, &sysMem);
     INTPriv(pInt)->sysMem = sysMem;
 
     if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index f74da47..78e7810 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -680,10 +680,12 @@ static void
 SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
 {
     int pagesize = getpagesize();
-    unsigned char* base = xf86MapVidMem(pInt->scrnIndex,
-					VIDMEM_MMIO, 0, pagesize);
+    unsigned char* base;
     int i;
 
+    if (pci_device_map_legacy(pInt->dev, 0, pagesize, 1, (void **)&base))
+	return; /* eek */
+
     if (set) {
 	for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
 	    MEM_WW(pInt, i, *(base + i));
@@ -692,7 +694,7 @@ SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
 	    *(base + i) = MEM_RW(pInt, i);
     }
     
-    xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
+    pci_device_unmap_legacy(pInt->dev, base, pagesize);
 }
 
 void
@@ -706,7 +708,9 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
 	|| (!save && !pInt->BIOSScratch))
 	return;
     
-    base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize);
+    if (pci_device_map_legacy(pInt->dev, 0, pagesize, 1, (void **)&base))
+	return; /* eek */
+
     base += BIOS_SCRATCH_OFF;
     if (save) {
 	if ((pInt->BIOSScratch
@@ -722,7 +726,7 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
 	}
     }
     
-    xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize);
+    pci_device_unmap_legacy(pInt->dev, base, pagesize);
 }
 #endif
 
commit fbbd4df1a8bdd08405dff98fc45f5eada8065904
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 10 17:34:23 2011 -0400

    pci: Remove xf86MapDomainMemory
    
    This is slightly draconian, but that API is just awful.  In all but
    one case in the callers it's used to get a map of some legacy VGA
    memory, and it would be cleaner for the caller to just call
    pci_device_map_legacy.
    
    The sole exception is in the vesa driver, which uses it to avoid having
    to look up which device the BAR belongs to.  That's similarly trivial to
    fix.
    
    Having done that, Linux's PCI layer is now very small indeed.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index d51860d..7232098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1496,7 +1496,6 @@ if test "x$XORG" = xauto; then
 fi
 AC_MSG_RESULT([$XORG])
 
-xorg_bus_linuxpci=no
 xorg_bus_bsdpci=no
 xorg_bus_sparc=no
 
@@ -1567,7 +1566,6 @@ if test "x$XORG" = xyes; then
 			XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
 		fi
 		XORG_OS_SUBDIR="linux"
-		xorg_bus_linuxpci="yes"
 		linux_acpi="no"
 		case $host_cpu in
 		  alpha*)
@@ -1750,7 +1748,6 @@ if test "x$XORG" = xyes; then
 	AC_SUBST([abi_extension])
 fi
 AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
-AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
 AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
 AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
 AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 040d999..20a07fc 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -238,9 +238,7 @@ MapVRam(xf86Int10InfoPtr pInt)
     int pagesize = getpagesize();
     int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
 
-    INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
-					      pInt->dev, V_RAM, size);
-
+    pci_device_map_legacy(pInt->dev, V_RAM, size, 1, &(INTPriv(pInt)->vRam));
     pInt->io = pci_legacy_open_io(pInt->dev, 0, 64 * 1024);
 }
 
@@ -251,8 +249,7 @@ UnmapVRam(xf86Int10InfoPtr pInt)
     int pagesize = getpagesize();
     int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
 
-    xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
-
+    pci_device_unmap_legacy(pInt->dev, INTPriv(pInt)->vRam, size);
     pci_device_close_io(pInt->dev, pInt->io);
     pInt->io = NULL;
 }
diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index 643cb25..b1ca8f9 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -3,10 +3,6 @@ sdk_HEADERS = xf86Pci.h
 
 PCI_SOURCES = Pci.c Pci.h
 
-if XORG_BUS_LINUXPCI
-PCI_SOURCES += linuxPci.c
-endif
-
 if XORG_BUS_BSDPCI
 PCI_SOURCES += bsd_pci.c
 endif
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
index f51d5c0..7a5dbbb 100644
--- a/hw/xfree86/os-support/bus/bsd_pci.c
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -48,13 +48,6 @@
 
 #include "pciaccess.h"
 
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
-		    ADDRESS Base, unsigned long Size)
-{
-    return xf86MapVidMem(ScreenNum, Flags, Base, Size);
-}
-
 void
 osPciInit(void)
 {
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
deleted file mode 100644
index 8f314b5..0000000
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission.  Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose.  It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission.  Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose.  It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdio.h>
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-/**
- * \bug
- * The generation of the procfs file name for the domain != 0 case may not be 
- * correct.
- */
-static int
-linuxPciOpenFile(struct pci_device *dev, Bool write)
-{
-    static struct pci_device *last_dev = NULL;
-    static int	fd = -1,is_write = 0;
-    char		file[64];
-
-    if (dev == NULL) {
-	return -1;
-    }
-
-    if (fd == -1 || (write && (!is_write)) || (last_dev != dev)) {
-	if (fd != -1) {
-	    close(fd);
-	    fd = -1;
-	}
-
-	sprintf(file,"/sys/bus/pci/devices/%04u:%02x:%02x.%01x/config",
-		dev->domain, dev->bus, dev->dev, dev->func);
-
-	if (write) {
-	    fd = open(file,O_RDWR);
-	    if (fd != -1) is_write = TRUE;
-	} else {
-	    switch (is_write) {
-	    case TRUE:
-		fd = open(file,O_RDWR);
-		if (fd > -1)
-		    break;
-	    default:
-		fd = open(file,O_RDONLY);
-		is_write = FALSE;
-	    }
-	}
-
-	last_dev = dev;
-    }
-
-    return fd;
-}
-
-/*
- * Compiling the following simply requires the presence of <linux/pci.c>.
- * Actually running this is another matter altogether...
- *
- * This scheme requires that the kernel allow mmap()'ing of a host bridge's I/O
- * and memory spaces through its /proc/bus/pci/BUS/DFN entry.  Which one is
- * determined by a prior ioctl().
- *
- * For the sparc64 port, this means 2.4.12 or later.  For ppc, this
- * functionality is almost, but not quite there yet.  Alpha and other kernel
- * ports to multi-domain architectures still need to implement this.
- *
- * TO DO:  Address the deleterious reaction some host bridges have to master
- *         aborts.  This is already done for secondary PCI buses, but not yet
- *         for accesses to primary buses (except for the SPARC port, where
- *         master aborts are avoided during PCI scans).
- */
-
-#include <linux/pci.h>
-
-#ifndef PCIIOC_BASE		/* Ioctls for /proc/bus/pci/X/Y nodes. */
-#define PCIIOC_BASE		('P' << 24 | 'C' << 16 | 'I' << 8)
-
-/* Get controller for PCI device. */
-#define PCIIOC_CONTROLLER	(PCIIOC_BASE | 0x00)
-/* Set mmap state to I/O space. */
-#define PCIIOC_MMAP_IS_IO	(PCIIOC_BASE | 0x01)
-/* Set mmap state to MEM space. */
-#define PCIIOC_MMAP_IS_MEM	(PCIIOC_BASE | 0x02)
-/* Enable/disable write-combining. */
-#define PCIIOC_WRITE_COMBINE	(PCIIOC_BASE | 0x03)
-
-#endif
-
-static pointer
-linuxMapPci(int ScreenNum, int Flags, struct pci_device *dev,
-	    ADDRESS Base, unsigned long Size, int mmap_ioctl)
-{
-    /* Align to page boundary */
-    const ADDRESS realBase = Base & ~(getpagesize() - 1);
-    const ADDRESS Offset = Base - realBase;
-
-    do {
-	unsigned char *result;
-	int fd, mmapflags, prot;
-
-	xf86InitVidMem();
-
-	/* If dev is NULL, linuxPciOpenFile will return -1, and this routine
-	 * will fail gracefully.
-	 */
-        prot = ((Flags & VIDMEM_READONLY) == 0);
-        if (((fd = linuxPciOpenFile(dev, prot)) < 0) ||
-	    (ioctl(fd, mmap_ioctl, 0) < 0))
-	    break;
-
-/* Note:  IA-64 doesn't compile this and doesn't need to */
-#ifdef __ia64__
-
-# ifndef  MAP_WRITECOMBINED
-#  define MAP_WRITECOMBINED 0x00010000
-# endif
-# ifndef  MAP_NONCACHED
-#  define MAP_NONCACHED     0x00020000
-# endif
-
-	if (Flags & VIDMEM_FRAMEBUFFER)
-	    mmapflags = MAP_SHARED | MAP_WRITECOMBINED;
-	else
-	    mmapflags = MAP_SHARED | MAP_NONCACHED;
-
-#else /* !__ia64__ */
-
-	mmapflags = (Flags & VIDMEM_FRAMEBUFFER) / VIDMEM_FRAMEBUFFER;
-
-	if (ioctl(fd, PCIIOC_WRITE_COMBINE, mmapflags) < 0)
-	    break;
-
-	mmapflags = MAP_SHARED;
-
-#endif /* ?__ia64__ */
-
-
-	if (Flags & VIDMEM_READONLY)
-	    prot = PROT_READ;
-	else
-	    prot = PROT_READ | PROT_WRITE;
-
-	result = mmap(NULL, Size + Offset, prot, mmapflags, fd, realBase);
-
-	if (!result || ((pointer)result == MAP_FAILED))
-	    return NULL;
-
-	xf86MakeNewMapping(ScreenNum, Flags, realBase, Size + Offset, result);
-
-	return result + Offset;
-    } while (0);
-
-    if (mmap_ioctl == PCIIOC_MMAP_IS_MEM)
-	return xf86MapVidMem(ScreenNum, Flags, Base, Size);
-
-    return NULL;
-}
-
-static int
-linuxOpenLegacy(struct pci_device *dev, char *name)
-{
-    static const char PREFIX[] = "/sys/class/pci_bus/%04x:%02x/%s";
-    char path[sizeof(PREFIX) + 10];
-    int fd = -1;
-
-    while (dev != NULL) {
-	snprintf(path, sizeof(path) - 1, PREFIX, dev->domain, dev->bus, name);
-	fd = open(path, O_RDWR);
-	if (fd >= 0) {
-	    return fd;
-	}
-
-	dev = pci_device_get_parent_bridge(dev);
-    }
-
-    return fd;
-}
-
-/*
- * xf86MapDomainMemory - memory map PCI domain memory
- *
- * This routine maps the memory region in the domain specified by Tag and
- * returns a pointer to it.  The pointer is saved for future use if it's in
- * the legacy ISA memory space (memory in a domain between 0 and 1MB).
- */
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
-		    ADDRESS Base, unsigned long Size)
-{
-    int fd = -1;
-    pointer addr;
-
-    /*
-     * We use /proc/bus/pci on non-legacy addresses or if the Linux sysfs
-     * legacy_mem interface is unavailable.
-     */
-    if ((Base > 1024*1024) || ((fd = linuxOpenLegacy(dev, "legacy_mem")) < 0))
-	return linuxMapPci(ScreenNum, Flags, dev, Base, Size,
-			   PCIIOC_MMAP_IS_MEM);
-    else
-	addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
-
-    if (fd >= 0)
-	close(fd);
-    if (addr == NULL || addr == MAP_FAILED) {
-	perror("mmap failure");
-	FatalError("xf86MapDomainMem():  mmap() failure\n");
-    }
-    return addr;
-}
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 929dea2..8ecead0 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -252,8 +252,6 @@ typedef enum {
 extern _X_EXPORT Bool xf86scanpci(void);
 
 /* Domain access functions.  Some of these probably shouldn't be public */
-extern _X_EXPORT pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
-    ADDRESS Base, unsigned long Size);
 extern _X_EXPORT struct pci_io_handle *xf86MapLegacyIO(struct pci_device *dev);
 extern _X_EXPORT void xf86UnmapLegacyIO(struct pci_device *, struct pci_io_handle *);
 
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 072c599..2ce6352 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1741,7 +1741,6 @@ Bool
 vgaHWMapMem(ScrnInfoPtr scrp)
 {
     vgaHWPtr hwp = VGAHWPTR(scrp);
-    int scr_index = scrp->scrnIndex;
     
     if (hwp->Base)
 	return TRUE;
@@ -1759,8 +1758,7 @@ vgaHWMapMem(ScrnInfoPtr scrp)
      * for now.
      */
     DebugF("Mapping VGAMem\n");
-    hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->dev,
-				    hwp->MapPhys, hwp->MapSize);
+    pci_device_map_legacy(hwp->dev, hwp->MapPhys, hwp->MapSize, 1, &hwp->Base);
     return hwp->Base != NULL;
 }
 
@@ -1769,13 +1767,12 @@ void
 vgaHWUnmapMem(ScrnInfoPtr scrp)
 {
     vgaHWPtr hwp = VGAHWPTR(scrp);
-    int scr_index = scrp->scrnIndex;
 
     if (hwp->Base == NULL)
 	return;
     
     DebugF("Unmapping VGAMem\n");
-    xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize);
+    pci_device_unmap_legacy(hwp->dev, hwp->Base, hwp->MapSize);
     hwp->Base = NULL;
 }
 
commit a5cb1ac10447424c9d0ae7679634f241a63e464c
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 10 18:04:10 2011 -0400

    int10: Use pciaccess rom fetch for !PC machines
    
    ... instead of rolling our own, badly.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index beb90b5..040d999 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -62,62 +62,6 @@ static void UnmapVRam(xf86Int10InfoPtr pInt);
 
 static void *sysMem = NULL;
 
-/**
- * Read legacy VGA video BIOS associated with specified domain.
- * 
- * Attempts to read up to 128KiB of legacy VGA video BIOS.
- * 
- * \return
- * The number of bytes read on success or -1 on failure.
- *
- * \bug
- * PCI ROMs can contain multiple BIOS images (e.g., OpenFirmware, x86 VGA,
- * etc.).  How do we know that \c pci_device_read_rom will return the
- * legacy VGA BIOS image?
- */
-#ifndef _PC
-static int
-read_legacy_video_BIOS(struct pci_device *dev, unsigned char *Buf)
-{
-    const ADDRESS Base = 0xC0000;
-    const int Len = 0x10000 * 2;
-    const int pagemask = getpagesize() - 1;
-    const ADDRESS offset = Base & ~pagemask;
-    const unsigned long size = ((Base + Len + pagemask) & ~pagemask) - offset;
-    unsigned char *ptr, *src;
-    int len;
-
-
-    /* Try to use the civilized PCI interface first.
-     */
-    if (pci_device_read_rom(dev, Buf) == 0) {
-	return dev->rom_size;
-    }
-
-    ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, dev, offset, size);
-
-    if (!ptr)
-	return -1;
-
-    /* Using memcpy() here can hang the system */
-    src = ptr + (Base - offset);
-    for (len = 0; len < (Len / 2); len++) {
-	Buf[len] = src[len];
-    }
-
-    if ((Buf[0] == 0x55) && (Buf[1] == 0xAA) && (Buf[2] > 0x80)) {
-	for ( /* empty */ ; len < Len; len++) {
-	    Buf[len] = src[len];
-	}
-    }
-
-    xf86UnMapVidMem(-1, ptr, size);
-
-    return Len;
-}
-#endif /* _PC */
-
-
 xf86Int10InfoPtr
 xf86ExtendedInitInt10(int entityIndex, int Flags)
 {
@@ -232,7 +176,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
      */
     vbiosMem = (char *)base + V_BIOS;
     memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
-    if (read_legacy_video_BIOS(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
+    if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
 	xf86DrvMsg(screen, X_WARNING,
 		   "Unable to retrieve all of segment 0x0C0000.\n");
     }
commit 1b30ec61fee780637476b7f2e0980db307d47ce3
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 10 16:41:08 2011 -0400

    pci: Remove the PCITAG type
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 8b52e88..f74da47 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -475,7 +475,7 @@ static struct pci_device*
 pci_device_for_cfg_address (CARD32 addr)
 {
 	struct pci_device *dev = NULL;
-	PCITAG tag = PCI_TAG(addr);
+	CARD32 tag = PCI_TAG(addr);
 	struct pci_slot_match slot_match = {
 		.domain = PCI_DOM_FROM_TAG(tag),
 		.bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag)),
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index f1dbfc2..0362a00 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -126,12 +126,6 @@
 
 #include "Pci.h"
 
-PCITAG
-pciTag(int busnum, int devnum, int funcnum)
-{
-	return(PCI_MAKE_TAG(busnum,devnum,funcnum));
-}
-
 Bool
 xf86scanpci(void)
 {
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 4f2f07e..929dea2 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -235,7 +235,6 @@
 
 /* Primitive Types */
 typedef unsigned long ADDRESS;		/* Memory/PCI address */
-typedef unsigned long PCITAG;
 
 typedef enum {
     PCI_MEM,
@@ -250,7 +249,6 @@ typedef enum {
 
 
 /* Public PCI access functions */
-extern _X_EXPORT PCITAG pciTag(int busnum, int devnum, int funcnum);
 extern _X_EXPORT Bool xf86scanpci(void);
 
 /* Domain access functions.  Some of these probably shouldn't be public */
commit 040440e69499756c4d3fb65e0e90d92cddabb352
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jan 7 17:20:15 2011 -0500

    xfree86: Remove unused bios_devmem.c
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 348b7ff..094563d 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -16,6 +16,3 @@ libxorgos_la_LIBADD = @XORG_OS_SUBDIR@/lib at XORG_OS_SUBDIR@.la \
 
 AM_CFLAGS = $(DIX_CFLAGS) 
 
-# FIXME: These don't seem to be used anywhere
-EXTRA_DIST += \
-	shared/bios_devmem.c
diff --git a/hw/xfree86/os-support/shared/bios_devmem.c b/hw/xfree86/os-support/shared/bios_devmem.c
deleted file mode 100644
index b9dfb7d..0000000
--- a/hw/xfree86/os-support/shared/bios_devmem.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 1993 by David Wexelblat <dwex at goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  David Wexelblat makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include <string.h>
-
-/*
- * Read BIOS via /dev/mem.
- */
-
-#ifndef DEV_MEM
-# define DEV_MEM "/dev/mem"
-#endif
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
-		int Len)
-{
- 	int fd;
-
-#ifdef __ia64__
-	if ((fd = open(DEV_MEM, O_RDONLY | O_SYNC)) < 0)
-#else
- 	if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
-#endif
-	{
-		xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
-			DEV_MEM, strerror(errno));
-		return -1;
-	}
-
-	if (lseek(fd, (Base+Offset), SEEK_SET) < 0)
-	{
-		xf86Msg(X_WARNING, "xf86ReadBIOS: %s seek failed (%s)\n",
-			DEV_MEM, strerror(errno));
-		close(fd);
-		return -1;
-	}
-	if (read(fd, Buf, Len) != Len)
-	{
-		xf86Msg(X_WARNING, "xf86ReadBIOS: %s read failed (%s)\n",
-			DEV_MEM, strerror(errno));
-		close(fd);
-		return -1;
-	}
-	close(fd);
-	return Len;
-}
commit b1d0e9b6076f6665ef69d0f5da21585810773ffe
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jan 7 16:57:15 2011 -0500

    linux: Remove ia64 domain I/O support code
    
    pciaccess handles this now.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index b0d2643..d51860d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1570,14 +1570,10 @@ if test "x$XORG" = xyes; then
 		xorg_bus_linuxpci="yes"
 		linux_acpi="no"
 		case $host_cpu in
-		  ia64*)
-			linux_ia64=yes
-			linux_acpi="yes"
-			;;
 		  alpha*)
 		  	linux_alpha=yes
 			;;
-		  i*86|amd64*|x86_64*)
+		  i*86|amd64*|x86_64*|ia64*)
 			linux_acpi="yes"
 			;;
 		  *)
@@ -1757,7 +1753,6 @@ AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
 AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
 AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
 AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
-AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes])
 AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
 AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
 AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 7a82627..36748df 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -1,9 +1,5 @@
 noinst_LTLIBRARIES = liblinux.la
 
-if LINUX_IA64
-PLATFORM_PCI_SUPPORT = $(srcdir)/../shared/ia64Pci.c
-PLATFORM_INCLUDES = -I$(srcdir)/../shared
-endif
 if LINUX_ALPHA
 noinst_LTLIBRARIES += liblinuxev56.la
 PLATFORM_PCI_SUPPORT = \
diff --git a/hw/xfree86/os-support/shared/ia64Pci.c b/hw/xfree86/os-support/shared/ia64Pci.c
deleted file mode 100644
index c93c74c..0000000
--- a/hw/xfree86/os-support/shared/ia64Pci.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc.  All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-/*
- * This file contains the glue needed to support various IA-64 chipsets.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <linux/pci.h>
-
-#include "compiler.h"
-#include "Pci.h"
-
-/*
- * We use special in/out routines here since Altix platforms require the
- * use of the sysfs legacy_io interface.  The legacy_io file maps to the I/O
- * space of a given PCI domain; reads and writes are used to do port I/O.
- * The file descriptor for the file is stored in the upper bits of the
- * value passed in by the caller, and is created and populated by
- * xf86MapLegacyIO.
- *
- * If the legacy_io interface doesn't exist, we fall back to the glibc in/out
- * routines, which are prefixed by an underscore (e.g. _outb).
- */
-static int ia64_port_to_fd(unsigned long port)
-{
-    return (port >> 24) & 0xffffffff;
-}
-
-void outb(unsigned long port, unsigned char val)
-{
-    int fd = ia64_port_to_fd(port);
-
-    if (!fd) {
-	_outb(val, port & 0xffff);
-	goto out;
-    }
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	goto out;
-    }
-    if (write(fd, &val, 1) != 1) {
-	ErrorF("I/O write failed\n");
-	goto out;
-    }
- out:
-    return;
-}
-
-void outw(unsigned long port, unsigned short val)
-{
-    int fd = ia64_port_to_fd(port);
-
-    if (!fd) {
-	_outw(val, port & 0xffff);
-	goto out;
-    }
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	goto out;
-    }
-    if (write(fd, &val, 2) != 2) {
-	ErrorF("I/O write failed\n");
-	goto out;
-    }
- out:
-    return;
-}
-
-void outl(unsigned long port, unsigned int val)
-{
-    int fd = ia64_port_to_fd(port);
-
-    if (!fd) {
-	_outl(val, port & 0xffff);
-	goto out;
-    }
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	goto out;
-    }
-    if (write(fd, &val, 4) != 4) {
-	ErrorF("I/O write failed\n");
-	goto out;
-    }
- out:
-    return;
-}
-
-unsigned int inb(unsigned long port)
-{
-    int fd = ia64_port_to_fd(port);
-    unsigned char val;
-
-    if (!fd)
-	return _inb(port & 0xffff);
-
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	val = -1;
-	goto out;
-    }
-    if (read(fd, &val, 1) != 1) {
-	ErrorF("I/O read failed\n");
-	val = -1;
-	goto out;
-    }
- out:
-    return val;
-}
-
-unsigned int inw(unsigned long port)
-{
-    int fd = ia64_port_to_fd(port);
-    unsigned short val;
-
-    if (!fd)
-	return _inw(port & 0xffff);
-
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	val = -1;
-	goto out;
-    }
-    if (read(fd, &val, 2) != 2) {
-	ErrorF("I/O read failed\n");
-	val = -1;
-	goto out;
-    }
- out:
-    return val;
-}
-
-unsigned int inl(unsigned long port)
-{
-    int fd = ia64_port_to_fd(port);
-    unsigned int val;
-
-    if (!fd)
-	return _inl(port & 0xffff);
-
-    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
-	ErrorF("I/O lseek failed\n");
-	val = -1;
-	goto out;
-    }
-    if (read(fd, &val, 4) != 4) {
-	ErrorF("I/O read failed\n");
-	val = -1;
-	goto out;
-    }
- out:
-    return val;
-}
-
commit 66cca21ecf54b9816cddd2a17c17592259753d93
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 16 16:09:56 2009 -0400

    linux: Remove pre-2.6 PCI interface support
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    If you haven't ported 2.6 to your architecture in the intervening seven
    years, you can keep running older servers.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 2778bba..8f314b5 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -63,47 +63,19 @@ linuxPciOpenFile(struct pci_device *dev, Bool write)
     static struct pci_device *last_dev = NULL;
     static int	fd = -1,is_write = 0;
     char		file[64];
-    struct stat	ignored;
-    static int is26 = -1;
 
     if (dev == NULL) {
 	return -1;
     }
 
-    if (is26 == -1) {
-	is26 = (stat("/sys/bus/pci", &ignored) < 0) ? 0 : 1;
-    }
-	
     if (fd == -1 || (write && (!is_write)) || (last_dev != dev)) {
 	if (fd != -1) {
 	    close(fd);
 	    fd = -1;
 	}
 
-	if (is26) {
-	    sprintf(file,"/sys/bus/pci/devices/%04u:%02x:%02x.%01x/config",
-		    dev->domain, dev->bus, dev->dev, dev->func);
-	} else {
-	    if (dev->domain == 0) {
-		sprintf(file,"/proc/bus/pci/%02x", dev->bus);
-		if (stat(file, &ignored) < 0) {
-		    sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
-			    dev->bus, dev->dev, dev->func);
-		} else {
-		    sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
-			    dev->bus, dev->dev, dev->func);
-		}
-	    } else {
-		sprintf(file,"/proc/bus/pci/%02x%02x", dev->domain, dev->bus);
-		if (stat(file, &ignored) < 0) {
-		    sprintf(file, "/proc/bus/pci/%04x:%04x/%02x.%1x",
-			    dev->domain, dev->bus, dev->dev, dev->func);
-		} else {
-		    sprintf(file, "/proc/bus/pci/%02x%02x/%02x.%1x",
-			    dev->domain, dev->bus, dev->dev, dev->func);
-		}
-	    }
-	}
+	sprintf(file,"/sys/bus/pci/devices/%04u:%02x:%02x.%01x/config",
+		dev->domain, dev->bus, dev->dev, dev->func);
 
 	if (write) {
 	    fd = open(file,O_RDWR);
commit 1415f6d62ea167eb3fbb8e62e9794f0b53bf0337
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 16 14:05:54 2009 -0400

    bus: remove some dead struct fields
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c
index 89db4cc..54f6c64 100644
--- a/hw/xfree86/os-support/shared/vidmem.c
+++ b/hw/xfree86/os-support/shared/vidmem.c
@@ -51,11 +51,9 @@
  */
 
 typedef struct {
-	unsigned long 	physBase;
 	unsigned long 	size;
 	pointer		virtBase;
 	pointer 	mtrrInfo;
-	int		flags;
 } MappingRec, *MappingPtr;
 	
 typedef struct {
@@ -169,10 +167,8 @@ xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base, unsigned long S
 
 	vp = getVidMapRec(ScreenNum);
 	mp = newMapping(vp);
-	mp->physBase = Base;
 	mp->size = Size;
 	mp->virtBase = Vbase;
-	mp->flags = Flags;
 }
 
 void
@@ -206,10 +202,8 @@ xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
 
 	vp = getVidMapRec(ScreenNum);
 	mp = newMapping(vp);
-	mp->physBase = Base;
 	mp->size = Size;
 	mp->virtBase = vbase;
-	mp->flags = Flags;
 
 	/*
 	 * Check the "mtrr" option even when MTRR isn't supported to avoid
commit 390363242f65f7184a664072dacb662d6c51c11e
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Sep 20 11:42:11 2010 -0400

    linux: Use pci_device_get_parent_bridge instead of open-coding it
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 28bba01..2778bba 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -160,45 +160,6 @@ linuxPciOpenFile(struct pci_device *dev, Bool write)
 
 #endif
 
-/* This probably shouldn't be Linux-specific */
-static struct pci_device *
-get_parent_bridge(struct pci_device *dev)
-{
-    struct pci_id_match bridge_match = {
-	PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
-	(PCI_CLASS_BRIDGE << 16) | (PCI_SUBCLASS_BRIDGE_PCI << 8),
-	0
-    };
-    struct pci_device *bridge;
-    struct pci_device_iterator *iter;
-
-    if (dev == NULL) {
-	return NULL;
-    }
-
-    iter = pci_id_match_iterator_create(& bridge_match);
-    if (iter == NULL) {
-	return NULL;
-    }
-
-    while ((bridge = pci_device_next(iter)) != NULL) {
-	if (bridge->domain == dev->domain) {
-	    const struct pci_bridge_info *info = 
-		pci_device_get_bridge_info(bridge);
-
-	    if (info != NULL) {
-		if (info->secondary_bus == dev->bus) {
-		    break;
-		}
-	    }
-	}
-    }
-
-    pci_iterator_destroy(iter);
-
-    return bridge;
-}
-
 static pointer
 linuxMapPci(int ScreenNum, int Flags, struct pci_device *dev,
 	    ADDRESS Base, unsigned long Size, int mmap_ioctl)
@@ -283,7 +244,7 @@ linuxOpenLegacy(struct pci_device *dev, char *name)
 	    return fd;
 	}
 
-	dev = get_parent_bridge(dev);
+	dev = pci_device_get_parent_bridge(dev);
     }
 
     return fd;
commit 13a03e7636fb5b21a9c27ba2e9634bfb6d8f8b47
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Sep 16 13:33:04 2011 -0400

    pci: Port xf86MapLegacyIO to pciaccess
    
    Per-domain I/O is now something drivers must manually request, and must
    keep track of within their own state rather than in the ScrnInfoRec.
    It's not really possible to split that into two steps without an
    additional intermediate ABI break, so don't even try.  Drivers that want
    source compatibility should ifdef on the presence of xf86UnmapLegacyIO.
    
    As a fringe benefit, domain-aware I/O is now OS-independent, relying
    only on support in pciaccess.  Simplify OS PCI setup to reflect this.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 3b08968..8749a29 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -308,7 +308,6 @@ xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
     pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList,
 				    pScrn->numEntities * sizeof(int));
     pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
-    pScrn->domainIOBase = xf86Entities[entityIndex]->domainIO;
 }
 
 void
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index e161c7f..0b2ebdb 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -58,7 +58,6 @@ typedef struct {
     DevUnion *                  entityPrivates;
     int                         numInstances;
     GDevPtr *                   devices;   
-    IOADDRESS                   domainIO;
 } EntityRec, *EntityPtr;
 
 #define ACCEL_IS_SHARABLE 0x100
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 447b192..2acf486 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -235,11 +235,6 @@ xf86ClaimPciSlot(struct pci_device * d, DriverPtr drvp,
             xf86AddDevToEntity(num, dev);
 	pciSlotClaimed = TRUE;
 
-	if (active) {
-	    /* Map in this domain's I/O space */
-	   p->domainIO = xf86MapLegacyIO(d);
-	}
-	
  	return num;
     } else
  	return -1;
@@ -1357,3 +1352,15 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
     if (*chipset < 0)
         *chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
 }
+
+struct pci_io_handle *
+xf86MapLegacyIO(struct pci_device *dev)
+{
+    return pci_legacy_open_io(dev, 0, 64 * 1024);
+}
+
+void
+xf86UnmapLegacyIO(struct pci_device *dev, struct pci_io_handle *handle)
+{
+    pci_device_close_io(dev, handle);
+}
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 0493dc5..43e9d1d 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -742,7 +742,6 @@ typedef struct _ScrnInfoRec {
     unsigned long	biosBase;		/* Base address of video BIOS */
     unsigned long	memPhysBase;		/* Physical address of FB */
     unsigned long 	fbOffset;		/* Offset of FB in the above */
-    IOADDRESS    	domainIOBase;		/* Domain I/O base address */
     int			memClk;			/* memory clock */
     int			textClockFreq;		/* clock of text mode */
     Bool		flipPixels;		/* swap default black/white */
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index fe4850e..f1dbfc2 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -140,7 +140,7 @@ xf86scanpci(void)
     success = (pci_system_init() == 0);
 
     /* choose correct platform/OS specific PCI init routine */
-	ARCH_PCI_INIT();
+    osPciInit();
 
     return success;
 }
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 3493013..88560ec 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -137,20 +137,14 @@
 #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
 #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+#if defined(linux)
+#define osPciInit(x) do {} while (0)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
 	defined(__OpenBSD__) || defined(__NetBSD__) || \
 	defined(__DragonFly__) || defined(__sun) || defined(__GNU__)
-#define ARCH_PCI_INIT bsdPciInit
-#endif
-
-#if defined(linux)
-#define ARCH_PCI_INIT linuxPciInit
-#endif /* defined(linux) */
-
-#ifndef ARCH_PCI_INIT
+extern void osPciInit(void);
+#else
 #error No PCI support available for this architecture/OS combination
 #endif
 
-extern void ARCH_PCI_INIT(void);
-
 #endif /* _PCI_H */
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
index 17b52db..f51d5c0 100644
--- a/hw/xfree86/os-support/bus/bsd_pci.c
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -55,15 +55,8 @@ xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
     return xf86MapVidMem(ScreenNum, Flags, Base, Size);
 }
 
-IOADDRESS
-xf86MapLegacyIO(struct pci_device *dev)
-{
-    (void)dev;
-    return 0;
-}
-
 void
-bsdPciInit(void)
+osPciInit(void)
 {
     xf86InitVidMem();
 }
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index fcfdbcb..28bba01 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -52,21 +52,6 @@
 #include "xf86_OSlib.h"
 #include "Pci.h"
 
-static const struct pci_id_match match_host_bridge = {
-    PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
-    (PCI_CLASS_BRIDGE << 16) | (PCI_SUBCLASS_BRIDGE_HOST << 8),
-    0x0000ffff00, 0
-};
-
-#define MAX_DOMAINS 257
-static pointer DomainMmappedIO[MAX_DOMAINS];
-
-void
-linuxPciInit(void)
-{
-    memset(DomainMmappedIO, 0, sizeof(DomainMmappedIO));
-}
-
 /**
  * \bug
  * The generation of the procfs file name for the domain != 0 case may not be 
@@ -153,15 +138,6 @@ linuxPciOpenFile(struct pci_device *dev, Bool write)
  * functionality is almost, but not quite there yet.  Alpha and other kernel
  * ports to multi-domain architectures still need to implement this.
  *
- * This scheme is also predicated on the use of an IOADDRESS compatible type to
- * designate I/O addresses.  Although IOADDRESS is defined as an unsigned
- * integral type, it is actually the virtual address of, i.e. a pointer to, the
- * I/O port to access.  And so, the inX/outX macros in "compiler.h" need to be
- * #define'd appropriately (as is done on SPARC's).
- *
- * Another requirement to port this scheme to another multi-domain architecture
- * is to add the appropriate entries in the pciControllerSizes array below.
- *
  * TO DO:  Address the deleterious reaction some host bridges have to master
  *         aborts.  This is already done for secondary PCI buses, but not yet
  *         for accesses to primary buses (except for the SPARC port, where
@@ -223,67 +199,6 @@ get_parent_bridge(struct pci_device *dev)
     return bridge;
 }
 
-/*
- * This is ugly, but until I can extract this information from the kernel,
- * it'll have to do.  The default I/O space size is 64K, and 4G for memory.
- * Anything else needs to go in this table.  (PowerPC folk take note.)
- *
- * Note that Linux/SPARC userland is 32-bit, so 4G overflows to zero here.
- *
- * Please keep this table in ascending vendor/device order.
- */
-static const struct pciSizes {
-    unsigned short vendor, device;
-    unsigned long io_size, mem_size;
-} pciControllerSizes[] = {
-    {
-	PCI_VENDOR_SUN, PCI_CHIP_PSYCHO,
-	1U << 16, 1U << 31
-    },
-    {
-	PCI_VENDOR_SUN, PCI_CHIP_SCHIZO,
-	1U << 24, 1U << 31	/* ??? */
-    },
-    {
-	PCI_VENDOR_SUN, PCI_CHIP_SABRE,
-	1U << 24, (unsigned long)(1ULL << 32)
-    },
-    {
-	PCI_VENDOR_SUN, PCI_CHIP_HUMMINGBIRD,
-	1U << 24, (unsigned long)(1ULL << 32)
-    }
-};
-#define NUM_SIZES (sizeof(pciControllerSizes) / sizeof(pciControllerSizes[0]))
-
-static const struct pciSizes *
-linuxGetSizesStruct(const struct pci_device *dev)
-{
-    static const struct pciSizes default_size = {
-	0, 0, 1U << 16, (unsigned long)(1ULL << 32)
-    };
-    int          i;
-
-    /* Look up vendor/device */
-    if (dev != NULL) {
-	for (i = 0;  i < NUM_SIZES;  i++) {
-	    if ((dev->vendor_id == pciControllerSizes[i].vendor)
-		&& (dev->device_id == pciControllerSizes[i].device)) {
-		return & pciControllerSizes[i];
-	    }
-	}
-    }
-
-    /* Default to 64KB I/O and 4GB memory. */
-    return & default_size;
-}
-
-static __inline__ unsigned long
-linuxGetIOSize(const struct pci_device *dev)
-{
-    const struct pciSizes * const sizes = linuxGetSizesStruct(dev);
-    return sizes->io_size;
-}
-
 static pointer
 linuxMapPci(int ScreenNum, int Flags, struct pci_device *dev,
 	    ADDRESS Base, unsigned long Size, int mmap_ioctl)
@@ -406,45 +321,3 @@ xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
     }
     return addr;
 }
-
-/**
- * Map I/O space in this domain
- *
- * Each domain has a legacy ISA I/O space.  This routine will try to
- * map it using the Linux sysfs legacy_io interface.  If that fails,
- * it'll fall back to using /proc/bus/pci.
- *
- * If the legacy_io interface \b does exist, the file descriptor (\c fd below)
- * will be saved in the \c DomainMmappedIO array in the upper bits of the
- * pointer.  Callers will do I/O with small port numbers (<64k values), so
- * the platform I/O code can extract the port number and the \c fd, \c lseek
- * to the port number in the legacy_io file, and issue the read or write.
- *
- * This has no means of returning failure, so all errors are fatal
- */
-IOADDRESS
-xf86MapLegacyIO(struct pci_device *dev)
-{
-    const int domain = dev->domain;
-    struct pci_device *bridge = get_parent_bridge(dev);
-    int fd;
-
-    if (domain >= MAX_DOMAINS)
-	FatalError("xf86MapLegacyIO():  domain out of range\n");
-
-    if (DomainMmappedIO[domain] == NULL) {
-	/* Permanently map all of I/O space */
-	fd = linuxOpenLegacy(bridge, "legacy_io");
-	if (fd < 0) {
-	    DomainMmappedIO[domain] = linuxMapPci(-1, VIDMEM_MMIO, bridge,
-						  0, linuxGetIOSize(bridge),
-						  PCIIOC_MMAP_IS_IO);
-	}
-	else { /* legacy_io file exists, encode fd */
-	    DomainMmappedIO[domain] = (pointer)(intptr_t)(fd << 24);
-	}
-    }
-
-    return (IOADDRESS)DomainMmappedIO[domain];
-}
-
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index ce1336b..4f2f07e 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -235,7 +235,6 @@
 
 /* Primitive Types */
 typedef unsigned long ADDRESS;		/* Memory/PCI address */
-typedef unsigned long IOADDRESS;	/* Must be large enough for a pointer */
 typedef unsigned long PCITAG;
 
 typedef enum {
@@ -257,6 +256,7 @@ extern _X_EXPORT Bool xf86scanpci(void);
 /* Domain access functions.  Some of these probably shouldn't be public */
 extern _X_EXPORT pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
     ADDRESS Base, unsigned long Size);
-extern _X_EXPORT IOADDRESS xf86MapLegacyIO(struct pci_device *dev);
+extern _X_EXPORT struct pci_io_handle *xf86MapLegacyIO(struct pci_device *dev);
+extern _X_EXPORT void xf86UnmapLegacyIO(struct pci_device *, struct pci_io_handle *);
 
 #endif /* _XF86PCI_H */
commit 28cf1da0b53e8206da57d1f081ac09b0ea7cece2
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Sep 20 18:12:29 2011 -0400

    vgahw: Port to pciaccess IO space routines
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 9e934f6..072c599 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -163,67 +163,67 @@ static CARD8 defaultDAC[768] =
 static void
 stdWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)
 {
-    outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
-    outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET, value);
+    pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
+    pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_DATA_OFFSET, value);
 }
 
 static CARD8
 stdReadCrtc(vgaHWPtr hwp, CARD8 index)
 {
-    outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
-    return inb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET);
+    pci_io_write8(hwp->io, hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
+    return pci_io_read8(hwp->io, hwp->IOBase + VGA_CRTC_DATA_OFFSET);
 }
 
 static void
 stdWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
-    outb(hwp->PIOOffset + VGA_GRAPH_DATA, value);
+    pci_io_write8(hwp->io, VGA_GRAPH_INDEX, index);
+    pci_io_write8(hwp->io, VGA_GRAPH_DATA, value);
 }
 
 static CARD8
 stdReadGr(vgaHWPtr hwp, CARD8 index)
 {
-    outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
-    return inb(hwp->PIOOffset + VGA_GRAPH_DATA);
+    pci_io_write8(hwp->io, VGA_GRAPH_INDEX, index);
+    return pci_io_read8(hwp->io, VGA_GRAPH_DATA);
 }
 
 static void
 stdWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
-    outb(hwp->PIOOffset + VGA_SEQ_DATA, value);
+    pci_io_write8(hwp->io, VGA_SEQ_INDEX, index);
+    pci_io_write8(hwp->io, VGA_SEQ_DATA, value);
 }
 
 static CARD8
 stdReadSeq(vgaHWPtr hwp, CARD8 index)
 {
-    outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
-    return inb(hwp->PIOOffset + VGA_SEQ_DATA);
+    pci_io_write8(hwp->io, VGA_SEQ_INDEX, index);
+    return pci_io_read8(hwp->io, VGA_SEQ_DATA);
 }
 
 static CARD8
 stdReadST00(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_IN_STAT_0);
+    return pci_io_read8(hwp->io, VGA_IN_STAT_0);
 }
 
 static CARD8
 stdReadST01(vgaHWPtr hwp)
 {
-    return inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+    return pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET);
 }
 
 static CARD8
 stdReadFCR(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_FEATURE_R);
+    return pci_io_read8(hwp->io, VGA_FEATURE_R);
 }
 
 static void
 stdWriteFCR(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->IOBase + hwp->PIOOffset + VGA_FEATURE_W_OFFSET,value);
+    pci_io_write8(hwp->io, hwp->IOBase + VGA_FEATURE_W_OFFSET,value);
 }
 
 static void
@@ -234,9 +234,9 @@ stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value)
     else
 	index |= 0x20;
 
-    (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
-    outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
-    outb(hwp->PIOOffset + VGA_ATTR_DATA_W, value);
+    (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+    pci_io_write8(hwp->io, VGA_ATTR_INDEX, index);
+    pci_io_write8(hwp->io, VGA_ATTR_DATA_W, value);
 }
 
 static CARD8
@@ -247,85 +247,85 @@ stdReadAttr(vgaHWPtr hwp, CARD8 index)
     else
 	index |= 0x20;
 
-    (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
-    outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
-    return inb(hwp->PIOOffset + VGA_ATTR_DATA_R);
+    (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+    pci_io_write8(hwp->io, VGA_ATTR_INDEX, index);
+    return pci_io_read8(hwp->io, VGA_ATTR_DATA_R);
 }
 
 static void
 stdWriteMiscOut(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_MISC_OUT_W, value);
+    pci_io_write8(hwp->io, VGA_MISC_OUT_W, value);
 }
 
 static CARD8
 stdReadMiscOut(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_MISC_OUT_R);
+    return pci_io_read8(hwp->io, VGA_MISC_OUT_R);
 }
 
 static void
 stdEnablePalette(vgaHWPtr hwp)
 {
-    (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
-    outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00);
+    (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+    pci_io_write8(hwp->io, VGA_ATTR_INDEX, 0x00);
     hwp->paletteEnabled = TRUE;
 }
 
 static void
 stdDisablePalette(vgaHWPtr hwp)
 {
-    (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
-    outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20);
+    (void) pci_io_read8(hwp->io, hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+    pci_io_write8(hwp->io, VGA_ATTR_INDEX, 0x20);
     hwp->paletteEnabled = FALSE;
 }
 
 static void
 stdWriteDacMask(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_DAC_MASK, value);
+    pci_io_write8(hwp->io, VGA_DAC_MASK, value);
 }
 
 static CARD8
 stdReadDacMask(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_DAC_MASK);
+    return pci_io_read8(hwp->io, VGA_DAC_MASK);
 }
 
 static void
 stdWriteDacReadAddr(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_DAC_READ_ADDR, value);
+    pci_io_write8(hwp->io, VGA_DAC_READ_ADDR, value);
 }
 
 static void
 stdWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_DAC_WRITE_ADDR, value);
+    pci_io_write8(hwp->io, VGA_DAC_WRITE_ADDR, value);
 }
 
 static void
 stdWriteDacData(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_DAC_DATA, value);
+    pci_io_write8(hwp->io, VGA_DAC_DATA, value);
 }
 
 static CARD8
 stdReadDacData(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_DAC_DATA);
+    return pci_io_read8(hwp->io, VGA_DAC_DATA);
 }
 
 static CARD8
 stdReadEnable(vgaHWPtr hwp)
 {
-    return inb(hwp->PIOOffset + VGA_ENABLE);
+    return pci_io_read8(hwp->io, VGA_ENABLE);
 }
 
 static void
 stdWriteEnable(vgaHWPtr hwp, CARD8 value)
 {
-    outb(hwp->PIOOffset + VGA_ENABLE, value);
+    pci_io_write8(hwp->io, VGA_ENABLE, value);
 }
 
 void
@@ -353,9 +353,10 @@ vgaHWSetStdFuncs(vgaHWPtr hwp)
     hwp->writeDacReadAddr	= stdWriteDacReadAddr;
     hwp->writeDacData		= stdWriteDacData;
     hwp->readDacData		= stdReadDacData;
-    hwp->PIOOffset		= 0;
     hwp->readEnable		= stdReadEnable;
     hwp->writeEnable		= stdWriteEnable;
+
+    hwp->io = pci_legacy_open_io(hwp->dev, 0, 64 * 1024);
 }
 
 /*
@@ -1719,7 +1720,9 @@ vgaHWFreeHWRec(ScrnInfoPtr scrp)
 	vgaHWPtr hwp = VGAHWPTR(scrp);
 
 	if (!hwp)
-	    return;
+            return;
+
+        pci_device_close_io(hwp->dev, hwp->io);
 
 	free(hwp->FontInfo1);
 	free(hwp->FontInfo2);
@@ -1789,8 +1792,7 @@ vgaHWGetIOBase(vgaHWPtr hwp)
     hwp->IOBase = (hwp->readMiscOut(hwp) & 0x01) ?
 				VGA_IOBASE_COLOR : VGA_IOBASE_MONO;
     xf86DrvMsgVerb(hwp->pScrn->scrnIndex, X_INFO, 3,
-	"vgaHWGetIOBase: hwp->IOBase is 0x%04x, hwp->PIOOffset is 0x%04lx\n",
-	hwp->IOBase, hwp->PIOOffset);
+	"vgaHWGetIOBase: hwp->IOBase is 0x%04x\n", hwp->IOBase);
 }
 
 
@@ -1995,11 +1997,12 @@ SaveScreenProcPtr vgaHWSaveScreenWeak(void)
 void
 xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
 	      void (*ProtectRegs)(ScrnInfoPtr, Bool),
-	      void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
+	      void (*BlankScreen)(ScrnInfoPtr, Bool), unsigned long vertsyncreg,
 	      int maskval, int knownclkindex, int knownclkvalue)
 {
     register int status = vertsyncreg;
     unsigned long i, cnt, rcnt, sync;
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
 
     /* First save registers that get written on */
     (*ClockFunc)(pScrn, CLK_REG_SAVE);
@@ -2026,22 +2029,22 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
 	cnt  = 0;
 	sync = 200000;
 
-	while ((inb(status) & maskval) == 0x00)
+	while ((pci_io_read8(hwp->io, status) & maskval) == 0x00)
 	    if (sync-- == 0) goto finish;
 	/* Something appears to be happening, so reset sync count */
 	sync = 200000;
-	while ((inb(status) & maskval) == maskval)
+	while ((pci_io_read8(hwp->io, status) & maskval) == maskval)
 	    if (sync-- == 0) goto finish;
 	/* Something appears to be happening, so reset sync count */
 	sync = 200000;
-	while ((inb(status) & maskval) == 0x00)
+	while ((pci_io_read8(hwp->io, status) & maskval) == 0x00)
 	    if (sync-- == 0) goto finish;
 
 	for (rcnt = 0; rcnt < 5; rcnt++)
 	{
-	    while (!(inb(status) & maskval))
+	    while (!(pci_io_read8(hwp->io, status) & maskval))
 		cnt++;
-	    while ((inb(status) & maskval))
+	    while ((pci_io_read8(hwp->io, status) & maskval))
 		cnt++;
 	}
 
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
index 12cfac0..e943aa3 100644
--- a/hw/xfree86/vgahw/vgaHW.h
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -151,17 +151,13 @@ typedef struct _vgaHWRec {
     vgaHWWriteProcPtr		writeDacData;
     vgaHWReadProcPtr		readDacData;
     pointer                     ddc;
-    IOADDRESS			PIOOffset;	/* offset + vgareg
-						   = pioreg */
+    struct pci_io_handle        *io;
     vgaHWReadProcPtr		readEnable;
     vgaHWWriteProcPtr		writeEnable;
     struct pci_device          *dev;
 } vgaHWRec;
 
 /* Some macros that VGA drivers can use in their ChipProbe() function */
-#define VGAHW_GET_IOBASE()	((inb(VGA_MISC_OUT_R) & 0x01) ?		      \
-					 VGA_IOBASE_COLOR : VGA_IOBASE_MONO)
-
 #define OVERSCAN 0x11		/* Index of OverScan register */
 
 /* Flags that define how overscan correction should take place */
@@ -174,15 +170,11 @@ typedef struct _vgaHWRec {
 #define BITS_PER_GUN 6
 #define COLORMAP_SIZE 256
 
-#if defined(__powerpc__) || defined(__arm__) || defined(__s390__) || defined(__nds32__)
-#define DACDelay(hw) /* No legacy VGA support */
-#else
-#define DACDelay(hw)							      \
-	do {								      \
-	    (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
-	    (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
+#define DACDelay(hw)							 \
+	do {								 \
+	    pci_io_read8((hw)->io, (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
+	    pci_io_read8((hw)->io, (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
 	} while (0)
-#endif
 
 /* Function Prototypes */
 
@@ -235,7 +227,7 @@ extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
 		   Bool (*ClockFunc)(ScrnInfoPtr, int),
 		   void (*ProtectRegs)(ScrnInfoPtr, Bool),
 		   void (*BlankScreen)(ScrnInfoPtr, Bool),
-		   IOADDRESS vertsyncreg, int maskval,
+		   unsigned long vertsyncreg, int maskval,
 		   int knownclkindex, int knownclkvalue);
 
 #endif /* _VGAHW_H */
commit e40d40dbc3c7b617b6204a00da07e80de415919b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Sep 22 13:45:57 2011 -0400

    vgahw: Don't default to standard (port space) access routines
    
    In fact, don't default to anything; drivers must explicitly say which
    kind they want, and they are strongly encouraged to do MMIO if possible.
    This is an ABI change in that drivers that don't will crash, but drivers
    that are explicit will work with both old and new servers.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 911bf07..9e934f6 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1706,9 +1706,6 @@ vgaHWGetHWRec(ScrnInfoPtr scrp)
     hwp->MapSize = 0;
     hwp->pScrn = scrp;
 
-    /* Initialise the function pointers with the standard VGA versions */
-    vgaHWSetStdFuncs(hwp);
-
     hwp->dev = xf86GetPciInfoForEntity(scrp->entityList[0]);
 
     return TRUE;
commit 413a61079142420edb3e2b3fce5db5bd9cf198ed
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Sep 22 13:44:53 2011 -0400

    vgahw: Remove IO domain setup
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 2ecea1c..911bf07 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1709,7 +1709,6 @@ vgaHWGetHWRec(ScrnInfoPtr scrp)
     /* Initialise the function pointers with the standard VGA versions */
     vgaHWSetStdFuncs(hwp);
 
-    hwp->PIOOffset = scrp->domainIOBase;
     hwp->dev = xf86GetPciInfoForEntity(scrp->entityList[0]);
 
     return TRUE;
commit 1f092357814e4093f135985daecbfd18aca771b6
Author: Adam Jackson <ajax at redhat.com>
Date:   Sat Sep 18 08:24:19 2010 -0400

    int10: Port to pciaccess' legacy IO API
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 9940854..beb90b5 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -297,7 +297,7 @@ MapVRam(xf86Int10InfoPtr pInt)
     INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
 					      pInt->dev, V_RAM, size);
 
-    pInt->ioBase = xf86Screens[pInt->scrnIndex]->domainIOBase;
+    pInt->io = pci_legacy_open_io(pInt->dev, 0, 64 * 1024);
 }
 
 static void
@@ -308,6 +308,9 @@ UnmapVRam(xf86Int10InfoPtr pInt)
     int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
 
     xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
+
+    pci_device_close_io(pInt->dev, pInt->io);
+    pInt->io = NULL;
 }
 
 Bool
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 44d8a7f..8b52e88 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -331,7 +331,7 @@ x_inb(CARD16 port)
 	}
 #endif /* __NOT_YET__ */
     } else if (!pciCfg1inb(port, &val)) {
-	val = inb(Int10Current->ioBase + port);
+	val = pci_io_read8(Int10Current->io, port);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" inb(%#x) = %2.2x\n", port, val);
     }
@@ -353,7 +353,7 @@ x_inw(CARD16 port)
 	X_GETTIMEOFDAY(&tv);
 	val = (CARD16)(tv.tv_usec / 3);
     } else if (!pciCfg1inw(port, &val)) {
-	val = inw(Int10Current->ioBase + port);
+	val = pci_io_read16(Int10Current->io, port);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" inw(%#x) = %4.4x\n", port, val);
     }
@@ -387,7 +387,7 @@ x_outb(CARD16 port, CARD8 val)
     } else if (!pciCfg1outb(port, val)) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" outb(%#x, %2.2x)\n", port, val);
-	outb(Int10Current->ioBase + port, val);
+	pci_io_write8(Int10Current->io, port, val);
     }
 }
 
@@ -398,7 +398,7 @@ x_outw(CARD16 port, CARD16 val)
     if (!pciCfg1outw(port, val)) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" outw(%#x, %4.4x)\n", port, val);
-	outw(Int10Current->ioBase + port, val);
+	pci_io_write16(Int10Current->io, port, val);
     }
 }
 
@@ -408,7 +408,7 @@ x_inl(CARD16 port)
     CARD32 val;
 
     if (!pciCfg1in(port, &val)) {
-	val = inl(Int10Current->ioBase + port);
+	val = pci_io_read32(Int10Current->io, port);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val);
     }
@@ -421,7 +421,7 @@ x_outl(CARD16 port, CARD32 val)
     if (!pciCfg1out(port, val)) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val);
-	outl(Int10Current->ioBase + port, val);
+	pci_io_write32(Int10Current->io, port, val);
     }
 }
 
@@ -650,29 +650,29 @@ bios_checksum(const CARD8 *start, int size)
 void
 LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
 {
-    vga->save_msr    = inb(pInt->ioBase + 0x03CC);
-    vga->save_vse    = inb(pInt->ioBase + 0x03C3);
+    vga->save_msr    = pci_io_read8(pInt->io, 0x03CC);
+    vga->save_vse    = pci_io_read8(pInt->io, 0x03C3);
 #ifndef __ia64__
-    vga->save_46e8   = inb(pInt->ioBase + 0x46E8);
+    vga->save_46e8   = pci_io_read8(pInt->io, 0x46E8);
 #endif
-    vga->save_pos102 = inb(pInt->ioBase + 0x0102);
-    outb(pInt->ioBase + 0x03C2, ~(CARD8)0x03 & vga->save_msr);
-    outb(pInt->ioBase + 0x03C3, ~(CARD8)0x01 & vga->save_vse);
+    vga->save_pos102 = pci_io_read8(pInt->io, 0x0102);
+    pci_io_write8(pInt->io, 0x03C2, ~(CARD8)0x03 & vga->save_msr);
+    pci_io_write8(pInt->io, 0x03C3, ~(CARD8)0x01 & vga->save_vse);
 #ifndef __ia64__
-    outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
+    pci_io_write8(pInt->io, 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
 #endif
-    outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
+    pci_io_write8(pInt->io, 0x0102, ~(CARD8)0x01 & vga->save_pos102);
 }
 
 void
 UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
 {
-    outb(pInt->ioBase + 0x0102, vga->save_pos102);
+    pci_io_write8(pInt->io, 0x0102, vga->save_pos102);
 #ifndef __ia64__
-    outb(pInt->ioBase + 0x46E8, vga->save_46e8);
+    pci_io_write8(pInt->io, 0x46E8, vga->save_46e8);
 #endif
-    outb(pInt->ioBase + 0x03C3, vga->save_vse);
-    outb(pInt->ioBase + 0x03C2, vga->save_msr);
+    pci_io_write8(pInt->io, 0x03C3, vga->save_vse);
+    pci_io_write8(pInt->io, 0x03C2, vga->save_msr);
 }
 
 #if defined (_PC)
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
index 51eb91f..dd00e54 100644
--- a/hw/xfree86/int10/xf86int10.c
+++ b/hw/xfree86/int10/xf86int10.c
@@ -84,7 +84,7 @@ int42_handler(xf86Int10InfoPtr pInt)
 	/* Leave:  Nothing                                    */
 	/* Implemented (except for clearing the screen)       */
 	{                                         /* Localise */
-	    IOADDRESS ioport;
+	    unsigned int ioport;
 	    int i;
 	    CARD16 int1d, regvals, tmp;
 	    CARD8 mode, cgamode, cgacolour;
@@ -172,18 +172,15 @@ int42_handler(xf86Int10InfoPtr pInt)
 	    /* Rows */
 	    MEM_WB(pInt, 0x0484, (25 - 1));
 
-	    /* Remap I/O port number into its domain */
-	    ioport += pInt->ioBase;
-
-	    /* Programme the mode */
-	    outb(ioport + 4, cgamode & 0x37);   /* Turn off screen */
+	    /* Program the mode */
+	    pci_io_write8(pInt->io, ioport + 4, cgamode & 0x37);   /* Turn off screen */
 	    for (i = 0; i < 0x10; i++) {
 		tmp = MEM_RB(pInt, regvals + i);
-		outb(ioport, i);
-		outb(ioport + 1, tmp);
+		pci_io_write8(pInt->io, ioport, i);
+		pci_io_write8(pInt->io, ioport + 1, tmp);
 	    }
-	    outb(ioport + 5, cgacolour);        /* Select colour mode */
-	    outb(ioport + 4, cgamode);          /* Turn on screen */
+	    pci_io_write8(pInt->io, ioport + 5, cgacolour);        /* Select colour mode */
+	    pci_io_write8(pInt->io, ioport + 4, cgamode);          /* Turn on screen */
 	}
 	break;
 
@@ -194,15 +191,15 @@ int42_handler(xf86Int10InfoPtr pInt)
 	/* Leave:  Nothing                                    */
 	/* Implemented                                        */
 	{                                         /* Localise */
-	    IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
+	    unsigned int ioport = MEM_RW(pInt, 0x0463);
 
 	    MEM_WB(pInt, 0x0460, X86_CL);
 	    MEM_WB(pInt, 0x0461, X86_CH);
 
-	    outb(ioport, 0x0A);
-	    outb(ioport + 1, X86_CH);
-	    outb(ioport, 0x0B);
-	    outb(ioport + 1, X86_CL);
+	    pci_io_write8(pInt->io, ioport, 0x0A);
+	    pci_io_write8(pInt->io, ioport + 1, X86_CH);
+	    pci_io_write8(pInt->io, ioport, 0x0B);
+	    pci_io_write8(pInt->io, ioport + 1, X86_CL);
 	}
 	break;
 
@@ -214,7 +211,7 @@ int42_handler(xf86Int10InfoPtr pInt)
 	/* Leave:  Nothing                                    */
 	/* Implemented                                        */
 	{                                         /* Localise */
-	    IOADDRESS ioport;
+	    unsigned int ioport;
 	    CARD16 offset;
 
 	    MEM_WB(pInt, (X86_BH << 1) + 0x0450, X86_DL);
@@ -226,11 +223,11 @@ int42_handler(xf86Int10InfoPtr pInt)
 	    offset = (X86_DH * MEM_RW(pInt, 0x044A)) + X86_DL;
 	    offset += MEM_RW(pInt, 0x044E) << 1;
 
-	    ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
-	    outb(ioport, 0x0E);
-	    outb(ioport + 1, offset >> 8);
-	    outb(ioport, 0x0F);
-	    outb(ioport + 1, offset & 0xFF);
+	    ioport = MEM_RW(pInt, 0x0463);
+	    pci_io_write8(pInt->io, ioport, 0x0E);
+	    pci_io_write8(pInt->io, ioport + 1, offset >> 8);
+	    pci_io_write8(pInt->io, ioport, 0x0F);
+	    pci_io_write8(pInt->io, ioport + 1, offset & 0xFF);
 	}
 	break;
 
@@ -276,7 +273,7 @@ int42_handler(xf86Int10InfoPtr pInt)
 	/* Leave:  Nothing                                    */
 	/* Implemented                                        */
 	{                                         /* Localise */
-	    IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
+	    unsigned int ioport = MEM_RW(pInt, 0x0463);
 	    CARD16 start;
 	    CARD8 x, y;
 
@@ -287,10 +284,10 @@ int42_handler(xf86Int10InfoPtr pInt)
 	    start <<= 1;
 
 	    /* Update start address */
-	    outb(ioport, 0x0C);
-	    outb(ioport + 1, start >> 8);
-	    outb(ioport, 0x0D);
-	    outb(ioport + 1, start & 0xFF);
+	    pci_io_write8(pInt->io, ioport, 0x0C);
+	    pci_io_write8(pInt->io, ioport + 1, start >> 8);
+	    pci_io_write8(pInt->io, ioport, 0x0D);
+	    pci_io_write8(pInt->io, ioport + 1, start & 0xFF);
 
 	    /* Switch cursor position */
 	    y = MEM_RB(pInt, (X86_AL << 1) + 0x0450);
@@ -298,10 +295,10 @@ int42_handler(xf86Int10InfoPtr pInt)
 	    start += (y * MEM_RW(pInt, 0x044A)) + x;
 
 	    /* Update cursor position */
-	    outb(ioport, 0x0E);
-	    outb(ioport + 1, start >> 8);
-	    outb(ioport, 0x0F);
-	    outb(ioport + 1, start & 0xFF);
+	    pci_io_write8(pInt->io, ioport, 0x0E);
+	    pci_io_write8(pInt->io, ioport + 1, start >> 8);
+	    pci_io_write8(pInt->io, ioport, 0x0F);
+	    pci_io_write8(pInt->io, ioport + 1, start & 0xFF);
 	}
 	break;
 
@@ -426,7 +423,7 @@ int42_handler(xf86Int10InfoPtr pInt)
 	/* Leave:  Nothing                                    */
 	/* Implemented                                        */
 	{                                         /* Localise */
-	    IOADDRESS ioport = MEM_RW(pInt, 0x0463) + 5 + pInt->ioBase;
+	    unsigned int ioport = MEM_RW(pInt, 0x0463) + 5;
 	    CARD8 cgacolour = MEM_RB(pInt, 0x0466);
 
 	    if (X86_BH) {
@@ -438,7 +435,7 @@ int42_handler(xf86Int10InfoPtr pInt)
 	    }
 
 	    MEM_WB(pInt, 0x0466, cgacolour);
-	    outb(ioport, cgacolour);
+	    pci_io_write8(pInt->io, ioport, cgacolour);
 	}
 	break;
 
diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h
index ba9ee52..5bf326e 100644
--- a/hw/xfree86/int10/xf86int10.h
+++ b/hw/xfree86/int10/xf86int10.h
@@ -41,7 +41,7 @@ typedef struct {
     int flags;
     int stackseg;
     struct pci_device *dev;
-    IOADDRESS ioBase;
+    struct pci_io_handle *io;
 } xf86Int10InfoRec, *xf86Int10InfoPtr;
 
 typedef struct _int10Mem {
commit 8d33f1cad174b8b10d182cdb51b736689c48e91e
Author: Adam Jackson <ajax at redhat.com>
Date:   Sat Sep 18 08:05:11 2010 -0400

    xfree86: Move xf86GetClocks to vgahw
    
    This is really a vga-specific hack anyway.  The only modern driver that
    uses it is trident, but it's already loaded vgahw by the time it would
    call xf86GetClocks.
    
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index e1e0cd7..b1a5ab2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -239,12 +239,6 @@ extern _X_EXPORT void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
 extern _X_EXPORT void xf86PrintChipsets(const char *drvname, const char *drvmsg,
 		       SymTabPtr chips);
 extern _X_EXPORT int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
-extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
-		   Bool (*ClockFunc)(ScrnInfoPtr, int),
-		   void (*ProtectRegs)(ScrnInfoPtr, Bool),
-		   void (*BlankScreen)(ScrnInfoPtr, Bool),
-		   IOADDRESS vertsyncreg, int maskval,
-		   int knownclkindex, int knownclkvalue);
 extern _X_EXPORT const char *xf86GetVisualName(int visual);
 extern _X_EXPORT int xf86GetVerbosity(void);
 extern _X_EXPORT Pix24Flags xf86GetPix24(void);
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 7c76fa8..c410f1a 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1366,96 +1366,6 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
     return i;
 }
 
-/*
- * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
- */
-void
-xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
-	      void (*ProtectRegs)(ScrnInfoPtr, Bool),
-	      void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
-	      int maskval, int knownclkindex, int knownclkvalue)
-{
-    register int status = vertsyncreg;
-    unsigned long i, cnt, rcnt, sync;
-
-    /* First save registers that get written on */
-    (*ClockFunc)(pScrn, CLK_REG_SAVE);
-
-    if (num > MAXCLOCKS)
-	num = MAXCLOCKS;
-
-    for (i = 0; i < num; i++)
-    {
-	if (ProtectRegs)
-	    (*ProtectRegs)(pScrn, TRUE);
-	if (!(*ClockFunc)(pScrn, i))
-	{
-	    pScrn->clock[i] = -1;
-	    continue;
-	}
-	if (ProtectRegs)
-	    (*ProtectRegs)(pScrn, FALSE);
-	if (BlankScreen)
-	    (*BlankScreen)(pScrn, FALSE);
-
-    	usleep(50000);     /* let VCO stabilise */
-
-    	cnt  = 0;
-    	sync = 200000;
-
-	while ((inb(status) & maskval) == 0x00)
-	    if (sync-- == 0) goto finish;
-	/* Something appears to be happening, so reset sync count */
-	sync = 200000;
-	while ((inb(status) & maskval) == maskval)
-	    if (sync-- == 0) goto finish;
-	/* Something appears to be happening, so reset sync count */
-	sync = 200000;
-	while ((inb(status) & maskval) == 0x00)
-	    if (sync-- == 0) goto finish;
-
-	for (rcnt = 0; rcnt < 5; rcnt++)
-	{
-	    while (!(inb(status) & maskval))
-		cnt++;
-	    while ((inb(status) & maskval))
-		cnt++;
-	}
-
-finish:
-	pScrn->clock[i] = cnt ? cnt : -1;
-	if (BlankScreen)
-            (*BlankScreen)(pScrn, TRUE);
-    }
-
-    for (i = 0; i < num; i++)
-    {
-	if (i != knownclkindex)
-	{
-	    if (pScrn->clock[i] == -1)
-	    {
-		pScrn->clock[i] = 0;
-	    }
-	    else
-	    {
-		pScrn->clock[i] = (int)(0.5 +
-                    (((float)knownclkvalue) * pScrn->clock[knownclkindex]) /
-	            (pScrn->clock[i]));
-		/* Round to nearest 10KHz */
-		pScrn->clock[i] += 5;
-		pScrn->clock[i] /= 10;
-		pScrn->clock[i] *= 10;
-	    }
-	}
-    }
-
-    pScrn->clock[knownclkindex] = knownclkvalue;
-    pScrn->numClocks = num;
-
-    /* Restore registers that were written on */
-    (*ClockFunc)(pScrn, CLK_REG_RESTORE);
-}
-
 const char *
 xf86GetVisualName(int visual)
 {
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index ee045d1..2ecea1c 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1992,3 +1992,93 @@ SaveScreenProcPtr vgaHWSaveScreenWeak(void)
 {
     return vgaHWSaveScreen;
 }
+
+/*
+ * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
+ */
+void
+xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
+	      void (*ProtectRegs)(ScrnInfoPtr, Bool),
+	      void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
+	      int maskval, int knownclkindex, int knownclkvalue)
+{
+    register int status = vertsyncreg;
+    unsigned long i, cnt, rcnt, sync;
+
+    /* First save registers that get written on */
+    (*ClockFunc)(pScrn, CLK_REG_SAVE);
+
+    if (num > MAXCLOCKS)
+	num = MAXCLOCKS;
+
+    for (i = 0; i < num; i++)
+    {
+	if (ProtectRegs)
+	    (*ProtectRegs)(pScrn, TRUE);
+	if (!(*ClockFunc)(pScrn, i))
+	{
+	    pScrn->clock[i] = -1;
+	    continue;
+	}
+	if (ProtectRegs)
+	    (*ProtectRegs)(pScrn, FALSE);
+	if (BlankScreen)
+	    (*BlankScreen)(pScrn, FALSE);
+
+	usleep(50000);     /* let VCO stabilise */
+
+	cnt  = 0;
+	sync = 200000;
+
+	while ((inb(status) & maskval) == 0x00)
+	    if (sync-- == 0) goto finish;
+	/* Something appears to be happening, so reset sync count */
+	sync = 200000;
+	while ((inb(status) & maskval) == maskval)
+	    if (sync-- == 0) goto finish;
+	/* Something appears to be happening, so reset sync count */
+	sync = 200000;
+	while ((inb(status) & maskval) == 0x00)
+	    if (sync-- == 0) goto finish;
+
+	for (rcnt = 0; rcnt < 5; rcnt++)
+	{
+	    while (!(inb(status) & maskval))
+		cnt++;
+	    while ((inb(status) & maskval))
+		cnt++;
+	}
+
+finish:
+	pScrn->clock[i] = cnt ? cnt : -1;
+	if (BlankScreen)
+            (*BlankScreen)(pScrn, TRUE);
+    }
+
+    for (i = 0; i < num; i++)
+    {
+	if (i != knownclkindex)
+	{
+	    if (pScrn->clock[i] == -1)
+	    {
+		pScrn->clock[i] = 0;
+	    }
+	    else
+	    {
+		pScrn->clock[i] = (int)(0.5 +
+                    (((float)knownclkvalue) * pScrn->clock[knownclkindex]) /
+	            (pScrn->clock[i]));
+		/* Round to nearest 10KHz */
+		pScrn->clock[i] += 5;
+		pScrn->clock[i] /= 10;
+		pScrn->clock[i] *= 10;
+	    }
+	}
+    }
+
+    pScrn->clock[knownclkindex] = knownclkvalue;
+    pScrn->numClocks = num;
+
+    /* Restore registers that were written on */
+    (*ClockFunc)(pScrn, CLK_REG_RESTORE);
+}
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
index b31c007..12cfac0 100644
--- a/hw/xfree86/vgahw/vgaHW.h
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -231,5 +231,11 @@ extern _X_EXPORT Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
 
 extern _X_EXPORT DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void);
 extern _X_EXPORT SaveScreenProcPtr vgaHWSaveScreenWeak(void);
+extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
+		   Bool (*ClockFunc)(ScrnInfoPtr, int),
+		   void (*ProtectRegs)(ScrnInfoPtr, Bool),
+		   void (*BlankScreen)(ScrnInfoPtr, Bool),
+		   IOADDRESS vertsyncreg, int maskval,
+		   int knownclkindex, int knownclkvalue);
 
 #endif /* _VGAHW_H */
commit 09b3469dfcb390a75fbaf8ce377d30a86d6f14c3
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Sep 20 20:39:06 2011 -0700

    XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 7fd7dab..12ff53c 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -356,7 +356,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                          */
                         _appFlags._active = YES;
 
-                        X11ApplicationSetFrontProcess();
+                        [self set_front_process:nil];
 
                         /* Get the Spaces preference for SwitchOnActivate */
                         (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
commit 3a8668c1dc99c11348817261b0d876bc51aed750
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu Sep 22 18:55:19 2011 -0700

    Address regressions from e8ff555b95baab66cc7d060c1e7f9fdd49d3802f
    
    The error attribute appeared in gcc-4.3
    The return type of __builtin_constant_p is int
    
    Found by Tinderbox.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/include/misc.h b/include/misc.h
index 1fea73e..b583e31 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -261,18 +261,22 @@ version_compare(uint16_t a_major, uint16_t a_minor,
 #define SwapRestL(stuff) \
     SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
 void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void);
 #else
 static inline void wrong_size(void)
 {
 }
+#endif
 
-static inline void __builtin_constant_p(int x)
+static inline int constant_p(int x)
 {
+#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+	return __builtin_constant_p(x);
+#else
 	return 0;
-}
 #endif
+}
 
 /* byte swap a 32-bit value */
 static inline void swap_uint32(uint32_t *x)
@@ -288,7 +292,7 @@ static inline void swap_uint32(uint32_t *x)
 #define swapl(x) do { \
 		if (sizeof(*(x)) != 4) \
 			wrong_size(); \
-		if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \
+		if (constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \
 			*(x) = lswapl(*(x)); \
 		else \
 			swap_uint32((uint32_t *)(x)); \
@@ -305,7 +309,7 @@ static inline void swap_uint16(uint16_t *x)
 #define swaps(x) do { \
 		if (sizeof(*(x)) != 2) \
 			wrong_size(); \
-		if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \
+		if (constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \
 			*(x) = lswaps(*(x)); \
 		else \
 			swap_uint16((uint16_t *)(x)); \
commit 7fb4bef0394a5d09680985d34bce8252b61493cb
Merge: 98f4940... c90903b...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Sep 21 14:34:27 2011 -0700

    Merge remote-tracking branch 'mattst88/for-keith'

commit c90903b4f7a826ae6826a8dd0a901c8362500e46
Author: Peter Harris <pharris at opentext.com>
Date:   Fri Sep 2 18:45:16 2011 -0400

    xkb: add missing swaps for xkbGetDeviceInfoReply
    
    Caught during review of e095369bf.
    
    Signed-off-by: Peter Harris <pharris at opentext.com>
    Reviewed-by-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 0b85953..ac0b427 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -6190,6 +6190,9 @@ char *			str;
 	swaps(&rep.supported);
 	swaps(&rep.unsupported);
 	swaps(&rep.nDeviceLedFBs);
+	swaps(&rep.dfltKbdFB);
+	swaps(&rep.dfltLedFB);
+	swapl(&rep.devType);
     }
     WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
 
commit d206d52f657cb63a0f6ba8b62d788c1812b57c81
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 19:19:24 2011 -0400

    Use __builtin_constant_p to determine if we can use lswapl
    
    If the address of the swapped memory location is known at compile time,
    we can check its alignment at no runtime cost and use lswapl instead.
    
               text   data    bss      dec     hex  filename
    before: 1872820  52136  78040  2002996  1e9034  hw/xfree86/Xorg
    after:  1864396  52136  78040  1994572  1e6f4c  hw/xfree86/Xorg
    
    bswap instructions: 131 ->  308 (used in lswapl)
    rol instructions:   943 -> 1174 (used in lswaps)
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index fb235ed..1fea73e 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -267,6 +267,11 @@ void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(vo
 static inline void wrong_size(void)
 {
 }
+
+static inline void __builtin_constant_p(int x)
+{
+	return 0;
+}
 #endif
 
 /* byte swap a 32-bit value */
@@ -283,7 +288,10 @@ static inline void swap_uint32(uint32_t *x)
 #define swapl(x) do { \
 		if (sizeof(*(x)) != 4) \
 			wrong_size(); \
-		swap_uint32((uint32_t *)(x)); \
+		if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \
+			*(x) = lswapl(*(x)); \
+		else \
+			swap_uint32((uint32_t *)(x)); \
 	} while (0)
 
 /* byte swap a 16-bit value */
@@ -297,7 +305,10 @@ static inline void swap_uint16(uint16_t *x)
 #define swaps(x) do { \
 		if (sizeof(*(x)) != 2) \
 			wrong_size(); \
-		swap_uint16((uint16_t *)(x)); \
+		if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \
+			*(x) = lswaps(*(x)); \
+		else \
+			swap_uint16((uint16_t *)(x)); \
 	} while (0)
 
 /* copy 32-bit value from src to dst byteswapping on the way */
commit 889b700e7760ced38bcf5f3aff2d31d3d9a058d7
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 19:12:21 2011 -0400

    Use lswap{l,s} in cpswap{l,s}
    
    Should be safe since cpswap isn't used on pointers.
    
               text   data    bss      dec     hex  filename
    before: 1875588  52136  78040  2005764  1e9b04  hw/xfree86/Xorg
    after:  1872820  52136  78040  2002996  1e9034  hw/xfree86/Xorg
    
    bswap instructions:   5 -> 131 (used in lswapl)
    rol instructions:   811 -> 943 (used in lswaps)
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index 096a31a..fb235ed 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -301,20 +301,18 @@ static inline void swap_uint16(uint16_t *x)
 	} while (0)
 
 /* copy 32-bit value from src to dst byteswapping on the way */
-#define cpswapl(src, dst) { \
+#define cpswapl(src, dst) do { \
 		if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
 			wrong_size(); \
-                 ((char *)&(dst))[0] = ((char *) &(src))[3];\
-                 ((char *)&(dst))[1] = ((char *) &(src))[2];\
-                 ((char *)&(dst))[2] = ((char *) &(src))[1];\
-                 ((char *)&(dst))[3] = ((char *) &(src))[0]; }
+		(dst) = lswapl((src)); \
+	} while (0)
 
 /* copy short from src to dst byteswapping on the way */
-#define cpswaps(src, dst) { \
+#define cpswaps(src, dst) do { \
 		if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
 			wrong_size(); \
-		 ((char *) &(dst))[0] = ((char *) &(src))[1];\
-		 ((char *) &(dst))[1] = ((char *) &(src))[0]; }
+		(dst) = lswaps((src)); \
+	} while (0)
 
 extern _X_EXPORT void SwapLongs(
     CARD32 *list,
commit a2f0ff5f73db204a9d61e65148b28f6acc5121df
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 19:30:20 2011 -0400

    Make lswap{l,s} inline functions
    
               text   data    bss      dec     hex  filename
    before: 1875668  52136  78040  2005844  1e9b54  hw/xfree86/Xorg
    after:  1875588  52136  78040  2005764  1e9b04  hw/xfree86/Xorg
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index ac27a81..096a31a 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -122,13 +122,19 @@ typedef struct _xReq *xReqPtr;
 
 
 /* byte swap a 32-bit literal */
-#define lswapl(x) ((((x) & 0xff) << 24) |\
-		   (((x) & 0xff00) << 8) |\
-		   (((x) & 0xff0000) >> 8) |\
-		   (((x) >> 24) & 0xff))
+static inline uint32_t lswapl(uint32_t x)
+{
+	return  ((x & 0xff) << 24) |
+		((x & 0xff00) << 8) |
+		((x & 0xff0000) >> 8) |
+		((x >> 24) & 0xff);
+}
 
-/* byte swap a short literal */
-#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
+/* byte swap a 16-bit literal */
+static inline uint16_t lswaps(uint16_t x)
+{
+	return ((x & 0xff) << 8) | ((x >> 8) & 0xff);
+}
 
 #undef min
 #undef max
commit e8ff555b95baab66cc7d060c1e7f9fdd49d3802f
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 19:07:24 2011 -0400

    Add type checking to swap macros
    
    The original macros are retained (instead of replacing them with inline
    functions) because of implicit type promotion. That is, an int16 passed
    to an inline function taking int32 would be implicitly promoted to int32
    without a warning.
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index 99046ae..ac27a81 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -255,6 +255,14 @@ version_compare(uint16_t a_major, uint16_t a_minor,
 #define SwapRestL(stuff) \
     SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
 
+#ifdef __GNUC__
+void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void);
+#else
+static inline void wrong_size(void)
+{
+}
+#endif
+
 /* byte swap a 32-bit value */
 static inline void swap_uint32(uint32_t *x)
 {
@@ -267,6 +275,8 @@ static inline void swap_uint32(uint32_t *x)
 }
 
 #define swapl(x) do { \
+		if (sizeof(*(x)) != 4) \
+			wrong_size(); \
 		swap_uint32((uint32_t *)(x)); \
 	} while (0)
 
@@ -279,11 +289,15 @@ static inline void swap_uint16(uint16_t *x)
 }
 
 #define swaps(x) do { \
+		if (sizeof(*(x)) != 2) \
+			wrong_size(); \
 		swap_uint16((uint16_t *)(x)); \
 	} while (0)
 
 /* copy 32-bit value from src to dst byteswapping on the way */
 #define cpswapl(src, dst) { \
+		if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
+			wrong_size(); \
                  ((char *)&(dst))[0] = ((char *) &(src))[3];\
                  ((char *)&(dst))[1] = ((char *) &(src))[2];\
                  ((char *)&(dst))[2] = ((char *) &(src))[1];\
@@ -291,6 +305,8 @@ static inline void swap_uint16(uint16_t *x)
 
 /* copy short from src to dst byteswapping on the way */
 #define cpswaps(src, dst) { \
+		if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
+			wrong_size(); \
 		 ((char *) &(dst))[0] = ((char *) &(src))[1];\
 		 ((char *) &(dst))[1] = ((char *) &(src))[0]; }
 
commit 893e86a49e3e381cff48a9e86dc2d9b3d5431d95
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 19:03:26 2011 -0400

    Introduce swap_uint{16,32} functions, used in swap{l,s}
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index cca30d2..99046ae 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -256,20 +256,30 @@ version_compare(uint16_t a_major, uint16_t a_minor,
     SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
 
 /* byte swap a 32-bit value */
+static inline void swap_uint32(uint32_t *x)
+{
+	char n = ((char *) &x)[0];
+	((char *) x)[0] = ((char *) x)[3];
+	((char *) x)[3] = n;
+	n = ((char *) x)[1];
+	((char *) x)[1] = ((char *) x)[2];
+	((char *) x)[2] = n;
+}
+
 #define swapl(x) do { \
-		 char n = ((char *) (x))[0];\
-		 ((char *) (x))[0] = ((char *) (x))[3];\
-		 ((char *) (x))[3] = n;\
-		 n = ((char *) (x))[1];\
-		 ((char *) (x))[1] = ((char *) (x))[2];\
-		 ((char *) (x))[2] = n;\
+		swap_uint32((uint32_t *)(x)); \
 	} while (0)
 
-/* byte swap a short */
+/* byte swap a 16-bit value */
+static inline void swap_uint16(uint16_t *x)
+{
+	char  n = ((char *) x)[0];
+	((char *) x)[0] = ((char *) x)[1];
+	((char *) x)[1] = n;
+}
+
 #define swaps(x) do { \
-		 char  n = ((char *) (x))[0];\
-		 ((char *) (x))[0] = ((char *) (x))[1];\
-		 ((char *) (x))[1] = n;\
+		swap_uint16((uint16_t *)(x)); \
 	} while (0)
 
 /* copy 32-bit value from src to dst byteswapping on the way */
commit 54770c980cd2b91a8377f975a58ed69def5cfa42
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 16 16:59:07 2011 -0400

    Cast char* buffers to swap functions
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/dix/swaprep.c b/dix/swaprep.c
index a02333d..28c354c 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -397,9 +397,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
      * they are always 2 4 byte values */
     for(i = 0; i < nprops; i++)
     {
-	swapl(pby);
+	swapl((int *)pby);
 	pby += 4;
-	swapl(pby);
+	swapl((int *)pby);
 	pby += 4;
     }
     if (hasGlyphs)
diff --git a/render/render.c b/render/render.c
index facc32a..cc13dbc 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2375,7 +2375,7 @@ SProcRenderCompositeGlyphs (ClientPtr client)
 	i = elt->len;
 	if (i == 0xff)
 	{
-	    swapl(buffer);
+	    swapl((int *)buffer);
 	    buffer += 4;
 	}
 	else
@@ -2388,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client)
 	    case 2:
 		while (i--)
 		{
-		    swaps(buffer);
+		    swaps((short *)buffer);
 		    buffer += 2;
 		}
 		break;
 	    case 4:
 		while (i--)
 		{
-		    swapl(buffer);
+		    swapl((int *)buffer);
 		    buffer += 4;
 		}
 		break;
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 8e42a7f..0b85953 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -1109,7 +1109,7 @@ register unsigned	i;
 	    register int nSyms= outMap->nSyms;
 	    swaps(&outMap->nSyms);
 	    while (nSyms-->0) {
-		swapl(buf);
+		swapl((int *)buf);
 		buf+= 4;
 	    }
 	}
@@ -3646,21 +3646,21 @@ char *			desc;
         if (which&XkbKeycodesNameMask) {
             *((CARD32 *)desc)= xkb->names->keycodes;
             if (client->swapped) {
-                swapl(desc);
+                swapl((int *)desc);
             }
             desc+= 4;
         }
         if (which&XkbGeometryNameMask)  {
             *((CARD32 *)desc)= xkb->names->geometry;
             if (client->swapped) {
-                swapl(desc);
+                swapl((int *)desc);
             }
             desc+= 4;
         }
         if (which&XkbSymbolsNameMask) {
             *((CARD32 *)desc)= xkb->names->symbols;
             if (client->swapped) {
-                swapl(desc);
+                swapl((int *)desc);
             }
             desc+= 4;
         }
@@ -3675,14 +3675,14 @@ char *			desc;
         if (which&XkbTypesNameMask) {
             *((CARD32 *)desc)= (CARD32)xkb->names->types;
             if (client->swapped) {
-                swapl(desc);
+                swapl((int *)desc);
             }
             desc+= 4;
         }
         if (which&XkbCompatNameMask) {
             *((CARD32 *)desc)= (CARD32)xkb->names->compat;
             if (client->swapped) {
-                swapl(desc);
+                swapl((int *)desc);
             }
             desc+= 4;
         }
commit 9edcae78c46286baff42e74bfe26f6ae4d00fe01
Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Sep 21 17:14:16 2011 -0400

    Use correct swap{l,s} (or none at all for CARD8)
    
    Swapping the wrong size was never caught because swap{l,s} are macros.
    
    It's clear in the case of Xext/xres.c, that the author believed
    client_major/minor to be CARD16 from looking at the code in the first
    hunk.
    
    v2: dmx.c fixes from Keith.
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/Xext/saver.c b/Xext/saver.c
index 9e91b71..142758c 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1443,7 +1443,6 @@ SProcScreenSaverSuspend (ClientPtr client)
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
-    swapl(&stuff->suspend);
     return ProcScreenSaverSuspend (client);
 }
 
diff --git a/Xext/xres.c b/Xext/xres.c
index 9df12ae..b952728 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -28,15 +28,9 @@ ProcXResQueryVersion (ClientPtr client)
 {
     REQUEST(xXResQueryVersionReq);
     xXResQueryVersionReply rep;
-    CARD16 client_major, client_minor;  /* not used */
 
     REQUEST_SIZE_MATCH (xXResQueryVersionReq);
 
-    client_major = stuff->client_major;
-    client_minor = stuff->client_minor;
-    (void) client_major;
-    (void) client_minor;
-
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
@@ -316,8 +310,6 @@ SProcXResQueryVersion (ClientPtr client)
 {
     REQUEST(xXResQueryVersionReq);
     REQUEST_SIZE_MATCH (xXResQueryVersionReq);
-    swaps(&stuff->client_major);
-    swaps(&stuff->client_minor);
     return ProcXResQueryVersion(client);
 }
 
@@ -326,7 +318,7 @@ SProcXResQueryClientResources (ClientPtr client)
 {
     REQUEST(xXResQueryClientResourcesReq);
     REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
-    swaps(&stuff->xid);
+    swapl(&stuff->xid);
     return ProcXResQueryClientResources(client);
 }
 
@@ -335,7 +327,7 @@ SProcXResQueryClientPixmapBytes (ClientPtr client)
 {
     REQUEST(xXResQueryClientPixmapBytesReq);
     REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
-    swaps(&stuff->xid);
+    swapl(&stuff->xid);
     return ProcXResQueryClientPixmapBytes(client);
 }
 
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index 4287028..6090b81 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.c
@@ -127,7 +127,6 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
     if (client->swapped) {
         swaps(&c->control);
         swaps(&c->length);
-        swaps(&c->status);
     }
 }
 
@@ -142,7 +141,6 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
     if (client->swapped) {
         swaps(&e->control);
         swaps(&e->length);
-        swaps(&e->enable);
     }
 }
 
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index f2bd8bb..614d231 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -434,7 +434,7 @@ ProcXIChangeHierarchy(ClientPtr client)
     any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
     while(stuff->num_changes--)
     {
-        SWAPIF(swapl(&any->type));
+        SWAPIF(swaps(&any->type));
         SWAPIF(swaps(&any->length));
 
         required_len += any->length;
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index f5fca0d..902eb91 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -281,7 +281,7 @@ SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
     swaps(&info->sourceid);
 
     for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
-        swaps(btn);
+        swapl(btn);
 
     swaps(&info->num_buttons);
 }
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
index c05bd52..01a7448 100644
--- a/hw/dmx/dmx.c
+++ b/hw/dmx/dmx.c
@@ -653,10 +653,10 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client)
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swapl(&rep.width);
-        swapl(&rep.height);
-        swapl(&rep.shiftX);
-        swapl(&rep.shiftY);
+        swaps(&rep.width);
+        swaps(&rep.height);
+        swaps(&rep.shiftX);
+        swaps(&rep.shiftY);
     }
     WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
     return Success;
@@ -891,7 +891,7 @@ static int SProcDMXForceWindowCreation(ClientPtr client)
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
-    swaps(&stuff->window);
+    swapl(&stuff->window);
     return ProcDMXForceWindowCreation(client);
 }
 
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 46ff3bf..6d3d5fc 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -464,7 +464,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
 	    swaps(&mdinf.hsyncstart);
 	    swaps(&mdinf.hsyncend);
 	    swaps(&mdinf.htotal);
-	    swaps(&mdinf.hskew);
+	    swapl(&mdinf.hskew);
 	    swaps(&mdinf.vdisplay);
 	    swaps(&mdinf.vsyncstart);
 	    swaps(&mdinf.vsyncend);
@@ -1846,7 +1846,7 @@ SProcXF86VidModeSwitchToMode(ClientPtr client)
     REQUEST(xXF86VidModeSwitchToModeReq);
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
-    swaps(&stuff->screen);
+    swapl(&stuff->screen);
     return ProcXF86VidModeSwitchToMode(client);
 }
 
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index a8b73d9..e6a38ae 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1117,7 +1117,7 @@ ProcRRGetPanning (ClientPtr client)
     if (client->swapped) {
 	swaps(&rep.sequenceNumber);
 	swapl(&rep.length);
-	swaps(&rep.timestamp);
+	swapl(&rep.timestamp);
 	swaps(&rep.left);
 	swaps(&rep.top);
 	swaps(&rep.width);
@@ -1197,7 +1197,7 @@ sendReply:
     if (client->swapped) {
 	swaps(&rep.sequenceNumber);
 	swapl(&rep.length);
-	swaps(&rep.newTimestamp);
+	swapl(&rep.newTimestamp);
     }
     WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
     return Success;
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 9ae9b9e..8e42a7f 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -6190,7 +6190,6 @@ char *			str;
 	swaps(&rep.supported);
 	swaps(&rep.unsupported);
 	swaps(&rep.nDeviceLedFBs);
-	swapl(&rep.type);
     }
     WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
 
commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8
Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Aug 4 15:35:41 2011 -0400

    Use internal temp variable for swap macros
    
    Also, fix whitespace, mainly around
    	swaps(&rep.sequenceNumber)
    
    Reviewed-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/Xext/bigreq.c b/Xext/bigreq.c
index a540bcb..a939e16 100644
--- a/Xext/bigreq.c
+++ b/Xext/bigreq.c
@@ -47,10 +47,9 @@ ProcBigReqDispatch (ClientPtr client)
 {
     REQUEST(xBigReqEnableReq);
     xBigReqEnableReply rep;
-     int n;
 
     if (client->swapped) {
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
     }
     if (stuff->brReqType != X_BigReqEnable)
 	return BadRequest;
@@ -62,8 +61,8 @@ ProcBigReqDispatch (ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.max_request_size = maxBigRequestSize;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.max_request_size, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.max_request_size);
     }
     WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
     return Success;
diff --git a/Xext/dpms.c b/Xext/dpms.c
index 33a6e26..0c8f18f 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -46,7 +46,6 @@ ProcDPMSGetVersion(ClientPtr client)
 {
     /* REQUEST(xDPMSGetVersionReq); */
     xDPMSGetVersionReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
 
@@ -56,9 +55,9 @@ ProcDPMSGetVersion(ClientPtr client)
     rep.majorVersion = DPMSMajorVersion;
     rep.minorVersion = DPMSMinorVersion;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
     return Success;
@@ -69,7 +68,6 @@ ProcDPMSCapable(ClientPtr client)
 {
     /* REQUEST(xDPMSCapableReq); */
     xDPMSCapableReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xDPMSCapableReq);
 
@@ -79,7 +77,7 @@ ProcDPMSCapable(ClientPtr client)
     rep.capable = DPMSCapableFlag;
 
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
+	swaps(&rep.sequenceNumber);
     }
     WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
     return Success;
@@ -90,7 +88,6 @@ ProcDPMSGetTimeouts(ClientPtr client)
 {
     /* REQUEST(xDPMSGetTimeoutsReq); */
     xDPMSGetTimeoutsReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
 
@@ -102,10 +99,10 @@ ProcDPMSGetTimeouts(ClientPtr client)
     rep.off = DPMSOffTime / MILLI_PER_SECOND;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.standby, n);
-	swaps(&rep.suspend, n);
-	swaps(&rep.off, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.standby);
+	swaps(&rep.suspend);
+	swaps(&rep.off);
     }
     WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
     return Success;
@@ -195,7 +192,6 @@ ProcDPMSInfo(ClientPtr client)
 {
     /* REQUEST(xDPMSInfoReq); */
     xDPMSInfoReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xDPMSInfoReq);
 
@@ -206,8 +202,8 @@ ProcDPMSInfo(ClientPtr client)
     rep.state = DPMSEnabled;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.power_level, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.power_level);
     }
     WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
     return Success;
@@ -244,13 +240,12 @@ ProcDPMSDispatch (ClientPtr client)
 static int
 SProcDPMSGetVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xDPMSGetVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
-    swaps(&stuff->majorVersion, n);
-    swaps(&stuff->minorVersion, n);
+    swaps(&stuff->majorVersion);
+    swaps(&stuff->minorVersion);
     return ProcDPMSGetVersion(client);
 }
 
@@ -258,9 +253,8 @@ static int
 SProcDPMSCapable(ClientPtr client)
 {
     REQUEST(xDPMSCapableReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSCapableReq);
 
     return ProcDPMSCapable(client);
@@ -270,9 +264,8 @@ static int
 SProcDPMSGetTimeouts(ClientPtr client)
 {
     REQUEST(xDPMSGetTimeoutsReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
 
     return ProcDPMSGetTimeouts(client);
@@ -282,14 +275,13 @@ static int
 SProcDPMSSetTimeouts(ClientPtr client)
 {
     REQUEST(xDPMSSetTimeoutsReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
 
-    swaps(&stuff->standby, n);
-    swaps(&stuff->suspend, n);
-    swaps(&stuff->off, n);
+    swaps(&stuff->standby);
+    swaps(&stuff->suspend);
+    swaps(&stuff->off);
     return ProcDPMSSetTimeouts(client);
 }
 
@@ -297,9 +289,8 @@ static int
 SProcDPMSEnable(ClientPtr client)
 {
     REQUEST(xDPMSEnableReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSEnableReq);
 
     return ProcDPMSEnable(client);
@@ -309,9 +300,8 @@ static int
 SProcDPMSDisable(ClientPtr client)
 {
     REQUEST(xDPMSDisableReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSDisableReq);
 
     return ProcDPMSDisable(client);
@@ -321,12 +311,11 @@ static int
 SProcDPMSForceLevel(ClientPtr client)
 {
     REQUEST(xDPMSForceLevelReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
 
-    swaps(&stuff->level, n);
+    swaps(&stuff->level);
 
     return ProcDPMSForceLevel(client);
 }
@@ -335,9 +324,8 @@ static int
 SProcDPMSInfo(ClientPtr client)
 {
     REQUEST(xDPMSInfoReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDPMSInfoReq);
 
     return ProcDPMSInfo(client);
diff --git a/Xext/geext.c b/Xext/geext.c
index 18f8ffe..a8718cc 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -58,7 +58,6 @@ static void SGEGenericEvent(xEvent* from, xEvent* to);
 static int
 ProcGEQueryVersion(ClientPtr client)
 {
-    int n;
     GEClientInfoPtr pGEClient = GEGetClient(client);
     xGEQueryVersionReply rep;
     REQUEST(xGEQueryVersionReq);
@@ -80,10 +79,10 @@ ProcGEQueryVersion(ClientPtr client)
 
     if (client->swapped)
     {
-	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swaps(&rep.majorVersion, n);
-        swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
 
     WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
@@ -101,13 +100,12 @@ int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
 static int
 SProcGEQueryVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xGEQueryVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGEQueryVersionReq);
-    swaps(&stuff->majorVersion, n);
-    swaps(&stuff->minorVersion, n);
+    swaps(&stuff->majorVersion);
+    swaps(&stuff->minorVersion);
     return(*ProcGEVector[stuff->ReqType])(client);
 }
 
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 00afe94..3401db9 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -909,7 +909,6 @@ ProcPanoramiXQueryVersion (ClientPtr client)
 {
     /* REQUEST(xPanoramiXQueryVersionReq); */
     xPanoramiXQueryVersionReply		rep;
-    register 	int			n;
 
     REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
     rep.type = X_Reply;
@@ -918,10 +917,10 @@ ProcPanoramiXQueryVersion (ClientPtr client)
     rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
     rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
     if (client->swapped) { 
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);     
-        swaps(&rep.majorVersion, n);
-        swaps(&rep.minorVersion, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.majorVersion);
+        swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
     return Success;
@@ -933,7 +932,7 @@ ProcPanoramiXGetState(ClientPtr client)
 	REQUEST(xPanoramiXGetStateReq);
     	WindowPtr			pWin;
 	xPanoramiXGetStateReply		rep;
-	int			n, rc;
+	int			rc;
 	
 	REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
 	rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -946,9 +945,9 @@ ProcPanoramiXGetState(ClientPtr client)
 	rep.state = !noPanoramiXExtension;
 	rep.window = stuff->window;
     	if (client->swapped) {
-	    swaps (&rep.sequenceNumber, n);
-	    swapl (&rep.length, n);
-	    swapl (&rep.window, n);
+	    swaps(&rep.sequenceNumber);
+	    swapl(&rep.length);
+	    swapl(&rep.window);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
 	return Success;
@@ -961,7 +960,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
 	REQUEST(xPanoramiXGetScreenCountReq);
     	WindowPtr			pWin;
 	xPanoramiXGetScreenCountReply	rep;
-	int			n, rc;
+	int			rc;
 
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
 	rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -974,9 +973,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
 	rep.ScreenCount = PanoramiXNumScreens;
 	rep.window = stuff->window;
     	if (client->swapped) {
-	    swaps (&rep.sequenceNumber, n);
-	    swapl (&rep.length, n);
-	    swapl (&rep.window, n);
+	    swaps(&rep.sequenceNumber);
+	    swapl(&rep.length);
+	    swapl(&rep.window);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
 	return Success;
@@ -988,7 +987,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
 	REQUEST(xPanoramiXGetScreenSizeReq);
     	WindowPtr			pWin;
 	xPanoramiXGetScreenSizeReply	rep;
-	int			n, rc;
+	int			rc;
 	
 	if (stuff->screen >= PanoramiXNumScreens)
 	    return BadMatch;
@@ -1007,12 +1006,12 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
 	rep.window = stuff->window;
 	rep.screen = stuff->screen;
     	if (client->swapped) {
-	    swaps (&rep.sequenceNumber, n);
-	    swapl (&rep.length, n);
-	    swapl (&rep.width, n);
-	    swapl (&rep.height, n);
-	    swapl (&rep.window, n);
-	    swapl (&rep.screen, n);
+	    swaps(&rep.sequenceNumber);
+	    swapl(&rep.length);
+	    swapl(&rep.width);
+	    swapl(&rep.height);
+	    swapl(&rep.window);
+	    swapl(&rep.screen);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
 	return Success;
@@ -1040,10 +1039,9 @@ ProcXineramaIsActive(ClientPtr client)
     rep.state = !noPanoramiXExtension;
 #endif
     if (client->swapped) {
-	int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.state, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.state);
     }	
     WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
     return Success;
@@ -1063,10 +1061,9 @@ ProcXineramaQueryScreens(ClientPtr client)
     rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
     rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
     if (client->swapped) {
-	int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.number, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.number);
     }	
     WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
 
@@ -1081,11 +1078,10 @@ ProcXineramaQueryScreens(ClientPtr client)
 	    scratch.height = screenInfo.screens[i]->height;
 	
 	    if(client->swapped) {
-		int n;
-		swaps (&scratch.x_org, n);
-		swaps (&scratch.y_org, n);
-		swaps (&scratch.width, n);
-		swaps (&scratch.height, n);
+		swaps(&scratch.x_org);
+		swaps(&scratch.y_org);
+		swaps(&scratch.width);
+		swaps(&scratch.height);
 	    }
 	    WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
 	}
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
index e1720c9..7927702 100644
--- a/Xext/panoramiXSwap.c
+++ b/Xext/panoramiXSwap.c
@@ -51,9 +51,8 @@ static int
 SProcPanoramiXQueryVersion (ClientPtr client)
 {
 	REQUEST(xPanoramiXQueryVersionReq);
-	int n;
 
-	swaps(&stuff->length,n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
 	return ProcPanoramiXQueryVersion(client);
 }
@@ -62,11 +61,10 @@ static int
 SProcPanoramiXGetState(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetStateReq);
-	int n;
 
- 	swaps (&stuff->length, n);	
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-	swapl (&stuff->window, n);
+	swapl(&stuff->window);
 	return ProcPanoramiXGetState(client);
 }
 
@@ -74,11 +72,10 @@ static int
 SProcPanoramiXGetScreenCount(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetScreenCountReq);
-	int n;
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-	swapl (&stuff->window, n);
+	swapl(&stuff->window);
 	return ProcPanoramiXGetScreenCount(client);
 }
 
@@ -86,12 +83,11 @@ static int
 SProcPanoramiXGetScreenSize(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetScreenSizeReq);
-	int n;
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-	swapl (&stuff->window, n);
-	swapl (&stuff->screen, n);
+	swapl(&stuff->window);
+	swapl(&stuff->screen);
 	return ProcPanoramiXGetScreenSize(client);
 }
 
@@ -100,9 +96,8 @@ static int
 SProcXineramaIsActive(ClientPtr client)
 {
 	REQUEST(xXineramaIsActiveReq);
-	int n;
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 	return ProcXineramaIsActive(client);
 }
@@ -112,9 +107,8 @@ static int
 SProcXineramaQueryScreens(ClientPtr client)
 {
 	REQUEST(xXineramaQueryScreensReq);
-	int n;
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 	return ProcXineramaQueryScreens(client);
 }
diff --git a/Xext/saver.c b/Xext/saver.c
index 1888603..9e91b71 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -669,8 +669,6 @@ static int
 ProcScreenSaverQueryVersion (ClientPtr client)
 {
     xScreenSaverQueryVersionReply	rep;
-    int		n;
-
     REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
     rep.type = X_Reply;
     rep.length = 0;
@@ -678,8 +676,8 @@ ProcScreenSaverQueryVersion (ClientPtr client)
     rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
     rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
     WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
     return Success;
@@ -690,7 +688,7 @@ ProcScreenSaverQueryInfo (ClientPtr client)
 {
     REQUEST(xScreenSaverQueryInfoReq);
     xScreenSaverQueryInfoReply	rep;
-    int		n, rc;
+    int		rc;
     ScreenSaverStuffPtr		pSaver;
     DrawablePtr			pDraw;
     CARD32			lastInput;
@@ -750,12 +748,12 @@ ProcScreenSaverQueryInfo (ClientPtr client)
 	rep.kind = ScreenSaverInternal;
     if (client->swapped)
     {
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.window, n);
-	swapl (&rep.tilOrSince, n);
-	swapl (&rep.idle, n);
-	swapl (&rep.eventMask, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.window);
+	swapl(&rep.tilOrSince);
+	swapl(&rep.idle);
+	swapl(&rep.eventMask);
     }
     WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
     return Success;
@@ -1384,9 +1382,7 @@ static int
 SProcScreenSaverQueryVersion (ClientPtr client)
 {
     REQUEST(xScreenSaverQueryVersionReq);
-    int	    n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
     return ProcScreenSaverQueryVersion (client);
 }
@@ -1395,11 +1391,9 @@ static int
 SProcScreenSaverQueryInfo (ClientPtr client)
 {
     REQUEST(xScreenSaverQueryInfoReq);
-    int	    n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
-    swapl (&stuff->drawable, n);
+    swapl(&stuff->drawable);
     return ProcScreenSaverQueryInfo (client);
 }
 
@@ -1407,12 +1401,10 @@ static int
 SProcScreenSaverSelectInput (ClientPtr client)
 {
     REQUEST(xScreenSaverSelectInputReq);
-    int	    n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
-    swapl (&stuff->drawable, n);
-    swapl (&stuff->eventMask, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->eventMask);
     return ProcScreenSaverSelectInput (client);
 }
 
@@ -1420,18 +1412,16 @@ static int
 SProcScreenSaverSetAttributes (ClientPtr client)
 {
     REQUEST(xScreenSaverSetAttributesReq);
-    int	    n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
-    swapl (&stuff->drawable, n);
-    swaps (&stuff->x, n);
-    swaps (&stuff->y, n);
-    swaps (&stuff->width, n);
-    swaps (&stuff->height, n);
-    swaps (&stuff->borderWidth, n);
-    swapl (&stuff->visualID, n);
-    swapl (&stuff->mask, n);
+    swapl(&stuff->drawable);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swaps(&stuff->borderWidth);
+    swapl(&stuff->visualID);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return ProcScreenSaverSetAttributes (client);
 }
@@ -1440,23 +1430,20 @@ static int
 SProcScreenSaverUnsetAttributes (ClientPtr client)
 {
     REQUEST(xScreenSaverUnsetAttributesReq);
-    int	    n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
-    swapl (&stuff->drawable, n);
+    swapl(&stuff->drawable);
     return ProcScreenSaverUnsetAttributes (client);
 }
 
 static int
 SProcScreenSaverSuspend (ClientPtr client)
 {
-    int n;
     REQUEST(xScreenSaverSuspendReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
-    swapl(&stuff->suspend, n);
+    swapl(&stuff->suspend);
     return ProcScreenSaverSuspend (client);
 }
 
diff --git a/Xext/security.c b/Xext/security.c
index 8673880..08d8158 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -368,10 +368,9 @@ ProcSecurityQueryVersion(
     rep.minorVersion  	= SERVER_SECURITY_MINOR_VERSION;
     if(client->swapped)
     {
-	char n;
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
 			(char *)&rep);
@@ -580,11 +579,10 @@ ProcSecurityGenerateAuthorization(
 
     if (client->swapped)
     {
-	char n;
-    	swapl(&rep.length, n);
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.authId, n);
-    	swaps(&rep.dataLength, n);
+	swapl(&rep.length);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.authId);
+	swaps(&rep.dataLength);
     }
 
     WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
@@ -652,12 +650,11 @@ SProcSecurityQueryVersion(
     ClientPtr client)
 {
     REQUEST(xSecurityQueryVersionReq);
-    char	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
-    swaps(&stuff->majorVersion, n);
-    swaps(&stuff->minorVersion,n);
+    swaps(&stuff->majorVersion);
+    swaps(&stuff->minorVersion);
     return ProcSecurityQueryVersion(client);
 } /* SProcSecurityQueryVersion */
 
@@ -667,16 +664,15 @@ SProcSecurityGenerateAuthorization(
     ClientPtr client)
 {
     REQUEST(xSecurityGenerateAuthorizationReq);
-    char	n;
     CARD32 *values;
     unsigned long nvalues;
     int values_offset;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
-    swaps(&stuff->nbytesAuthProto, n);
-    swaps(&stuff->nbytesAuthData, n);
-    swapl(&stuff->valueMask, n);
+    swaps(&stuff->nbytesAuthProto);
+    swaps(&stuff->nbytesAuthData);
+    swapl(&stuff->valueMask);
     values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
 		    bytes_to_int32(stuff->nbytesAuthData);
     if (values_offset > 
@@ -694,11 +690,10 @@ SProcSecurityRevokeAuthorization(
     ClientPtr client)
 {
     REQUEST(xSecurityRevokeAuthorizationReq);
-    char	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
-    swapl(&stuff->authId, n);
+    swapl(&stuff->authId);
     return ProcSecurityRevokeAuthorization(client);
 } /* SProcSecurityRevokeAuthorization */
 
diff --git a/Xext/shape.c b/Xext/shape.c
index 115fc07..cb2a0e0 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -214,8 +214,6 @@ static int
 ProcShapeQueryVersion (ClientPtr client)
 {
     xShapeQueryVersionReply	rep;
-    int		n;
-
     REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
     memset(&rep, 0, sizeof(xShapeQueryVersionReply));
     rep.type = X_Reply;
@@ -224,10 +222,10 @@ ProcShapeQueryVersion (ClientPtr client)
     rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
     rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
     return Success;
@@ -637,7 +635,7 @@ ProcShapeQueryExtents (ClientPtr client)
     WindowPtr		pWin;
     xShapeQueryExtentsReply	rep;
     BoxRec		extents, *pExtents;
-    int	n, rc;
+    int	rc;
     RegionPtr		region;
 
     REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
@@ -679,16 +677,16 @@ ProcShapeQueryExtents (ClientPtr client)
     rep.widthClipShape = extents.x2 - extents.x1;
     rep.heightClipShape = extents.y2 - extents.y1;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.xBoundingShape, n);
-	swaps(&rep.yBoundingShape, n);
-	swaps(&rep.widthBoundingShape, n);
-	swaps(&rep.heightBoundingShape, n);
-	swaps(&rep.xClipShape, n);
-	swaps(&rep.yClipShape, n);
-	swaps(&rep.widthClipShape, n);
-	swaps(&rep.heightClipShape, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.xBoundingShape);
+	swaps(&rep.yBoundingShape);
+	swaps(&rep.widthBoundingShape);
+	swaps(&rep.heightBoundingShape);
+	swaps(&rep.xClipShape);
+	swaps(&rep.yClipShape);
+	swaps(&rep.widthClipShape);
+	swaps(&rep.heightClipShape);
     }
     WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
     return Success;
@@ -915,8 +913,6 @@ ProcShapeInputSelected (ClientPtr client)
     ShapeEventPtr	pShapeEvent, *pHead;
     int			enabled, rc;
     xShapeInputSelectedReply	rep;
-    int		n;
-
     REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
@@ -942,8 +938,8 @@ ProcShapeInputSelected (ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.enabled = enabled;
     if (client->swapped) {
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
     WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
     return Success;
@@ -958,8 +954,6 @@ ProcShapeGetRectangles (ClientPtr client)
     xRectangle			*rects;
     int				nrects, i, rc;
     RegionPtr			region;
-    int		n;
-
     REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
@@ -1023,9 +1017,9 @@ ProcShapeGetRectangles (ClientPtr client)
     rep.ordering = YXBanded;
     rep.nrects = nrects;
     if (client->swapped) {
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.nrects, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.nrects);
 	SwapShorts ((short *)rects, (unsigned long)nrects * 4);
     }
     WriteToClient (client, sizeof (rep), (char *) &rep);
@@ -1100,24 +1094,22 @@ SShapeNotifyEvent(xShapeNotifyEvent *from, xShapeNotifyEvent *to)
 static int
 SProcShapeQueryVersion (ClientPtr client)
 {
-    int    n;
     REQUEST (xShapeQueryVersionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     return ProcShapeQueryVersion (client);
 }
 
 static int
 SProcShapeRectangles (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeRectanglesReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
-    swapl (&stuff->dest, n);
-    swaps (&stuff->xOff, n);
-    swaps (&stuff->yOff, n);
+    swapl(&stuff->dest);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
     SwapRestS(stuff);
     return ProcShapeRectangles (client);
 }
@@ -1125,80 +1117,74 @@ SProcShapeRectangles (ClientPtr client)
 static int
 SProcShapeMask (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeMaskReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeMaskReq);
-    swapl (&stuff->dest, n);
-    swaps (&stuff->xOff, n);
-    swaps (&stuff->yOff, n);
-    swapl (&stuff->src, n);
+    swapl(&stuff->dest);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
+    swapl(&stuff->src);
     return ProcShapeMask (client);
 }
 
 static int
 SProcShapeCombine (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeCombineReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeCombineReq);
-    swapl (&stuff->dest, n);
-    swaps (&stuff->xOff, n);
-    swaps (&stuff->yOff, n);
-    swapl (&stuff->src, n);
+    swapl(&stuff->dest);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
+    swapl(&stuff->src);
     return ProcShapeCombine (client);
 }
 
 static int
 SProcShapeOffset (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeOffsetReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeOffsetReq);
-    swapl (&stuff->dest, n);
-    swaps (&stuff->xOff, n);
-    swaps (&stuff->yOff, n);
+    swapl(&stuff->dest);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
     return ProcShapeOffset (client);
 }
 
 static int
 SProcShapeQueryExtents (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeQueryExtentsReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcShapeQueryExtents (client);
 }
 
 static int
 SProcShapeSelectInput (ClientPtr client)
 {
-    char   n;
     REQUEST (xShapeSelectInputReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeSelectInputReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcShapeSelectInput (client);
 }
 
 static int
 SProcShapeInputSelected (ClientPtr client)
 {
-    int    n;
     REQUEST (xShapeInputSelectedReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcShapeInputSelected (client);
 }
 
@@ -1206,11 +1192,9 @@ static int
 SProcShapeGetRectangles (ClientPtr client)
 {
     REQUEST(xShapeGetRectanglesReq);
-    char   n;
-
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcShapeGetRectangles (client);
 }
 
diff --git a/Xext/shm.c b/Xext/shm.c
index b08af82..73cf5d8 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -289,7 +289,6 @@ static int
 ProcShmQueryVersion(ClientPtr client)
 {
     xShmQueryVersionReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xShmQueryVersionReq);
     memset(&rep, 0, sizeof(xShmQueryVersionReply));
@@ -303,12 +302,12 @@ ProcShmQueryVersion(ClientPtr client)
     rep.uid = geteuid();
     rep.gid = getegid();
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
-	swaps(&rep.uid, n);
-	swaps(&rep.gid, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
+	swaps(&rep.uid);
+	swaps(&rep.gid);
     }
     WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
     return Success;
@@ -633,7 +632,7 @@ ProcShmGetImage(ClientPtr client)
     Mask		plane = 0;
     xShmGetImageReply	xgi;
     ShmDescPtr		shmdesc;
-    int			n, rc;
+    int			rc;
 
     REQUEST(xShmGetImageReq);
 
@@ -727,10 +726,10 @@ ProcShmGetImage(ClientPtr client)
     }
 
     if (client->swapped) {
-	swaps(&xgi.sequenceNumber, n);
-	swapl(&xgi.length, n);
-	swapl(&xgi.visual, n);
-	swapl(&xgi.size, n);
+	swaps(&xgi.sequenceNumber);
+	swapl(&xgi.length);
+	swapl(&xgi.visual);
+	swapl(&xgi.size);
     }
     WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
 
@@ -897,11 +896,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
     free(drawables);
     
     if (client->swapped) {
-	int n;
-    	swaps(&xgi.sequenceNumber, n);
-    	swapl(&xgi.length, n);
-	swapl(&xgi.visual, n);
-	swapl(&xgi.size, n);
+	swaps(&xgi.sequenceNumber);
+	swapl(&xgi.length);
+	swapl(&xgi.visual);
+	swapl(&xgi.size);
     }
     WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
 
@@ -1165,89 +1163,83 @@ SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to)
 static int
 SProcShmQueryVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xShmQueryVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcShmQueryVersion(client);
 }
 
 static int
 SProcShmAttach(ClientPtr client)
 {
-    int n;
     REQUEST(xShmAttachReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShmAttachReq);
-    swapl(&stuff->shmseg, n);
-    swapl(&stuff->shmid, n);
+    swapl(&stuff->shmseg);
+    swapl(&stuff->shmid);
     return ProcShmAttach(client);
 }
 
 static int
 SProcShmDetach(ClientPtr client)
 {
-    int n;
     REQUEST(xShmDetachReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShmDetachReq);
-    swapl(&stuff->shmseg, n);
+    swapl(&stuff->shmseg);
     return ProcShmDetach(client);
 }
 
 static int
 SProcShmPutImage(ClientPtr client)
 {
-    int n;
     REQUEST(xShmPutImageReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShmPutImageReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->totalWidth, n);
-    swaps(&stuff->totalHeight, n);
-    swaps(&stuff->srcX, n);
-    swaps(&stuff->srcY, n);
-    swaps(&stuff->srcWidth, n);
-    swaps(&stuff->srcHeight, n);
-    swaps(&stuff->dstX, n);
-    swaps(&stuff->dstY, n);
-    swapl(&stuff->shmseg, n);
-    swapl(&stuff->offset, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->totalWidth);
+    swaps(&stuff->totalHeight);
+    swaps(&stuff->srcX);
+    swaps(&stuff->srcY);
+    swaps(&stuff->srcWidth);
+    swaps(&stuff->srcHeight);
+    swaps(&stuff->dstX);
+    swaps(&stuff->dstY);
+    swapl(&stuff->shmseg);
+    swapl(&stuff->offset);
     return ProcShmPutImage(client);
 }
 
 static int
 SProcShmGetImage(ClientPtr client)
 {
-    int n;
     REQUEST(xShmGetImageReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShmGetImageReq);
-    swapl(&stuff->drawable, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swapl(&stuff->planeMask, n);
-    swapl(&stuff->shmseg, n);
-    swapl(&stuff->offset, n);
+    swapl(&stuff->drawable);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->planeMask);
+    swapl(&stuff->shmseg);
+    swapl(&stuff->offset);
     return ProcShmGetImage(client);
 }
 
 static int
 SProcShmCreatePixmap(ClientPtr client)
 {
-    int n;
     REQUEST(xShmCreatePixmapReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->drawable, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swapl(&stuff->shmseg, n);
-    swapl(&stuff->offset, n);
+    swapl(&stuff->pid);
+    swapl(&stuff->drawable);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->shmseg);
+    swapl(&stuff->offset);
     return ProcShmCreatePixmap(client);
 }
 
diff --git a/Xext/sync.c b/Xext/sync.c
index 36dd278..3b257f7 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1273,8 +1273,6 @@ static int
 ProcSyncInitialize(ClientPtr client)
 {
     xSyncInitializeReply  rep;
-    int   n;
-
     REQUEST_SIZE_MATCH(xSyncInitializeReq);
 
     memset(&rep, 0, sizeof(xSyncInitializeReply));
@@ -1286,7 +1284,7 @@ ProcSyncInitialize(ClientPtr client)
 
     if (client->swapped)
     {
-	swaps(&rep.sequenceNumber, n);
+	swaps(&rep.sequenceNumber);
     }
     WriteToClient(client, sizeof(rep), (char *) &rep);
     return Success;
@@ -1326,10 +1324,9 @@ ProcSyncListSystemCounters(ClientPtr client)
 
     if (client->swapped)
     {
-	char n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.nCounters, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.nCounters);
     }
 
     for (i = 0; i < SyncNumSystemCounters; i++)
@@ -1346,11 +1343,10 @@ ProcSyncListSystemCounters(ClientPtr client)
 
 	if (client->swapped)
 	{
-	    char n;
-	    swapl(&walklist->counter, n);
-	    swapl(&walklist->resolution_hi, n);
-	    swapl(&walklist->resolution_lo, n);
-	    swaps(&walklist->name_length, n);
+	    swapl(&walklist->counter);
+	    swapl(&walklist->resolution_hi);
+	    swapl(&walklist->resolution_lo);
+	    swaps(&walklist->name_length);
 	}
 
 	pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
@@ -1433,9 +1429,8 @@ ProcSyncGetPriority(ClientPtr client)
 
     if (client->swapped)
     {
-	char n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.priority, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.priority);
     }
 
     WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
@@ -1732,11 +1727,10 @@ ProcSyncQueryCounter(ClientPtr client)
     rep.value_lo = XSyncValueLow32(pCounter->value);
     if (client->swapped)
     {
-	char n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.value_hi, n);
-	swapl(&rep.value_lo, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.value_hi);
+	swapl(&rep.value_lo);
     }
     WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
     return Success;
@@ -1921,15 +1915,14 @@ ProcSyncQueryAlarm(ClientPtr client)
 
     if (client->swapped)
     {
-	char n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.counter, n);
-	swapl(&rep.wait_value_hi, n);
-	swapl(&rep.wait_value_lo, n);
-	swapl(&rep.test_type, n);
-	swapl(&rep.delta_hi, n);
-	swapl(&rep.delta_lo, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.counter);
+	swapl(&rep.wait_value_hi);
+	swapl(&rep.wait_value_lo);
+	swapl(&rep.test_type);
+	swapl(&rep.delta_hi);
+	swapl(&rep.delta_lo);
     }
 
     WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
@@ -2087,9 +2080,8 @@ ProcSyncQueryFence(ClientPtr client)
 
     if (client->swapped)
     {
-	char n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
 
     WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
@@ -2242,9 +2234,7 @@ static int
 SProcSyncInitialize(ClientPtr client)
 {
     REQUEST(xSyncInitializeReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncInitializeReq);
 
     return ProcSyncInitialize(client);
@@ -2254,9 +2244,7 @@ static int
 SProcSyncListSystemCounters(ClientPtr client)
 {
     REQUEST(xSyncListSystemCountersReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
 
     return ProcSyncListSystemCounters(client);
@@ -2266,13 +2254,11 @@ static int
 SProcSyncCreateCounter(ClientPtr client)
 {
     REQUEST(xSyncCreateCounterReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->initial_value_lo, n);
-    swapl(&stuff->initial_value_hi, n);
+    swapl(&stuff->cid);
+    swapl(&stuff->initial_value_lo);
+    swapl(&stuff->initial_value_hi);
 
     return ProcSyncCreateCounter(client);
 }
@@ -2281,13 +2267,11 @@ static int
 SProcSyncSetCounter(ClientPtr client)
 {
     REQUEST(xSyncSetCounterReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncSetCounterReq);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->value_lo, n);
-    swapl(&stuff->value_hi, n);
+    swapl(&stuff->cid);
+    swapl(&stuff->value_lo);
+    swapl(&stuff->value_hi);
 
     return ProcSyncSetCounter(client);
 }
@@ -2296,13 +2280,11 @@ static int
 SProcSyncChangeCounter(ClientPtr client)
 {
     REQUEST(xSyncChangeCounterReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->value_lo, n);
-    swapl(&stuff->value_hi, n);
+    swapl(&stuff->cid);
+    swapl(&stuff->value_lo);
+    swapl(&stuff->value_hi);
 
     return ProcSyncChangeCounter(client);
 }
@@ -2311,11 +2293,9 @@ static int
 SProcSyncQueryCounter(ClientPtr client)
 {
     REQUEST(xSyncQueryCounterReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
-    swapl(&stuff->counter, n);
+    swapl(&stuff->counter);
 
     return ProcSyncQueryCounter(client);
 }
@@ -2324,11 +2304,9 @@ static int
 SProcSyncDestroyCounter(ClientPtr client)
 {
     REQUEST(xSyncDestroyCounterReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
-    swapl(&stuff->counter, n);
+    swapl(&stuff->counter);
 
     return ProcSyncDestroyCounter(client);
 }
@@ -2337,9 +2315,7 @@ static int
 SProcSyncAwait(ClientPtr client)
 {
     REQUEST(xSyncAwaitReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
     SwapRestL(stuff);
 
@@ -2350,12 +2326,10 @@ static int
 SProcSyncCreateAlarm(ClientPtr client)
 {
     REQUEST(xSyncCreateAlarmReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
-    swapl(&stuff->id, n);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->id);
+    swapl(&stuff->valueMask);
     SwapRestL(stuff);
 
     return ProcSyncCreateAlarm(client);
@@ -2365,12 +2339,10 @@ static int
 SProcSyncChangeAlarm(ClientPtr client)
 {
     REQUEST(xSyncChangeAlarmReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
-    swapl(&stuff->alarm, n);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->alarm);
+    swapl(&stuff->valueMask);
     SwapRestL(stuff);
     return ProcSyncChangeAlarm(client);
 }
@@ -2379,11 +2351,9 @@ static int
 SProcSyncQueryAlarm(ClientPtr client)
 {
     REQUEST(xSyncQueryAlarmReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
-    swapl(&stuff->alarm, n);
+    swapl(&stuff->alarm);
 
     return ProcSyncQueryAlarm(client);
 }
@@ -2392,11 +2362,9 @@ static int
 SProcSyncDestroyAlarm(ClientPtr client)
 {
     REQUEST(xSyncDestroyAlarmReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
-    swapl(&stuff->alarm, n);
+    swapl(&stuff->alarm);
 
     return ProcSyncDestroyAlarm(client);
 }
@@ -2405,12 +2373,10 @@ static int
 SProcSyncSetPriority(ClientPtr client)
 {
     REQUEST(xSyncSetPriorityReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
-    swapl(&stuff->id, n);
-    swapl(&stuff->priority, n);
+    swapl(&stuff->id);
+    swapl(&stuff->priority);
 
     return ProcSyncSetPriority(client);
 }
@@ -2419,11 +2385,9 @@ static int
 SProcSyncGetPriority(ClientPtr client)
 {
     REQUEST(xSyncGetPriorityReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
 
     return ProcSyncGetPriority(client);
 }
@@ -2432,11 +2396,9 @@ static int
 SProcSyncCreateFence(ClientPtr client)
 {
     REQUEST(xSyncCreateFenceReq);
-    char n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncCreateFenceReq);
-    swapl(&stuff->fid, n);
+    swapl(&stuff->fid);
 
     return ProcSyncCreateFence(client);
 }
@@ -2445,11 +2407,9 @@ static int
 SProcSyncTriggerFence(ClientPtr client)
 {
     REQUEST(xSyncTriggerFenceReq);
-    char n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncTriggerFenceReq);
-    swapl(&stuff->fid, n);
+    swapl(&stuff->fid);
 
     return ProcSyncTriggerFence(client);
 }
@@ -2458,11 +2418,9 @@ static int
 SProcSyncResetFence(ClientPtr client)
 {
     REQUEST(xSyncResetFenceReq);
-    char n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncResetFenceReq);
-    swapl(&stuff->fid, n);
+    swapl(&stuff->fid);
 
     return ProcSyncResetFence(client);
 }
@@ -2471,11 +2429,9 @@ static int
 SProcSyncDestroyFence(ClientPtr client)
 {
     REQUEST(xSyncDestroyFenceReq);
-    char n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncDestroyFenceReq);
-    swapl(&stuff->fid, n);
+    swapl(&stuff->fid);
 
     return ProcSyncDestroyFence(client);
 }
@@ -2484,11 +2440,9 @@ static int
 SProcSyncQueryFence(ClientPtr client)
 {
     REQUEST(xSyncQueryFenceReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xSyncQueryFenceReq);
-    swapl(&stuff->fid, n);
+    swapl(&stuff->fid);
 
     return ProcSyncQueryFence(client);
 }
@@ -2497,9 +2451,7 @@ static int
 SProcSyncAwaitFence(ClientPtr client)
 {
     REQUEST(xSyncAwaitFenceReq);
-    char   n;
-
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
     SwapRestL(stuff);
 
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
index 378afcc..8e3c9cd 100644
--- a/Xext/xcmisc.c
+++ b/Xext/xcmisc.c
@@ -51,7 +51,6 @@ static int
 ProcXCMiscGetVersion(ClientPtr client)
 {
     xXCMiscGetVersionReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
     rep.type = X_Reply;
@@ -60,9 +59,9 @@ ProcXCMiscGetVersion(ClientPtr client)
     rep.majorVersion = XCMiscMajorVersion;
     rep.minorVersion = XCMiscMinorVersion;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
     return Success;
@@ -72,7 +71,6 @@ static int
 ProcXCMiscGetXIDRange(ClientPtr client)
 {
     xXCMiscGetXIDRangeReply rep;
-    int n;
     XID min_id, max_id;
 
     REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
@@ -83,9 +81,9 @@ ProcXCMiscGetXIDRange(ClientPtr client)
     rep.start_id = min_id;
     rep.count = max_id - min_id + 1;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.start_id, n);
-	swapl(&rep.count, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.start_id);
+	swapl(&rep.count);
     }
     WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
     return Success;
@@ -96,7 +94,6 @@ ProcXCMiscGetXIDList(ClientPtr client)
 {
     REQUEST(xXCMiscGetXIDListReq);
     xXCMiscGetXIDListReply rep;
-    int n;
     XID *pids;
     unsigned int count;
 
@@ -116,9 +113,9 @@ ProcXCMiscGetXIDList(ClientPtr client)
     rep.length = count;
     rep.count = count;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.count, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.count);
     }
     WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
     if (count)
@@ -150,34 +147,31 @@ ProcXCMiscDispatch (ClientPtr client)
 static int
 SProcXCMiscGetVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xXCMiscGetVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
-    swaps(&stuff->majorVersion, n);
-    swaps(&stuff->minorVersion, n);
+    swaps(&stuff->majorVersion);
+    swaps(&stuff->minorVersion);
     return ProcXCMiscGetVersion(client);
 }
 
 static int
 SProcXCMiscGetXIDRange(ClientPtr client)
 {
-    int n;
     REQUEST(xReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcXCMiscGetXIDRange(client);
 }
 
 static int
 SProcXCMiscGetXIDList(ClientPtr client)
 {
-    int n;
     REQUEST(xXCMiscGetXIDListReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->count, n);
+    swaps(&stuff->length);
+    swapl(&stuff->count);
     return ProcXCMiscGetXIDList(client);
 }
 
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index de82744..4b63a13 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -307,13 +307,13 @@ ProcXF86BigfontQueryVersion(
 	; /* may add more bits here in future versions */
     if (client->swapped) {
 	char tmp;
-	swaps(&reply.sequenceNumber, tmp);
-	swapl(&reply.length, tmp);
-	swaps(&reply.majorVersion, tmp);
-	swaps(&reply.minorVersion, tmp);
-	swapl(&reply.uid, tmp);
-	swapl(&reply.gid, tmp);
-	swapl(&reply.signature, tmp);
+	swaps(&reply.sequenceNumber);
+	swapl(&reply.length);
+	swaps(&reply.majorVersion);
+	swaps(&reply.minorVersion);
+	swapl(&reply.uid);
+	swapl(&reply.gid);
+	swapl(&reply.signature);
     }
     WriteToClient(client,
 		  sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
@@ -326,12 +326,12 @@ swapCharInfo(
 {
     char tmp;
 
-    swaps(&pCI->leftSideBearing, tmp);
-    swaps(&pCI->rightSideBearing, tmp);
-    swaps(&pCI->characterWidth, tmp);
-    swaps(&pCI->ascent, tmp);
-    swaps(&pCI->descent, tmp);
-    swaps(&pCI->attributes, tmp);
+    swaps(&pCI->leftSideBearing);
+    swaps(&pCI->rightSideBearing);
+    swaps(&pCI->characterWidth);
+    swaps(&pCI->ascent);
+    swaps(&pCI->descent);
+    swaps(&pCI->attributes);
 }
 
 /* static CARD32 hashCI (xCharInfo *p); */
@@ -587,20 +587,20 @@ ProcXF86BigfontQueryFont(
 	reply->shmsegoffset = 0;
 	if (client->swapped) {
 	    char tmp;
-	    swaps(&reply->sequenceNumber, tmp);
-	    swapl(&reply->length, tmp);
+	    swaps(&reply->sequenceNumber);
+	    swapl(&reply->length);
 	    swapCharInfo(&reply->minBounds);
 	    swapCharInfo(&reply->maxBounds);
-	    swaps(&reply->minCharOrByte2, tmp);
-	    swaps(&reply->maxCharOrByte2, tmp);
-	    swaps(&reply->defaultChar, tmp);
-	    swaps(&reply->nFontProps, tmp);
-	    swaps(&reply->fontAscent, tmp);
-	    swaps(&reply->fontDescent, tmp);
-	    swapl(&reply->nCharInfos, tmp);
-	    swapl(&reply->nUniqCharInfos, tmp);
-	    swapl(&reply->shmid, tmp);
-	    swapl(&reply->shmsegoffset, tmp);
+	    swaps(&reply->minCharOrByte2);
+	    swaps(&reply->maxCharOrByte2);
+	    swaps(&reply->defaultChar);
+	    swaps(&reply->nFontProps);
+	    swaps(&reply->fontAscent);
+	    swaps(&reply->fontDescent);
+	    swapl(&reply->nCharInfos);
+	    swapl(&reply->nUniqCharInfos);
+	    swapl(&reply->shmid);
+	    swapl(&reply->shmsegoffset);
 	}
 	p = (char*) &reply[1];
 	{
@@ -614,8 +614,8 @@ ProcXF86BigfontQueryFont(
 		prFP->value = pFP->value;
 		if (client->swapped) {
 		    char tmp;
-		    swapl(&prFP->name, tmp);
-		    swapl(&prFP->value, tmp);
+		    swapl(&prFP->name);
+		    swapl(&prFP->value);
 		}
 	    }
 	    p = (char*) prFP;
@@ -635,7 +635,7 @@ ProcXF86BigfontQueryFont(
 		*ps = pIndex2UniqIndex[j];
 		if (client->swapped) {
 		    char tmp;
-		    swaps(ps, tmp);
+		    swaps(ps);
 		}
 	    }
 	}
@@ -672,7 +672,7 @@ SProcXF86BigfontQueryVersion(
     REQUEST(xXF86BigfontQueryVersionReq);
     char tmp;
 
-    swaps(&stuff->length, tmp);
+    swaps(&stuff->length);
     return ProcXF86BigfontQueryVersion(client);
 }
 
@@ -683,9 +683,9 @@ SProcXF86BigfontQueryFont(
     REQUEST(xXF86BigfontQueryFontReq);
     char tmp;
 
-    swaps(&stuff->length, tmp);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
-    swapl(&stuff->id, tmp);
+    swapl(&stuff->id);
     return ProcXF86BigfontQueryFont(client);
 }
 
diff --git a/Xext/xres.c b/Xext/xres.c
index 06639a2..9df12ae 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -43,11 +43,10 @@ ProcXResQueryVersion (ClientPtr client)
     rep.server_major = SERVER_XRES_MAJOR_VERSION;
     rep.server_minor = SERVER_XRES_MINOR_VERSION;
     if (client->swapped) { 
-        int n;
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);     
-        swaps(&rep.server_major, n);
-        swaps(&rep.server_minor, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.server_major);
+        swaps(&rep.server_minor);
     }
     WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
     return Success;
@@ -78,10 +77,9 @@ ProcXResQueryClients (ClientPtr client)
     rep.num_clients = num_clients;
     rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
     if (client->swapped) {
-        int n;
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swapl (&rep.num_clients, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.num_clients);
     }   
     WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
 
@@ -93,9 +91,8 @@ ProcXResQueryClients (ClientPtr client)
             scratch.resource_mask = RESOURCE_ID_MASK;
         
             if(client->swapped) {
-                int n;
-                swapl (&scratch.resource_base, n);
-                swapl (&scratch.resource_mask, n);
+                swapl(&scratch.resource_base);
+                swapl(&scratch.resource_mask);
             }
             WriteToClient (client, sz_xXResClient, (char *) &scratch);
         }
@@ -147,10 +144,9 @@ ProcXResQueryClientResources (ClientPtr client)
     rep.num_types = num_types;
     rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
     if (client->swapped) {
-        int n;
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swapl (&rep.num_types, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.num_types);
     }   
 
     WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
@@ -174,9 +170,8 @@ ProcXResQueryClientResources (ClientPtr client)
             scratch.count = counts[i];
 
             if(client->swapped) {
-                int n;
-                swapl (&scratch.resource_type, n);
-                swapl (&scratch.count, n);
+                swapl(&scratch.resource_type);
+                swapl(&scratch.count);
             }
             WriteToClient (client, sz_xXResType, (char *) &scratch);
         }
@@ -287,11 +282,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
     rep.bytes_overflow = 0;
 #endif
     if (client->swapped) {
-        int n;
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swapl (&rep.bytes, n);
-        swapl (&rep.bytes_overflow, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.bytes);
+        swapl(&rep.bytes_overflow);
     }
     WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
 
@@ -321,11 +315,9 @@ static int
 SProcXResQueryVersion (ClientPtr client)
 {
     REQUEST(xXResQueryVersionReq);
-    int n;
-
     REQUEST_SIZE_MATCH (xXResQueryVersionReq);
-    swaps(&stuff->client_major,n);
-    swaps(&stuff->client_minor,n);
+    swaps(&stuff->client_major);
+    swaps(&stuff->client_minor);
     return ProcXResQueryVersion(client);
 }
 
@@ -333,10 +325,8 @@ static int
 SProcXResQueryClientResources (ClientPtr client)
 {
     REQUEST(xXResQueryClientResourcesReq);
-    int n;
-
     REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
-    swaps(&stuff->xid,n);
+    swaps(&stuff->xid);
     return ProcXResQueryClientResources(client);
 }
 
@@ -344,10 +334,8 @@ static int
 SProcXResQueryClientPixmapBytes (ClientPtr client)
 {
     REQUEST(xXResQueryClientPixmapBytesReq);
-    int n;
-
     REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
-    swaps(&stuff->xid,n);
+    swaps(&stuff->xid);
     return ProcXResQueryClientPixmapBytes(client);
 }
 
@@ -355,9 +343,7 @@ static int
 SProcResDispatch (ClientPtr client)
 {
     REQUEST(xReq);
-    int n;
-
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
 
     switch (stuff->data) {
     case X_XResQueryVersion:
diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index 374571c..56f2d1f 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -71,11 +71,10 @@ ProcSELinuxQueryVersion(ClientPtr client)
     rep.server_major = SELINUX_MAJOR_VERSION;
     rep.server_minor = SELINUX_MINOR_VERSION;
     if (client->swapped) {
-	int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swaps(&rep.server_major, n);
-	swaps(&rep.server_minor, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.server_major);
+	swaps(&rep.server_minor);
     }
     WriteToClient(client, sizeof(rep), (char *)&rep);
     return Success;
@@ -100,10 +99,9 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
     rep.context_len = len;
 
     if (client->swapped) {
-	int n;
-	swapl(&rep.length, n);
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.context_len, n);
+	swapl(&rep.length);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.context_len);
     }
 
     WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep);
@@ -353,17 +351,17 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
     for (k = 0; k < count; k++) {
 	buf[pos] = items[k].id;
 	if (client->swapped)
-	    swapl(buf + pos, n);
+	    swapl(buf + pos);
 	pos++;
 
 	buf[pos] = items[k].octx_len * 4;
 	if (client->swapped)
-	    swapl(buf + pos, n);
+	    swapl(buf + pos);
 	pos++;
 
 	buf[pos] = items[k].dctx_len * 4;
 	if (client->swapped)
-	    swapl(buf + pos, n);
+	    swapl(buf + pos);
 	pos++;
 
 	memcpy((char *)(buf + pos), items[k].octx, strlen(items[k].octx) + 1);
@@ -379,9 +377,9 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
     rep.count = count;
 
     if (client->swapped) {
-	swapl(&rep.length, n);
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.count, n);
+	swapl(&rep.length);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.count);
     }
 
     WriteToClient(client, sizeof(SELinuxListItemsReply), (char *)&rep);
@@ -529,11 +527,10 @@ static int
 SProcSELinuxQueryVersion(ClientPtr client)
 {
     REQUEST(SELinuxQueryVersionReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxQueryVersionReq);
-    swaps(&stuff->client_major, n);
-    swaps(&stuff->client_minor, n);
+    swaps(&stuff->client_major);
+    swaps(&stuff->client_minor);
     return ProcSELinuxQueryVersion(client);
 }
 
@@ -541,10 +538,9 @@ static int
 SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
 {
     REQUEST(SELinuxSetCreateContextReq);
-    int n;
 
     REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
-    swapl(&stuff->context_len, n);
+    swapl(&stuff->context_len);
     return ProcSELinuxSetCreateContext(client, offset);
 }
 
@@ -552,11 +548,10 @@ static int
 SProcSELinuxSetDeviceContext(ClientPtr client)
 {
     REQUEST(SELinuxSetContextReq);
-    int n;
 
     REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
-    swapl(&stuff->id, n);
-    swapl(&stuff->context_len, n);
+    swapl(&stuff->id);
+    swapl(&stuff->context_len);
     return ProcSELinuxSetDeviceContext(client);
 }
 
@@ -564,10 +559,9 @@ static int
 SProcSELinuxGetDeviceContext(ClientPtr client)
 {
     REQUEST(SELinuxGetContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return ProcSELinuxGetDeviceContext(client);
 }
 
@@ -575,10 +569,9 @@ static int
 SProcSELinuxGetDrawableContext(ClientPtr client)
 {
     REQUEST(SELinuxGetContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return ProcSELinuxGetDrawableContext(client);
 }
 
@@ -586,11 +579,10 @@ static int
 SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey)
 {
     REQUEST(SELinuxGetPropertyContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->property, n);
+    swapl(&stuff->window);
+    swapl(&stuff->property);
     return ProcSELinuxGetPropertyContext(client, privKey);
 }
 
@@ -598,10 +590,9 @@ static int
 SProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey)
 {
     REQUEST(SELinuxGetContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return ProcSELinuxGetSelectionContext(client, privKey);
 }
 
@@ -609,10 +600,9 @@ static int
 SProcSELinuxListProperties(ClientPtr client)
 {
     REQUEST(SELinuxGetContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return ProcSELinuxListProperties(client);
 }
 
@@ -620,10 +610,9 @@ static int
 SProcSELinuxGetClientContext(ClientPtr client)
 {
     REQUEST(SELinuxGetContextReq);
-    int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return ProcSELinuxGetClientContext(client);
 }
 
@@ -631,9 +620,8 @@ static int
 SProcSELinuxDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    int n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
 
     switch (stuff->data) {
     case X_SELinuxQueryVersion:
diff --git a/Xext/xtest.c b/Xext/xtest.c
index cc675c1..945e202 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -91,7 +91,6 @@ static int
 ProcXTestGetVersion(ClientPtr client)
 {
     xXTestGetVersionReply rep;
-    int n;
 
     REQUEST_SIZE_MATCH(xXTestGetVersionReq);
     rep.type = X_Reply;
@@ -100,8 +99,8 @@ ProcXTestGetVersion(ClientPtr client)
     rep.majorVersion = XTestMajorVersion;
     rep.minorVersion = XTestMinorVersion;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swaps(&rep.minorVersion, n);
+        swaps(&rep.sequenceNumber);
+        swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
     return Success;
@@ -114,7 +113,7 @@ ProcXTestCompareCursor(ClientPtr client)
     xXTestCompareCursorReply rep;
     WindowPtr pWin;
     CursorPtr pCursor;
-    int n, rc;
+    int rc;
     DeviceIntPtr ptr = PickPointer(client);
 
     REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
@@ -139,7 +138,7 @@ ProcXTestCompareCursor(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.same = (wCursor(pWin) == pCursor);
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
+        swaps(&rep.sequenceNumber);
     }
     WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
     return Success;
@@ -348,7 +347,7 @@ ProcXTestFakeInput(ClientPtr client)
         if (client->swapped)
         {
             (void) XTestSwapFakeInput(client, (xReq *)stuff);
-            swaps(&stuff->length, n);
+            swaps(&stuff->length);
         }
         ResetCurrentRequest (client);
         client->sequence--;
@@ -476,25 +475,23 @@ ProcXTestDispatch (ClientPtr client)
 static int
 SProcXTestGetVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xXTestGetVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXTestGetVersionReq);
-    swaps(&stuff->minorVersion, n);
+    swaps(&stuff->minorVersion);
     return ProcXTestGetVersion(client);
 }
 
 static int
 SProcXTestCompareCursor(ClientPtr client)
 {
-    int n;
     REQUEST(xXTestCompareCursorReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->cursor, n);
+    swapl(&stuff->window);
+    swapl(&stuff->cursor);
     return ProcXTestCompareCursor(client);
 }
 
@@ -525,10 +522,10 @@ XTestSwapFakeInput(ClientPtr client, xReq *req)
 static int
 SProcXTestFakeInput(ClientPtr client)
 {
-    int n;
+	int n;
     REQUEST(xReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     n = XTestSwapFakeInput(client, stuff);
     if (n != Success)
         return n;
@@ -538,10 +535,9 @@ SProcXTestFakeInput(ClientPtr client)
 static int
 SProcXTestGrabControl(ClientPtr client)
 {
-    int n;
     REQUEST(xXTestGrabControlReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXTestGrabControlReq);
     return ProcXTestGrabControl(client);
 }
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index b968431..364a90c 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -59,12 +59,10 @@ SWriteQueryExtensionReply(
    ClientPtr client,
    xvQueryExtensionReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swaps(&rep->version, n);
-  swaps(&rep->revision, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swaps(&rep->version);
+  swaps(&rep->revision);
   
   (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep);
 
@@ -76,11 +74,9 @@ SWriteQueryAdaptorsReply(
    ClientPtr client,
    xvQueryAdaptorsReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swaps(&rep->num_adaptors, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swaps(&rep->num_adaptors);
   
   (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep);
 
@@ -92,11 +88,9 @@ SWriteQueryEncodingsReply(
    ClientPtr client,
    xvQueryEncodingsReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swaps(&rep->num_encodings, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swaps(&rep->num_encodings);
   
   (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep);
 
@@ -108,12 +102,10 @@ SWriteAdaptorInfo(
    ClientPtr client,
    xvAdaptorInfo *pAdaptor
 ){
-  char n;
-
-  swapl(&pAdaptor->base_id, n);
-  swaps(&pAdaptor->name_size, n);
-  swaps(&pAdaptor->num_ports, n);
-  swaps(&pAdaptor->num_formats, n);
+  swapl(&pAdaptor->base_id);
+  swaps(&pAdaptor->name_size);
+  swaps(&pAdaptor->num_ports);
+  swaps(&pAdaptor->num_formats);
 
   (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
 
@@ -125,14 +117,13 @@ SWriteEncodingInfo(
    ClientPtr client,
    xvEncodingInfo *pEncoding
 ){
-  char n;
   
-  swapl(&pEncoding->encoding, n);
-  swaps(&pEncoding->name_size, n);
-  swaps(&pEncoding->width, n);
-  swaps(&pEncoding->height, n);
-  swapl(&pEncoding->rate.numerator, n);
-  swapl(&pEncoding->rate.denominator, n);
+  swapl(&pEncoding->encoding);
+  swaps(&pEncoding->name_size);
+  swaps(&pEncoding->width);
+  swaps(&pEncoding->height);
+  swapl(&pEncoding->rate.numerator);
+  swapl(&pEncoding->rate.denominator);
   (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
 
   return Success;
@@ -143,9 +134,7 @@ SWriteFormat(
    ClientPtr client,
    xvFormat *pFormat
 ){
-  char n;
-
-  swapl(&pFormat->visual, n);
+  swapl(&pFormat->visual);
   (void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
 
   return Success;
@@ -156,12 +145,10 @@ SWriteAttributeInfo(
    ClientPtr client,
    xvAttributeInfo *pAtt
 ){
-  char n;
-
-  swapl(&pAtt->flags, n);
-  swapl(&pAtt->size, n);
-  swapl(&pAtt->min, n);
-  swapl(&pAtt->max, n);
+  swapl(&pAtt->flags);
+  swapl(&pAtt->size);
+  swapl(&pAtt->min);
+  swapl(&pAtt->max);
   (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
 
   return Success;
@@ -172,21 +159,19 @@ SWriteImageFormatInfo(
    ClientPtr client,
    xvImageFormatInfo *pImage
 ){
-  char n;
-
-  swapl(&pImage->id, n);
-  swapl(&pImage->red_mask, n);
-  swapl(&pImage->green_mask, n);
-  swapl(&pImage->blue_mask, n);
-  swapl(&pImage->y_sample_bits, n);
-  swapl(&pImage->u_sample_bits, n);
-  swapl(&pImage->v_sample_bits, n);
-  swapl(&pImage->horz_y_period, n);
-  swapl(&pImage->horz_u_period, n);
-  swapl(&pImage->horz_v_period, n);
-  swapl(&pImage->vert_y_period, n);
-  swapl(&pImage->vert_u_period, n);
-  swapl(&pImage->vert_v_period, n);
+  swapl(&pImage->id);
+  swapl(&pImage->red_mask);
+  swapl(&pImage->green_mask);
+  swapl(&pImage->blue_mask);
+  swapl(&pImage->y_sample_bits);
+  swapl(&pImage->u_sample_bits);
+  swapl(&pImage->v_sample_bits);
+  swapl(&pImage->horz_y_period);
+  swapl(&pImage->horz_u_period);
+  swapl(&pImage->horz_v_period);
+  swapl(&pImage->vert_y_period);
+  swapl(&pImage->vert_u_period);
+  swapl(&pImage->vert_v_period);
 
   (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
 
@@ -198,10 +183,8 @@ SWriteGrabPortReply(
    ClientPtr client,
    xvGrabPortReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
 
   (void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep);
 
@@ -213,11 +196,9 @@ SWriteGetPortAttributeReply(
    ClientPtr client,
    xvGetPortAttributeReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swapl(&rep->value, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swapl(&rep->value);
 
   (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep);
 
@@ -229,12 +210,10 @@ SWriteQueryBestSizeReply(
    ClientPtr client,
    xvQueryBestSizeReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swaps(&rep->actual_width, n);
-  swaps(&rep->actual_height, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swaps(&rep->actual_width);
+  swaps(&rep->actual_height);
 
   (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep);
 
@@ -246,12 +225,10 @@ SWriteQueryPortAttributesReply(
    ClientPtr client,
    xvQueryPortAttributesReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swapl(&rep->num_attributes, n);
-  swapl(&rep->text_size, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swapl(&rep->num_attributes);
+  swapl(&rep->text_size);
 
   (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep);
 
@@ -263,14 +240,12 @@ SWriteQueryImageAttributesReply(
    ClientPtr client,
    xvQueryImageAttributesReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swapl(&rep->num_planes, n);
-  swapl(&rep->data_size, n);
-  swaps(&rep->width, n);
-  swaps(&rep->height, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swapl(&rep->num_planes);
+  swapl(&rep->data_size);
+  swaps(&rep->width);
+  swaps(&rep->height);
 
   (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep);
 
@@ -282,11 +257,9 @@ SWriteListImageFormatsReply(
    ClientPtr client,
    xvListImageFormatsReply *rep
 ){
-  char n;
-
-  swaps(&rep->sequenceNumber, n);
-  swapl(&rep->length, n);
-  swapl(&rep->num_formats, n);
+  swaps(&rep->sequenceNumber);
+  swapl(&rep->length);
+  swapl(&rep->num_formats);
 
   (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep);
 
@@ -1278,154 +1251,144 @@ ProcXvDispatch(ClientPtr client)
 static int
 SProcXvQueryExtension(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryExtensionReq);
-  swaps(&stuff->length, n);
+  swaps(&stuff->length);
   return XvProcVector[xv_QueryExtension](client);
 }
 
 static int
 SProcXvQueryAdaptors(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryAdaptorsReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->window, n);
+  swaps(&stuff->length);
+  swapl(&stuff->window);
   return XvProcVector[xv_QueryAdaptors](client);
 }
 
 static int
 SProcXvQueryEncodings(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryEncodingsReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
   return XvProcVector[xv_QueryEncodings](client);
 }
 
 static int
 SProcXvGrabPort(ClientPtr client)
 {
-  char n;
   REQUEST(xvGrabPortReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->time, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->time);
   return XvProcVector[xv_GrabPort](client);
 }
 
 static int
 SProcXvUngrabPort(ClientPtr client)
 {
-  char n;
   REQUEST(xvUngrabPortReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->time, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->time);
   return XvProcVector[xv_UngrabPort](client);
 }
 
 static int
 SProcXvPutVideo(ClientPtr client)
 {
-  char n;
   REQUEST(xvPutVideoReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swaps(&stuff->vid_x, n);
-  swaps(&stuff->vid_y, n);
-  swaps(&stuff->vid_w, n);
-  swaps(&stuff->vid_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swaps(&stuff->vid_x);
+  swaps(&stuff->vid_y);
+  swaps(&stuff->vid_w);
+  swaps(&stuff->vid_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
   return XvProcVector[xv_PutVideo](client);
 }
 
 static int
 SProcXvPutStill(ClientPtr client)
 {
-  char n;
   REQUEST(xvPutStillReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swaps(&stuff->vid_x, n);
-  swaps(&stuff->vid_y, n);
-  swaps(&stuff->vid_w, n);
-  swaps(&stuff->vid_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swaps(&stuff->vid_x);
+  swaps(&stuff->vid_y);
+  swaps(&stuff->vid_w);
+  swaps(&stuff->vid_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
   return XvProcVector[xv_PutStill](client);
 }
 
 static int
 SProcXvGetVideo(ClientPtr client)
 {
-  char n;
   REQUEST(xvGetVideoReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swaps(&stuff->vid_x, n);
-  swaps(&stuff->vid_y, n);
-  swaps(&stuff->vid_w, n);
-  swaps(&stuff->vid_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swaps(&stuff->vid_x);
+  swaps(&stuff->vid_y);
+  swaps(&stuff->vid_w);
+  swaps(&stuff->vid_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
   return XvProcVector[xv_GetVideo](client);
 }
 
 static int
 SProcXvGetStill(ClientPtr client)
 {
-  char n;
   REQUEST(xvGetStillReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swaps(&stuff->vid_x, n);
-  swaps(&stuff->vid_y, n);
-  swaps(&stuff->vid_w, n);
-  swaps(&stuff->vid_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swaps(&stuff->vid_x);
+  swaps(&stuff->vid_y);
+  swaps(&stuff->vid_w);
+  swaps(&stuff->vid_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
   return XvProcVector[xv_GetStill](client);
 }
 
 static int
 SProcXvPutImage(ClientPtr client)
 {
-  char n;
   REQUEST(xvPutImageReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swapl(&stuff->id, n);
-  swaps(&stuff->src_x, n);
-  swaps(&stuff->src_y, n);
-  swaps(&stuff->src_w, n);
-  swaps(&stuff->src_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
-  swaps(&stuff->width, n);
-  swaps(&stuff->height, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swapl(&stuff->id);
+  swaps(&stuff->src_x);
+  swaps(&stuff->src_y);
+  swaps(&stuff->src_w);
+  swaps(&stuff->src_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
+  swaps(&stuff->width);
+  swaps(&stuff->height);
   return XvProcVector[xv_PutImage](client);
 }
 
@@ -1433,25 +1396,24 @@ SProcXvPutImage(ClientPtr client)
 static int
 SProcXvShmPutImage(ClientPtr client)
 {
-  char n;
   REQUEST(xvShmPutImageReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
-  swapl(&stuff->gc, n);
-  swapl(&stuff->shmseg, n);
-  swapl(&stuff->id, n);
-  swapl(&stuff->offset, n);
-  swaps(&stuff->src_x, n);
-  swaps(&stuff->src_y, n);
-  swaps(&stuff->src_w, n);
-  swaps(&stuff->src_h, n);
-  swaps(&stuff->drw_x, n);
-  swaps(&stuff->drw_y, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
-  swaps(&stuff->width, n);
-  swaps(&stuff->height, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
+  swapl(&stuff->gc);
+  swapl(&stuff->shmseg);
+  swapl(&stuff->id);
+  swapl(&stuff->offset);
+  swaps(&stuff->src_x);
+  swaps(&stuff->src_y);
+  swaps(&stuff->src_w);
+  swaps(&stuff->src_h);
+  swaps(&stuff->drw_x);
+  swaps(&stuff->drw_y);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
+  swaps(&stuff->width);
+  swaps(&stuff->height);
   return XvProcVector[xv_ShmPutImage](client);
 }
 #else /* MITSHM */
@@ -1461,101 +1423,92 @@ SProcXvShmPutImage(ClientPtr client)
 static int
 SProcXvSelectVideoNotify(ClientPtr client)
 {
-  char n;
   REQUEST(xvSelectVideoNotifyReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->drawable, n);
+  swaps(&stuff->length);
+  swapl(&stuff->drawable);
   return XvProcVector[xv_SelectVideoNotify](client);
 }
 
 static int
 SProcXvSelectPortNotify(ClientPtr client)
 {
-  char n;
   REQUEST(xvSelectPortNotifyReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
   return XvProcVector[xv_SelectPortNotify](client);
 }
 
 static int
 SProcXvStopVideo(ClientPtr client)
 {
-  char n;
   REQUEST(xvStopVideoReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->drawable, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->drawable);
   return XvProcVector[xv_StopVideo](client);
 }
 
 static int
 SProcXvSetPortAttribute(ClientPtr client)
 {
-  char n;
   REQUEST(xvSetPortAttributeReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->attribute, n);
-  swapl(&stuff->value, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->attribute);
+  swapl(&stuff->value);
   return XvProcVector[xv_SetPortAttribute](client);
 }
 
 static int
 SProcXvGetPortAttribute(ClientPtr client)
 {
-  char n;
   REQUEST(xvGetPortAttributeReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->attribute, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->attribute);
   return XvProcVector[xv_GetPortAttribute](client);
 }
 
 static int
 SProcXvQueryBestSize(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryBestSizeReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swaps(&stuff->vid_w, n);
-  swaps(&stuff->vid_h, n);
-  swaps(&stuff->drw_w, n);
-  swaps(&stuff->drw_h, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swaps(&stuff->vid_w);
+  swaps(&stuff->vid_h);
+  swaps(&stuff->drw_w);
+  swaps(&stuff->drw_h);
   return XvProcVector[xv_QueryBestSize](client);
 }
 
 static int
 SProcXvQueryPortAttributes(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryPortAttributesReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
   return XvProcVector[xv_QueryPortAttributes](client);
 }
 
 static int
 SProcXvQueryImageAttributes(ClientPtr client)
 {
-  char n;
   REQUEST(xvQueryImageAttributesReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
-  swapl(&stuff->id, n);
-  swaps(&stuff->width, n);
-  swaps(&stuff->height, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
+  swapl(&stuff->id);
+  swaps(&stuff->width);
+  swaps(&stuff->height);
   return XvProcVector[xv_QueryImageAttributes](client);
 }
 
 static int
 SProcXvListImageFormats(ClientPtr client)
 {
-  char n;
   REQUEST(xvListImageFormatsReq);
-  swaps(&stuff->length, n);
-  swapl(&stuff->port, n);
+  swaps(&stuff->length);
+  swapl(&stuff->port);
   return XvProcVector[xv_ListImageFormats](client);
 }
 
diff --git a/Xi/allowev.c b/Xi/allowev.c
index 96f3b54..ff9e667 100644
--- a/Xi/allowev.c
+++ b/Xi/allowev.c
@@ -72,12 +72,10 @@ SOFTWARE.
 int
 SProcXAllowDeviceEvents(ClientPtr client)
 {
-    char n;
-
     REQUEST(xAllowDeviceEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
-    swapl(&stuff->time, n);
+    swapl(&stuff->time);
     return (ProcXAllowDeviceEvents(client));
 }
 
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 4c4aeba..ca697d9 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -74,16 +74,15 @@ SOFTWARE.
 int
 SProcXChangeDeviceControl(ClientPtr client)
 {
-    char n;
     xDeviceCtl *ctl;
 
     REQUEST(xChangeDeviceControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
-    swaps(&stuff->control, n);
+    swaps(&stuff->control);
     ctl = (xDeviceCtl*)&stuff[1];
-    swaps(&ctl->control, n);
-    swaps(&ctl->length, n);
+    swaps(&ctl->control);
+    swaps(&ctl->length);
     switch(stuff->control) {
         case DEVICE_ABS_CALIB:
         case DEVICE_ABS_AREA:
@@ -230,9 +229,7 @@ void
 SRepXChangeDeviceControl(ClientPtr client, int size,
 			 xChangeDeviceControlReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index 9189702..f818cd0 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -74,12 +74,10 @@ SOFTWARE.
 int
 SProcXChangeFeedbackControl(ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangeFeedbackControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->mask);
     return (ProcXChangeFeedbackControl(client));
 }
 
@@ -93,17 +91,16 @@ static int
 ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
 		  KbdFeedbackPtr k, xKbdFeedbackCtl * f)
 {
-    char n;
     KeybdCtrl kctrl;
     int t;
     int key = DO_ALL;
 
     if (client->swapped) {
-	swaps(&f->length, n);
-	swaps(&f->pitch, n);
-	swaps(&f->duration, n);
-	swapl(&f->led_mask, n);
-	swapl(&f->led_values, n);
+	swaps(&f->length);
+	swaps(&f->pitch);
+	swaps(&f->duration);
+	swapl(&f->led_mask);
+	swapl(&f->led_values);
     }
 
     kctrl = k->ctrl;
@@ -210,14 +207,13 @@ static int
 ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
 		  PtrFeedbackPtr p, xPtrFeedbackCtl * f)
 {
-    char n;
     PtrCtrl pctrl;	/* might get BadValue part way through */
 
     if (client->swapped) {
-	swaps(&f->length, n);
-	swaps(&f->num, n);
-	swaps(&f->denom, n);
-	swaps(&f->thresh, n);
+	swaps(&f->length);
+	swaps(&f->num);
+	swaps(&f->denom);
+	swaps(&f->thresh);
     }
 
     pctrl = p->ctrl;
@@ -276,11 +272,9 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
 		      long unsigned int mask, IntegerFeedbackPtr i,
 		      xIntegerFeedbackCtl * f)
 {
-    char n;
-
     if (client->swapped) {
-	swaps(&f->length, n);
-	swapl(&f->int_to_display, n);
+	swaps(&f->length);
+	swapl(&f->int_to_display);
     }
 
     i->ctrl.integer_displayed = f->int_to_display;
@@ -299,13 +293,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
 		     long unsigned int mask, StringFeedbackPtr s,
 		     xStringFeedbackCtl * f)
 {
-    char n;
     int i, j;
     KeySym *syms, *sup_syms;
 
     syms = (KeySym *) (f + 1);
     if (client->swapped) {
-	swaps(&f->length, n);	/* swapped num_keysyms in calling proc */
+	swaps(&f->length);	/* swapped num_keysyms in calling proc */
 	SwapLongs((CARD32 *) syms, f->num_keysyms);
     }
 
@@ -339,14 +332,13 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
 		   long unsigned int mask, BellFeedbackPtr b,
 		   xBellFeedbackCtl * f)
 {
-    char n;
     int t;
     BellCtrl bctrl;	/* might get BadValue part way through */
 
     if (client->swapped) {
-	swaps(&f->length, n);
-	swaps(&f->pitch, n);
-	swaps(&f->duration, n);
+	swaps(&f->length);
+	swaps(&f->pitch);
+	swaps(&f->duration);
     }
 
     bctrl = b->ctrl;
@@ -397,13 +389,12 @@ static int
 ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
 		  LedFeedbackPtr l, xLedFeedbackCtl * f)
 {
-    char n;
     LedCtrl lctrl;	/* might get BadValue part way through */
 
     if (client->swapped) {
-	swaps(&f->length, n);
-	swapl(&f->led_values, n);
-	swapl(&f->led_mask, n);
+	swaps(&f->length);
+	swapl(&f->led_values);
+	swapl(&f->led_mask);
     }
 
     f->led_mask &= l->ctrl.led_mask;	/* set only supported leds */
@@ -467,11 +458,10 @@ ProcXChangeFeedbackControl(ClientPtr client)
 	break;
     case StringFeedbackClass:
     {
-	char n;
 	xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
 
 	if (client->swapped) {
-	    swaps(&f->num_keysyms, n);
+	    swaps(&f->num_keysyms);
 	}
 	if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
 	    return BadLength;
diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c
index f9fd099..d813919 100644
--- a/Xi/chgkbd.c
+++ b/Xi/chgkbd.c
@@ -75,10 +75,8 @@ SOFTWARE.
 int
 SProcXChangeKeyboardDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangeKeyboardDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
     return (ProcXChangeKeyboardDevice(client));
 }
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index e4b9e15..32caa2d 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -72,11 +72,10 @@ SOFTWARE.
 int
 SProcXChangeDeviceKeyMapping(ClientPtr client)
 {
-    char n;
     unsigned int count;
 
     REQUEST(xChangeDeviceKeyMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
     count = stuff->keyCodes * stuff->keySymsPerKeyCode;
     REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
index d24a246..a9f833c 100644
--- a/Xi/chgprop.c
+++ b/Xi/chgprop.c
@@ -74,13 +74,11 @@ SOFTWARE.
 int
 SProcXChangeDeviceDontPropagateList(ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangeDeviceDontPropagateListReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
-    swapl(&stuff->window, n);
-    swaps(&stuff->count, n);
+    swapl(&stuff->window);
+    swaps(&stuff->count);
     REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
                       stuff->count * sizeof(CARD32));
     SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/Xi/chgptr.c b/Xi/chgptr.c
index 6a4fbc3..ee04ab6 100644
--- a/Xi/chgptr.c
+++ b/Xi/chgptr.c
@@ -77,10 +77,8 @@ SOFTWARE.
 int
 SProcXChangePointerDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangePointerDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
     return (ProcXChangePointerDevice(client));
 }
diff --git a/Xi/closedev.c b/Xi/closedev.c
index 1064be6..54ada55 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -73,10 +73,8 @@ SOFTWARE.
 int
 SProcXCloseDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xCloseDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCloseDeviceReq);
     return (ProcXCloseDevice(client));
 }
diff --git a/Xi/devbell.c b/Xi/devbell.c
index 539da18..8815242 100644
--- a/Xi/devbell.c
+++ b/Xi/devbell.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXDeviceBell(ClientPtr client)
 {
-    char n;
-
     REQUEST(xDeviceBellReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXDeviceBell(client));
 }
 
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 0905e18..7724f5f 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -533,43 +533,39 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
 static void
 SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
 {
-    char n;
     int i;
     INT32 *ip B32;
 
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swaps(&to->device_state, n);
+    swaps(&to->sequenceNumber);
+    swaps(&to->device_state);
     ip = &to->valuator0;
     for (i = 0; i < 6; i++) {
-	swapl((ip + i), n);	/* macro - braces are required      */
+	swapl(ip + i);
     }
 }
 
 static void
 SEventFocus(deviceFocus * from, deviceFocus * to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->time, n);
-    swapl(&to->window, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
+    swapl(&to->window);
 }
 
 static void
 SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
 {
     int i;
-    char n;
     INT32 *ip B32;
 
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->time, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
     ip = &to->valuator0;
     for (i = 0; i < 3; i++) {
-	swapl((ip + i), n);	/* macro - braces are required      */
+	swapl(ip + i);
     }
 }
 
@@ -577,93 +573,78 @@ static void
 SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
 			   deviceKeyStateNotify * to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
+    swaps(&to->sequenceNumber);
 }
 
 static void
 SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
 			      deviceButtonStateNotify * to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
+    swaps(&to->sequenceNumber);
 }
 
 static void
 SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->time, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
 }
 
 static void
 SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->time, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
 }
 
 static void
 SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber,n);
-    swapl(&to->time, n);
-    swaps(&to->control, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
+    swaps(&to->control);
 }
 
 static void
 SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber,n);
-    swapl(&to->time, n);
-    swapl(&to->atom, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->time);
+    swapl(&to->atom);
 }
 
 static void
 SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber,n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->time, n);
-    swapl(&to->root, n);
-    swapl(&to->event, n);
-    swapl(&to->child, n);
-    swapl(&to->root_x, n);
-    swapl(&to->root_y, n);
-    swapl(&to->event_x, n);
-    swapl(&to->event_y, n);
-    swaps(&to->sourceid, n);
-    swaps(&to->buttons_len, n);
-    swapl(&to->mods.base_mods, n);
-    swapl(&to->mods.latched_mods, n);
-    swapl(&to->mods.locked_mods, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->time);
+    swapl(&to->root);
+    swapl(&to->event);
+    swapl(&to->child);
+    swapl(&to->root_x);
+    swapl(&to->root_y);
+    swapl(&to->event_x);
+    swapl(&to->event_y);
+    swaps(&to->sourceid);
+    swaps(&to->buttons_len);
+    swapl(&to->mods.base_mods);
+    swapl(&to->mods.latched_mods);
+    swapl(&to->mods.locked_mods);
 }
 
 static void
 SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
 {
-    char n;
     int i, j;
     xXIAnyInfo *any;
 
@@ -682,8 +663,8 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
                     xXIKeyInfo *ki = (xXIKeyInfo*)any;
                     uint32_t *key = (uint32_t*)&ki[1];
                     for (j = 0; j < ki->num_keycodes; j++, key++)
-                        swapl(key, n);
-                    swaps(&ki->num_keycodes, n);
+                        swapl(key);
+                    swaps(&ki->num_keycodes);
                 }
                 break;
             case ButtonClass:
@@ -692,71 +673,70 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
                     Atom *labels = (Atom*)((char*)bi + sizeof(xXIButtonInfo) +
                                            pad_to_int32(bits_to_bytes(bi->num_buttons)));
                     for (j = 0; j < bi->num_buttons; j++)
-                        swapl(&labels[j], n);
-                    swaps(&bi->num_buttons, n);
+                        swapl(&labels[j]);
+                    swaps(&bi->num_buttons);
                 }
                 break;
             case ValuatorClass:
                 {
                     xXIValuatorInfo* ai = (xXIValuatorInfo*)any;
-                    swapl(&ai->label, n);
-                    swapl(&ai->min.integral, n);
-                    swapl(&ai->min.frac, n);
-                    swapl(&ai->max.integral, n);
-                    swapl(&ai->max.frac, n);
-                    swapl(&ai->resolution, n);
-                    swaps(&ai->number, n);
+                    swapl(&ai->label);
+                    swapl(&ai->min.integral);
+                    swapl(&ai->min.frac);
+                    swapl(&ai->max.integral);
+                    swapl(&ai->max.frac);
+                    swapl(&ai->resolution);
+                    swaps(&ai->number);
                 }
                 break;
         }
 
-        swaps(&any->type, n);
-        swaps(&any->length, n);
-        swaps(&any->sourceid, n);
+        swaps(&any->type);
+        swaps(&any->length);
+        swaps(&any->sourceid);
 
         any = (xXIAnyInfo*)((char*)any + length * 4);
     }
 
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->time, n);
-    swaps(&to->num_classes, n);
-    swaps(&to->sourceid, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->time);
+    swaps(&to->num_classes);
+    swaps(&to->sourceid);
 
 }
 
 static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
 {
     int i;
-    char n;
     char *ptr;
     char *vmask;
 
     memcpy(to, from, sizeof(xEvent) + from->length * 4);
 
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->time, n);
-    swapl(&to->detail, n);
-    swapl(&to->root, n);
-    swapl(&to->event, n);
-    swapl(&to->child, n);
-    swapl(&to->root_x, n);
-    swapl(&to->root_y, n);
-    swapl(&to->event_x, n);
-    swapl(&to->event_y, n);
-    swaps(&to->buttons_len, n);
-    swaps(&to->valuators_len, n);
-    swaps(&to->sourceid, n);
-    swapl(&to->mods.base_mods, n);
-    swapl(&to->mods.latched_mods, n);
-    swapl(&to->mods.locked_mods, n);
-    swapl(&to->mods.effective_mods, n);
-    swapl(&to->flags, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->time);
+    swapl(&to->detail);
+    swapl(&to->root);
+    swapl(&to->event);
+    swapl(&to->child);
+    swapl(&to->root_x);
+    swapl(&to->root_y);
+    swapl(&to->event_x);
+    swapl(&to->event_y);
+    swaps(&to->buttons_len);
+    swaps(&to->valuators_len);
+    swaps(&to->sourceid);
+    swapl(&to->mods.base_mods);
+    swapl(&to->mods.latched_mods);
+    swapl(&to->mods.locked_mods);
+    swapl(&to->mods.effective_mods);
+    swapl(&to->flags);
 
     ptr = (char*)(&to[1]);
     ptr += from->buttons_len * 4;
@@ -766,9 +746,9 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
     {
         if (BitIsOn(vmask, i))
         {
-            swapl(((uint32_t*)ptr), n);
+            swapl(((uint32_t *)ptr));
             ptr += 4;
-            swapl(((uint32_t*)ptr), n);
+            swapl(((uint32_t *)ptr));
             ptr += 4;
         }
     }
@@ -778,55 +758,51 @@ static void SDeviceHierarchyEvent(xXIHierarchyEvent *from,
                                   xXIHierarchyEvent *to)
 {
     int i;
-    char n;
     xXIHierarchyInfo *info;
 
     *to = *from;
     memcpy(&to[1], &from[1], from->length * 4);
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->time, n);
-    swapl(&to->flags, n);
-    swaps(&to->num_info, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->time);
+    swapl(&to->flags);
+    swaps(&to->num_info);
 
     info = (xXIHierarchyInfo*)&to[1];
     for (i = 0; i< from->num_info; i++)
     {
-        swaps(&info->deviceid, n);
-        swaps(&info->attachment, n);
+        swaps(&info->deviceid);
+        swaps(&info->attachment);
         info++;
     }
 }
 
 static void SXIPropertyEvent(xXIPropertyEvent *from, xXIPropertyEvent *to)
 {
-    char n;
-
     *to = *from;
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->property, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->property);
 }
 
 static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
 {
-    char n;
     int i;
     FP3232 *values;
     unsigned char *mask;
 
     memcpy(to, from, sizeof(xEvent) + from->length * 4);
 
-    swaps(&to->sequenceNumber, n);
-    swapl(&to->length, n);
-    swaps(&to->evtype, n);
-    swaps(&to->deviceid, n);
-    swapl(&to->time, n);
-    swapl(&to->detail, n);
+    swaps(&to->sequenceNumber);
+    swapl(&to->length);
+    swaps(&to->evtype);
+    swaps(&to->deviceid);
+    swapl(&to->time);
+    swapl(&to->detail);
 
 
     mask = (unsigned char*)&to[1];
@@ -841,16 +817,16 @@ static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
              * they were in aAbBcC order because it's easier and really
              * doesn't matter.
              */
-            swapl(&values->integral, n);
-            swapl(&values->frac, n);
+            swapl(&values->integral);
+            swapl(&values->frac);
             values++;
-            swapl(&values->integral, n);
-            swapl(&values->frac, n);
+            swapl(&values->integral);
+            swapl(&values->frac);
             values++;
         }
     }
 
-    swaps(&to->valuators_len, n);
+    swaps(&to->valuators_len);
 }
 
 
diff --git a/Xi/getbmap.c b/Xi/getbmap.c
index e2d5897..b7054f7 100644
--- a/Xi/getbmap.c
+++ b/Xi/getbmap.c
@@ -70,10 +70,8 @@ SOFTWARE.
 int
 SProcXGetDeviceButtonMapping(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceButtonMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXGetDeviceButtonMapping(client));
 }
 
@@ -126,9 +124,7 @@ void
 SRepXGetDeviceButtonMapping(ClientPtr client, int size,
 			    xGetDeviceButtonMappingReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index 4e04b8b..4287028 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.c
@@ -71,12 +71,10 @@ SOFTWARE.
 int
 SProcXGetDeviceControl(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetDeviceControlReq);
-    swaps(&stuff->control, n);
+    swaps(&stuff->control);
     return (ProcXGetDeviceControl(client));
 }
 
@@ -90,7 +88,6 @@ static void
 CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
 			 int length)
 {
-    char n;
     AxisInfoPtr a;
     xDeviceResolutionState *r;
     int i, *iptr;
@@ -108,19 +105,18 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
     for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
 	*iptr++ = a->max_resolution;
     if (client->swapped) {
-	swaps(&r->control, n);
-	swaps(&r->length, n);
-	swapl(&r->num_valuators, n);
+	swaps(&r->control);
+	swaps(&r->length);
+	swapl(&r->num_valuators);
 	iptr = (int *)buf;
 	for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
-	    swapl(iptr, n);
+	    swapl(iptr);
 	}
     }
 }
 
 static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
 {
-    char n;
     xDeviceCoreState *c = (xDeviceCoreState *) buf;
 
     c->control = DEVICE_CORE;
@@ -129,15 +125,14 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
     c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
 
     if (client->swapped) {
-        swaps(&c->control, n);
-        swaps(&c->length, n);
-        swaps(&c->status, n);
+        swaps(&c->control);
+        swaps(&c->length);
+        swaps(&c->status);
     }
 }
 
 static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
 {
-    char n;
     xDeviceEnableState *e = (xDeviceEnableState *) buf;
 
     e->control = DEVICE_ENABLE;
@@ -145,9 +140,9 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
     e->enable = dev->enabled;
 
     if (client->swapped) {
-        swaps(&e->control, n);
-        swaps(&e->length, n);
-        swaps(&e->enable, n);
+        swaps(&e->control);
+        swaps(&e->length);
+        swaps(&e->enable);
     }
 }
 
@@ -161,10 +156,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
 void
 SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
 
diff --git a/Xi/getfctl.c b/Xi/getfctl.c
index 9563d63..ea80a87 100644
--- a/Xi/getfctl.c
+++ b/Xi/getfctl.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXGetFeedbackControl(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetFeedbackControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXGetFeedbackControl(client));
 }
 
@@ -88,7 +86,6 @@ static void
 CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
 {
     int i;
-    char n;
     xKbdFeedbackState *k2;
 
     k2 = (xKbdFeedbackState *) * buf;
@@ -104,11 +101,11 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
     for (i = 0; i < 32; i++)
 	k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
     if (client->swapped) {
-	swaps(&k2->length, n);
-	swaps(&k2->pitch, n);
-	swaps(&k2->duration, n);
-	swapl(&k2->led_mask, n);
-	swapl(&k2->led_values, n);
+	swaps(&k2->length);
+	swaps(&k2->pitch);
+	swaps(&k2->duration);
+	swapl(&k2->led_mask);
+	swapl(&k2->led_values);
     }
     *buf += sizeof(xKbdFeedbackState);
 }
@@ -122,7 +119,6 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
 static void
 CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
 {
-    char n;
     xPtrFeedbackState *p2;
 
     p2 = (xPtrFeedbackState *) * buf;
@@ -133,10 +129,10 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
     p2->accelDenom = p->ctrl.den;
     p2->threshold = p->ctrl.threshold;
     if (client->swapped) {
-	swaps(&p2->length, n);
-	swaps(&p2->accelNum, n);
-	swaps(&p2->accelDenom, n);
-	swaps(&p2->threshold, n);
+	swaps(&p2->length);
+	swaps(&p2->accelNum);
+	swaps(&p2->accelDenom);
+	swaps(&p2->threshold);
     }
     *buf += sizeof(xPtrFeedbackState);
 }
@@ -150,7 +146,6 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
 static void
 CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
 {
-    char n;
     xIntegerFeedbackState *i2;
 
     i2 = (xIntegerFeedbackState *) * buf;
@@ -161,10 +156,10 @@ CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
     i2->min_value = i->ctrl.min_value;
     i2->max_value = i->ctrl.max_value;
     if (client->swapped) {
-	swaps(&i2->length, n);
-	swapl(&i2->resolution, n);
-	swapl(&i2->min_value, n);
-	swapl(&i2->max_value, n);
+	swaps(&i2->length);
+	swapl(&i2->resolution);
+	swapl(&i2->min_value);
+	swapl(&i2->max_value);
     }
     *buf += sizeof(xIntegerFeedbackState);
 }
@@ -179,7 +174,6 @@ static void
 CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
 {
     int i;
-    char n;
     xStringFeedbackState *s2;
     KeySym *kptr;
 
@@ -195,12 +189,12 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
     for (i = 0; i < s->ctrl.num_symbols_supported; i++)
 	*kptr++ = *(s->ctrl.symbols_supported + i);
     if (client->swapped) {
-	swaps(&s2->length, n);
-	swaps(&s2->max_symbols, n);
-	swaps(&s2->num_syms_supported, n);
+	swaps(&s2->length);
+	swaps(&s2->max_symbols);
+	swaps(&s2->num_syms_supported);
 	kptr = (KeySym *) (*buf);
 	for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
-	    swapl(kptr, n);
+	    swapl(kptr);
 	}
     }
     *buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
@@ -215,7 +209,6 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
 static void
 CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
 {
-    char n;
     xLedFeedbackState *l2;
 
     l2 = (xLedFeedbackState *) * buf;
@@ -225,9 +218,9 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
     l2->led_values = l->ctrl.led_values;
     l2->led_mask = l->ctrl.led_mask;
     if (client->swapped) {
-	swaps(&l2->length, n);
-	swapl(&l2->led_values, n);
-	swapl(&l2->led_mask, n);
+	swaps(&l2->length);
+	swapl(&l2->led_values);
+	swapl(&l2->led_mask);
     }
     *buf += sizeof(xLedFeedbackState);
 }
@@ -241,7 +234,6 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
 static void
 CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
 {
-    char n;
     xBellFeedbackState *b2;
 
     b2 = (xBellFeedbackState *) * buf;
@@ -252,9 +244,9 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
     b2->pitch = b->ctrl.pitch;
     b2->duration = b->ctrl.duration;
     if (client->swapped) {
-	swaps(&b2->length, n);
-	swaps(&b2->pitch, n);
-	swaps(&b2->duration, n);
+	swaps(&b2->length);
+	swaps(&b2->pitch);
+	swaps(&b2->duration);
     }
     *buf += sizeof(xBellFeedbackState);
 }
@@ -270,11 +262,9 @@ void
 SRepXGetFeedbackControl(ClientPtr client, int size,
 			xGetFeedbackControlReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->num_feedbacks, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->num_feedbacks);
     WriteToClient(client, size, (char *)rep);
 }
 
diff --git a/Xi/getfocus.c b/Xi/getfocus.c
index 69eadde..676850d 100644
--- a/Xi/getfocus.c
+++ b/Xi/getfocus.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXGetDeviceFocus(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceFocusReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXGetDeviceFocus(client));
 }
 
@@ -133,11 +131,9 @@ ProcXGetDeviceFocus(ClientPtr client)
 void
 SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->focus, n);
-    swapl(&rep->time, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->focus);
+    swapl(&rep->time);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getkmap.c b/Xi/getkmap.c
index c38467b..2501ec0 100644
--- a/Xi/getkmap.c
+++ b/Xi/getkmap.c
@@ -74,10 +74,8 @@ SOFTWARE.
 int
 SProcXGetDeviceKeyMapping(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceKeyMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXGetDeviceKeyMapping(client));
 }
 
@@ -150,9 +148,7 @@ void
 SRepXGetDeviceKeyMapping(ClientPtr client, int size,
 			 xGetDeviceKeyMappingReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getmmap.c b/Xi/getmmap.c
index bd652e9..4eee006 100644
--- a/Xi/getmmap.c
+++ b/Xi/getmmap.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXGetDeviceModifierMapping(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceModifierMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXGetDeviceModifierMapping(client));
 }
 
@@ -129,9 +127,7 @@ void
 SRepXGetDeviceModifierMapping(ClientPtr client, int size,
 			      xGetDeviceModifierMappingReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getprop.c b/Xi/getprop.c
index 5e10262..11afd37 100644
--- a/Xi/getprop.c
+++ b/Xi/getprop.c
@@ -75,12 +75,10 @@ extern int ExtEventIndex;
 int
 SProcXGetDeviceDontPropagateList(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceDontPropagateListReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
-    swapl(&stuff->window, n);
+    swapl(&stuff->window);
     return (ProcXGetDeviceDontPropagateList(client));
 }
 
@@ -178,10 +176,8 @@ void
 SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
 				xGetDeviceDontPropagateListReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->count, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->count);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getselev.c b/Xi/getselev.c
index 7304738..b316e23 100644
--- a/Xi/getselev.c
+++ b/Xi/getselev.c
@@ -73,12 +73,10 @@ SOFTWARE.
 int
 SProcXGetSelectedExtensionEvents(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetSelectedExtensionEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
-    swapl(&stuff->window, n);
+    swapl(&stuff->window);
     return (ProcXGetSelectedExtensionEvents(client));
 }
 
@@ -168,11 +166,9 @@ void
 SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
 				xGetSelectedExtensionEventsReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->this_client_count, n);
-    swaps(&rep->all_clients_count, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->this_client_count);
+    swaps(&rep->all_clients_count);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/getvers.c b/Xi/getvers.c
index c8e9ebc..8bea1c4 100644
--- a/Xi/getvers.c
+++ b/Xi/getvers.c
@@ -73,12 +73,10 @@ XExtensionVersion XIVersion;
 int
 SProcXGetExtensionVersion(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetExtensionVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->nbytes);
     return (ProcXGetExtensionVersion(client));
 }
 
@@ -125,11 +123,9 @@ void
 SRepXGetExtensionVersion(ClientPtr client, int size,
 			 xGetExtensionVersionReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->major_version, n);
-    swaps(&rep->minor_version, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->major_version);
+    swaps(&rep->minor_version);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index 925c9a6..4572c33 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -75,14 +75,12 @@ extern int ExtEventIndex;
 int
 SProcXGrabDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGrabDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
-    swapl(&stuff->grabWindow, n);
-    swapl(&stuff->time, n);
-    swaps(&stuff->event_count, n);
+    swapl(&stuff->grabWindow);
+    swapl(&stuff->time);
+    swaps(&stuff->event_count);
 
     if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
        return BadLength;
@@ -210,9 +208,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
 void
 SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index e235f53..2897d41 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -74,14 +74,12 @@ SOFTWARE.
 int
 SProcXGrabDeviceButton(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGrabDeviceButtonReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
-    swaps(&stuff->event_count, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
+    swaps(&stuff->event_count);
     REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
                       stuff->event_count * sizeof(CARD32));
     SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index b34867b..cedd90d 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -74,14 +74,12 @@ SOFTWARE.
 int
 SProcXGrabDeviceKey(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGrabDeviceKeyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
-    swaps(&stuff->event_count, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
+    swaps(&stuff->event_count);
     REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
     SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
     return (ProcXGrabDeviceKey(client));
diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c
index 9132f4f..34f167b 100644
--- a/Xi/gtmotion.c
+++ b/Xi/gtmotion.c
@@ -71,13 +71,11 @@ SOFTWARE.
 int
 SProcXGetDeviceMotionEvents(ClientPtr client)
 {
-    char n;
-
     REQUEST(xGetDeviceMotionEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
-    swapl(&stuff->start, n);
-    swapl(&stuff->stop, n);
+    swapl(&stuff->start);
+    swapl(&stuff->stop);
     return (ProcXGetDeviceMotionEvents(client));
 }
 
@@ -143,11 +141,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
     WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
     if (nEvents) {
 	if (client->swapped) {
-	    char n;
-
 	    bufptr = coords;
 	    for (i = 0; i < nEvents * (axes + 1); i++) {
-		swapl(bufptr, n);
+		swapl(bufptr);
 		bufptr++;
 	    }
 	}
@@ -168,10 +164,8 @@ void
 SRepXGetDeviceMotionEvents(ClientPtr client, int size,
 			   xGetDeviceMotionEventsReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->nEvents, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->nEvents);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/listdev.c b/Xi/listdev.c
index 29f0d96..1b3081d 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -78,10 +78,8 @@ SOFTWARE.
 int
 SProcXListInputDevices(ClientPtr client)
 {
-    char n;
-
     REQUEST(xListInputDevicesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXListInputDevices(client));
 }
 
@@ -145,7 +143,6 @@ CopyDeviceName(char **namebuf, char *name)
 static void
 CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
 {
-    char n;
     xButtonInfoPtr b2;
 
     b2 = (xButtonInfoPtr) * buf;
@@ -153,7 +150,7 @@ CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
     b2->length = sizeof(xButtonInfo);
     b2->num_buttons = b->numButtons;
     if (client && client->swapped) {
-	swaps(&b2->num_buttons, n);	/* macro - braces are required */
+	swaps(&b2->num_buttons);
     }
     *buf += sizeof(xButtonInfo);
 }
@@ -168,7 +165,6 @@ static void
 CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
 	       char **buf)
 {
-    char n;
     xDeviceInfoPtr dev;
 
     dev = (xDeviceInfoPtr) * buf;
@@ -188,7 +184,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
 	dev->use = IsXExtensionDevice;
 
     if (client->swapped) {
-	swapl(&dev->type, n);	/* macro - braces are required */
+	swapl(&dev->type);
     }
     *buf += sizeof(xDeviceInfo);
 }
@@ -202,7 +198,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
 static void
 CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
 {
-    char n;
     xKeyInfoPtr k2;
 
     k2 = (xKeyInfoPtr) * buf;
@@ -212,7 +207,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
     k2->max_keycode = k->xkbInfo->desc->max_key_code;
     k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
     if (client && client->swapped) {
-	swaps(&k2->num_keys, n);
+	swaps(&k2->num_keys);
     }
     *buf += sizeof(xKeyInfo);
 }
@@ -233,7 +228,6 @@ static int
 CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
 {
     int i, j, axes, t_axes;
-    char n;
     ValuatorClassPtr v = dev->valuator;
     xValuatorInfoPtr v2;
     AxisInfo *a;
@@ -251,7 +245,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
 	v2->mode = valuator_get_mode(dev, 0);
 	v2->motion_buffer_size = v->numMotionEvents;
 	if (client && client->swapped) {
-	    swapl(&v2->motion_buffer_size, n);
+	    swapl(&v2->motion_buffer_size);
 	}
 	*buf += sizeof(xValuatorInfo);
 	a = v->axes + (VPC * i);
@@ -261,9 +255,9 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
 	    a2->max_value = a->max_value;
 	    a2->resolution = a->resolution;
 	    if (client && client->swapped) {
-		swapl(&a2->min_value, n);
-		swapl(&a2->max_value, n);
-		swapl(&a2->resolution, n);
+		swapl(&a2->min_value);
+		swapl(&a2->max_value);
+		swapl(&a2->resolution);
 	    }
 	    a2++;
 	    a++;
@@ -424,9 +418,7 @@ ProcXListInputDevices(ClientPtr client)
 void
 SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/opendev.c b/Xi/opendev.c
index 13841dc..ba0d304 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -76,10 +76,8 @@ extern CARD8 event_base[];
 int
 SProcXOpenDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xOpenDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXOpenDevice(client));
 }
 
@@ -166,9 +164,7 @@ ProcXOpenDevice(ClientPtr client)
 void
 SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/queryst.c b/Xi/queryst.c
index 73af76d..8c3bdcf 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -56,10 +56,8 @@ from The Open Group.
 int
 SProcXQueryDeviceState(ClientPtr client)
 {
-    char n;
-
     REQUEST(xQueryDeviceStateReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXQueryDeviceState(client));
 }
 
@@ -72,7 +70,6 @@ SProcXQueryDeviceState(ClientPtr client)
 int
 ProcXQueryDeviceState(ClientPtr client)
 {
-    char n;
     int rc, i;
     int num_classes = 0;
     int total_length = 0;
@@ -159,7 +156,7 @@ ProcXQueryDeviceState(ClientPtr client)
 		*((int *)buf) = *values;
 	    values++;
 	    if (client->swapped) {
-		swapl((int *)buf, n);	/* macro - braces needed */
+		swapl((int *)buf);
 	    }
 	    buf += sizeof(int);
 	}
@@ -184,9 +181,7 @@ ProcXQueryDeviceState(ClientPtr client)
 void
 SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/selectev.c b/Xi/selectev.c
index 031e602..4c2c2fe 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -123,13 +123,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
 int
 SProcXSelectExtensionEvent(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSelectExtensionEventReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
-    swapl(&stuff->window, n);
-    swaps(&stuff->count, n);
+    swapl(&stuff->window);
+    swaps(&stuff->count);
     REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
                       stuff->count * sizeof(CARD32));
     SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
index 16cbd6f..4770c28 100644
--- a/Xi/sendexev.c
+++ b/Xi/sendexev.c
@@ -76,7 +76,6 @@ extern int lastEvent;	/* Defined in extension.c */
 int
 SProcXSendExtensionEvent(ClientPtr client)
 {
-    char n;
     CARD32 *p;
     int i;
     xEvent eventT;
@@ -84,10 +83,10 @@ SProcXSendExtensionEvent(ClientPtr client)
     EventSwapPtr proc;
 
     REQUEST(xSendExtensionEventReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
-    swapl(&stuff->destination, n);
-    swaps(&stuff->count, n);
+    swapl(&stuff->destination);
+    swaps(&stuff->count);
 
     if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
        bytes_to_int32(stuff->num_events * sizeof(xEvent)))
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 37c40e4..2a8f5d3 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXSetDeviceButtonMapping(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSetDeviceButtonMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXSetDeviceButtonMapping(client));
 }
 
@@ -132,9 +130,7 @@ void
 SRepXSetDeviceButtonMapping(ClientPtr client, int size,
 			    xSetDeviceButtonMappingReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/setdval.c b/Xi/setdval.c
index b384f0d..ea17852 100644
--- a/Xi/setdval.c
+++ b/Xi/setdval.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXSetDeviceValuators(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSetDeviceValuatorsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXSetDeviceValuators(client));
 }
 
@@ -138,9 +136,7 @@ void
 SRepXSetDeviceValuators(ClientPtr client, int size,
 			xSetDeviceValuatorsReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/setfocus.c b/Xi/setfocus.c
index 03bc37a..feec3fc 100644
--- a/Xi/setfocus.c
+++ b/Xi/setfocus.c
@@ -74,13 +74,11 @@ SOFTWARE.
 int
 SProcXSetDeviceFocus(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSetDeviceFocusReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
-    swapl(&stuff->focus, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->focus);
+    swapl(&stuff->time);
     return (ProcXSetDeviceFocus(client));
 }
 
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index cbe5dc8..dc6d828 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -73,10 +73,8 @@ SOFTWARE.
 int
 SProcXSetDeviceModifierMapping(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSetDeviceModifierMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXSetDeviceModifierMapping(client));
 }
 
@@ -140,9 +138,7 @@ void
 SRepXSetDeviceModifierMapping(ClientPtr client, int size,
 			      xSetDeviceModifierMappingReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/setmode.c b/Xi/setmode.c
index 42e90f7..80ee764 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -71,10 +71,8 @@ SOFTWARE.
 int
 SProcXSetDeviceMode(ClientPtr client)
 {
-    char n;
-
     REQUEST(xSetDeviceModeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXSetDeviceMode(client));
 }
 
@@ -138,9 +136,7 @@ ProcXSetDeviceMode(ClientPtr client)
 void
 SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c
index a09c3d0..bc66cfc 100644
--- a/Xi/ungrdev.c
+++ b/Xi/ungrdev.c
@@ -70,12 +70,10 @@ SOFTWARE.
 int
 SProcXUngrabDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xUngrabDeviceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xUngrabDeviceReq);
-    swapl(&stuff->time, n);
+    swapl(&stuff->time);
     return (ProcXUngrabDevice(client));
 }
 
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c
index 4e93f1a..9e9ece4 100644
--- a/Xi/ungrdevb.c
+++ b/Xi/ungrdevb.c
@@ -76,13 +76,11 @@ SOFTWARE.
 int
 SProcXUngrabDeviceButton(ClientPtr client)
 {
-    char n;
-
     REQUEST(xUngrabDeviceButtonReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
     return (ProcXUngrabDeviceButton(client));
 }
 
diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c
index 3b4d626..526347d 100644
--- a/Xi/ungrdevk.c
+++ b/Xi/ungrdevk.c
@@ -78,13 +78,11 @@ SOFTWARE.
 int
 SProcXUngrabDeviceKey(ClientPtr client)
 {
-    char n;
-
     REQUEST(xUngrabDeviceKeyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
     return (ProcXUngrabDeviceKey(client));
 }
 
diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
index 3077e1a..0d45b36 100644
--- a/Xi/xiallowev.c
+++ b/Xi/xiallowev.c
@@ -44,13 +44,11 @@
 int
 SProcXIAllowEvents(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIAllowEventsReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->time, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->time);
 
     return ProcXIAllowEvents(client);
 }
diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
index 2153393..48f51f3 100644
--- a/Xi/xichangecursor.c
+++ b/Xi/xichangecursor.c
@@ -56,13 +56,11 @@
 int
 SProcXIChangeCursor(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIChangeCursorReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->win, n);
-    swapl(&stuff->cursor, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swapl(&stuff->win);
+    swapl(&stuff->cursor);
+    swaps(&stuff->deviceid);
     REQUEST_SIZE_MATCH(xXIChangeCursorReq);
     return (ProcXIChangeCursor(client));
 }
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 96ead6f..f2bd8bb 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -133,10 +133,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
 
 int SProcXIChangeHierarchy(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIChangeHierarchyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (ProcXIChangeHierarchy(client));
 }
 
@@ -424,7 +422,6 @@ ProcXIChangeHierarchy(ClientPtr client)
 {
     xXIAnyHierarchyChangeInfo *any;
     int required_len = sizeof(xXIChangeHierarchyReq);
-    char n;
     int rc = Success;
     int flags[MAXDEVICES] = {0};
 
@@ -437,8 +434,8 @@ ProcXIChangeHierarchy(ClientPtr client)
     any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
     while(stuff->num_changes--)
     {
-        SWAPIF(swapl(&any->type, n));
-        SWAPIF(swaps(&any->length, n));
+        SWAPIF(swapl(&any->type));
+        SWAPIF(swaps(&any->length));
 
         required_len += any->length;
         if ((stuff->length * 4) < required_len)
@@ -449,7 +446,7 @@ ProcXIChangeHierarchy(ClientPtr client)
             case XIAddMaster:
                 {
                     xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
-                    SWAPIF(swaps(&c->name_len, n));
+                    SWAPIF(swaps(&c->name_len));
 
                     rc = add_master(client, c, flags);
                     if (rc != Success)
diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c
index 401e89f..1124ae0 100644
--- a/Xi/xigetclientpointer.c
+++ b/Xi/xigetclientpointer.c
@@ -49,11 +49,10 @@
 int
 SProcXIGetClientPointer(ClientPtr client)
 {
-    char n;
     REQUEST(xXIGetClientPointerReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->win, n);
+    swaps(&stuff->length);
+    swapl(&stuff->win);
     return ProcXIGetClientPointer(client);
 }
 
@@ -97,10 +96,9 @@ void
 SRepXIGetClientPointer(ClientPtr client, int size,
         xXIGetClientPointerReply* rep)
 {
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->deviceid, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->deviceid);
     WriteToClient(client, size, (char *)rep);
 }
 
diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c
index 0adc878..a9b655c 100644
--- a/Xi/xigrabdev.c
+++ b/Xi/xigrabdev.c
@@ -45,16 +45,14 @@
 int
 SProcXIGrabDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIGrabDeviceReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->grab_window, n);
-    swapl(&stuff->cursor, n);
-    swapl(&stuff->time, n);
-    swaps(&stuff->mask_len, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->grab_window);
+    swapl(&stuff->cursor);
+    swapl(&stuff->time);
+    swaps(&stuff->mask_len);
 
     return ProcXIGrabDevice(client);
 }
@@ -115,13 +113,11 @@ ProcXIGrabDevice(ClientPtr client)
 int
 SProcXIUngrabDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIUngrabDeviceReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->time, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->time);
 
     return ProcXIUngrabDevice(client);
 }
@@ -153,9 +149,7 @@ ProcXIUngrabDevice(ClientPtr client)
 
 void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index ae43433..6b45748 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -49,27 +49,26 @@ int
 SProcXIPassiveGrabDevice(ClientPtr client)
 {
     int i;
-    char n;
     xXIModifierInfo *mods;
 
     REQUEST(xXIPassiveGrabDeviceReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->grab_window, n);
-    swapl(&stuff->cursor, n);
-    swapl(&stuff->time, n);
-    swapl(&stuff->detail, n);
-    swaps(&stuff->mask_len, n);
-    swaps(&stuff->num_modifiers, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->grab_window);
+    swapl(&stuff->cursor);
+    swapl(&stuff->time);
+    swapl(&stuff->detail);
+    swaps(&stuff->mask_len);
+    swaps(&stuff->num_modifiers);
 
     mods = (xXIModifierInfo*)&stuff[1];
 
     for (i = 0; i < stuff->num_modifiers; i++, mods++)
     {
-        swapl(&mods->base_mods, n);
-        swapl(&mods->latched_mods, n);
-        swapl(&mods->locked_mods, n);
+        swapl(&mods->base_mods);
+        swapl(&mods->latched_mods);
+        swapl(&mods->locked_mods);
     }
 
     return ProcXIPassiveGrabDevice(client);
@@ -88,7 +87,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
     GrabParameters param;
     void *tmp;
     int mask_len;
-    int n;
 
     REQUEST(xXIPassiveGrabDeviceReq);
     REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
@@ -198,7 +196,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
             info->status = status;
             info->modifiers = *modifiers;
             if (client->swapped)
-                swapl(&info->modifiers, n);
+                swapl(&info->modifiers);
 
             rep.num_modifiers++;
             rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
@@ -217,11 +215,9 @@ void
 SRepXIPassiveGrabDevice(ClientPtr client, int size,
                         xXIPassiveGrabDeviceReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->num_modifiers, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->num_modifiers);
 
     WriteToClient(client, size, (char *)rep);
 }
@@ -229,22 +225,21 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size,
 int
 SProcXIPassiveUngrabDevice(ClientPtr client)
 {
-    char n;
     int i;
     uint32_t *modifiers;
 
     REQUEST(xXIPassiveUngrabDeviceReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->grab_window, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->detail, n);
-    swaps(&stuff->num_modifiers, n);
+    swaps(&stuff->length);
+    swapl(&stuff->grab_window);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->detail);
+    swaps(&stuff->num_modifiers);
 
     modifiers = (uint32_t*)&stuff[1];
 
     for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
-        swapl(modifiers, n);
+        swapl(modifiers);
 
     return ProcXIPassiveUngrabDevice(client);
 }
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 83ce930..fa0d811 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -1036,10 +1036,9 @@ ProcXGetDeviceProperty (ClientPtr client)
 int
 SProcXListDeviceProperties (ClientPtr client)
 {
-    char n;
     REQUEST(xListDevicePropertiesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
 
     REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
     return (ProcXListDeviceProperties(client));
@@ -1048,25 +1047,23 @@ SProcXListDeviceProperties (ClientPtr client)
 int
 SProcXChangeDeviceProperty (ClientPtr client)
 {
-    char n;
     REQUEST(xChangeDevicePropertyReq);
 
     REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->nUnits, n);
+    swaps(&stuff->length);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->nUnits);
     return (ProcXChangeDeviceProperty(client));
 }
 
 int
 SProcXDeleteDeviceProperty (ClientPtr client)
 {
-    char n;
     REQUEST(xDeleteDevicePropertyReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->property, n);
+    swaps(&stuff->length);
+    swapl(&stuff->property);
     REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
     return (ProcXDeleteDeviceProperty(client));
 }
@@ -1074,14 +1071,13 @@ SProcXDeleteDeviceProperty (ClientPtr client)
 int
 SProcXGetDeviceProperty (ClientPtr client)
 {
-    char n;
     REQUEST(xGetDevicePropertyReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->longOffset, n);
-    swapl(&stuff->longLength, n);
+    swaps(&stuff->length);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->longOffset);
+    swapl(&stuff->longLength);
     REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
     return (ProcXGetDeviceProperty(client));
 }
@@ -1093,10 +1089,9 @@ void
 SRepXListDeviceProperties(ClientPtr client, int size,
                           xListDevicePropertiesReply *rep)
 {
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->nAtoms, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->nAtoms);
     /* properties will be swapped later, see ProcXListDeviceProperties */
     WriteToClient(client, size, (char*)rep);
 }
@@ -1105,13 +1100,11 @@ void
 SRepXGetDeviceProperty(ClientPtr client, int size,
                        xGetDevicePropertyReply *rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->propertyType, n);
-    swapl(&rep->bytesAfter, n);
-    swapl(&rep->nItems, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->propertyType);
+    swapl(&rep->bytesAfter);
+    swapl(&rep->nItems);
     /* data will be swapped, see ProcXGetDeviceProperty */
     WriteToClient(client, size, (char*)rep);
 }
@@ -1279,11 +1272,10 @@ ProcXIGetProperty(ClientPtr client)
 int
 SProcXIListProperties(ClientPtr client)
 {
-    char n;
     REQUEST(xXIListPropertiesReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
 
     REQUEST_SIZE_MATCH(xXIListPropertiesReq);
     return (ProcXIListProperties(client));
@@ -1292,27 +1284,25 @@ SProcXIListProperties(ClientPtr client)
 int
 SProcXIChangeProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xXIChangePropertyReq);
 
     REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->num_items, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->num_items);
     return (ProcXIChangeProperty(client));
 }
 
 int
 SProcXIDeleteProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xXIDeletePropertyReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->property, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->property);
     REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
     return (ProcXIDeleteProperty(client));
 }
@@ -1320,15 +1310,14 @@ SProcXIDeleteProperty(ClientPtr client)
 int
 SProcXIGetProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xXIGetPropertyReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->offset, n);
-    swapl(&stuff->len, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->offset);
+    swapl(&stuff->len);
     REQUEST_SIZE_MATCH(xXIGetPropertyReq);
     return (ProcXIGetProperty(client));
 }
@@ -1338,10 +1327,9 @@ void
 SRepXIListProperties(ClientPtr client, int size,
                      xXIListPropertiesReply *rep)
 {
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->num_properties, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->num_properties);
     /* properties will be swapped later, see ProcXIListProperties */
     WriteToClient(client, size, (char*)rep);
 }
@@ -1350,13 +1338,11 @@ void
 SRepXIGetProperty(ClientPtr client, int size,
                   xXIGetPropertyReply *rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->type, n);
-    swapl(&rep->bytes_after, n);
-    swapl(&rep->num_items, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->type);
+    swapl(&rep->bytes_after);
+    swapl(&rep->num_items);
     /* data will be swapped, see ProcXIGetProperty */
     WriteToClient(client, size, (char*)rep);
 }
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index a768d49..f5fca0d 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -52,12 +52,10 @@ static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
 int
 SProcXIQueryDevice(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIQueryDeviceReq);
 
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
 
     return ProcXIQueryDevice(client);
 }
@@ -166,11 +164,9 @@ ProcXIQueryDevice(ClientPtr client)
 void
 SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->num_devices, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->num_devices);
 
     /* Device info is already swapped, see ProcXIQueryDevice */
 
@@ -278,17 +274,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
 static void
 SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
 {
-    char n;
     Atom *btn;
     int i;
-    swaps(&info->type, n);
-    swaps(&info->length, n);
-    swaps(&info->sourceid, n);
+    swaps(&info->type);
+    swaps(&info->length);
+    swaps(&info->sourceid);
 
     for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
-        swaps(btn, n);
+        swaps(btn);
 
-    swaps(&info->num_buttons, n);
+    swaps(&info->num_buttons);
 }
 
 /**
@@ -317,17 +312,16 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
 static void
 SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
 {
-    char n;
     uint32_t *key;
     int i;
-    swaps(&info->type, n);
-    swaps(&info->length, n);
-    swaps(&info->sourceid, n);
+    swaps(&info->type);
+    swaps(&info->length);
+    swaps(&info->sourceid);
 
     for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++)
-        swapl(key, n);
+        swapl(key);
 
-    swaps(&info->num_keycodes, n);
+    swaps(&info->num_keycodes);
 }
 
 /**
@@ -364,16 +358,15 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
 static void
 SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
 {
-    char n;
-    swaps(&info->type, n);
-    swaps(&info->length, n);
-    swapl(&info->label, n);
-    swapl(&info->min.integral, n);
-    swapl(&info->min.frac, n);
-    swapl(&info->max.integral, n);
-    swapl(&info->max.frac, n);
-    swaps(&info->number, n);
-    swaps(&info->sourceid, n);
+    swaps(&info->type);
+    swaps(&info->length);
+    swapl(&info->label);
+    swapl(&info->min.integral);
+    swapl(&info->min.frac);
+    swapl(&info->max.integral);
+    swapl(&info->max.frac);
+    swaps(&info->number);
+    swaps(&info->sourceid);
 }
 
 int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
@@ -471,7 +464,6 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
 static void
 SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
 {
-    char n;
     char *any = (char*)&info[1];
     int i;
 
@@ -497,10 +489,10 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
         any += len * 4;
     }
 
-    swaps(&info->deviceid, n);
-    swaps(&info->use, n);
-    swaps(&info->attachment, n);
-    swaps(&info->num_classes, n);
-    swaps(&info->name_len, n);
+    swaps(&info->deviceid);
+    swaps(&info->use);
+    swaps(&info->attachment);
+    swaps(&info->num_classes);
+    swaps(&info->name_len);
 
 }
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 5131799..9e05eff 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -61,12 +61,10 @@
 int
 SProcXIQueryPointer(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIQueryPointerReq);
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->win, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->win);
     return (ProcXIQueryPointer(client));
 }
 
@@ -212,17 +210,15 @@ void
 SRepXIQueryPointer(ClientPtr client, int size,
                    xXIQueryPointerReply * rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->root, n);
-    swapl(&rep->child, n);
-    swapl(&rep->root_x, n);
-    swapl(&rep->root_y, n);
-    swapl(&rep->win_x, n);
-    swapl(&rep->win_y, n);
-    swaps(&rep->buttons_len, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->root);
+    swapl(&rep->child);
+    swapl(&rep->root_x);
+    swapl(&rep->root_y);
+    swapl(&rep->win_x);
+    swapl(&rep->win_y);
+    swaps(&rep->buttons_len);
 
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
index f647f98..a940614 100644
--- a/Xi/xiqueryversion.c
+++ b/Xi/xiqueryversion.c
@@ -103,23 +103,20 @@ ProcXIQueryVersion(ClientPtr client)
 int
 SProcXIQueryVersion(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
-    swaps(&stuff->major_version, n);
-    swaps(&stuff->minor_version, n);
+    swaps(&stuff->major_version);
+    swaps(&stuff->minor_version);
     return (ProcXIQueryVersion(client));
 }
 
 void
 SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep)
 {
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->major_version, n);
-    swaps(&rep->minor_version, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->major_version);
+    swaps(&rep->minor_version);
     WriteToClient(client, size, (char *)rep);
 }
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 22fbaf5..3af4f1f 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -63,21 +63,20 @@ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
 int
 SProcXISelectEvents(ClientPtr client)
 {
-    char n;
     int i;
     xXIEventMask* evmask;
 
     REQUEST(xXISelectEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
-    swapl(&stuff->win, n);
-    swaps(&stuff->num_masks, n);
+    swapl(&stuff->win);
+    swaps(&stuff->num_masks);
 
     evmask = (xXIEventMask*)&stuff[1];
     for (i = 0; i < stuff->num_masks; i++)
     {
-        swaps(&evmask->deviceid, n);
-        swaps(&evmask->mask_len, n);
+        swaps(&evmask->deviceid);
+        swaps(&evmask->mask_len);
         evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
     }
 
@@ -192,12 +191,10 @@ ProcXISelectEvents(ClientPtr client)
 int
 SProcXIGetSelectedEvents(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIGetSelectedEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
-    swapl(&stuff->win, n);
+    swapl(&stuff->win);
 
     return (ProcXIGetSelectedEvents(client));
 }
@@ -207,7 +204,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
 {
     int rc, i;
     WindowPtr win;
-    char n;
     char *buffer = NULL;
     xXIGetSelectedEventsReply reply;
     OtherInputMasks *masks;
@@ -275,8 +271,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
 
                 if (client->swapped)
                 {
-                    swaps(&evmask->deviceid, n);
-                    swaps(&evmask->mask_len, n);
+                    swaps(&evmask->deviceid);
+                    swaps(&evmask->mask_len);
                 }
 
                 memcpy(&evmask[1], devmask, j + 1);
@@ -299,11 +295,9 @@ ProcXIGetSelectedEvents(ClientPtr client)
 void SRepXIGetSelectedEvents(ClientPtr client,
                             int len, xXIGetSelectedEventsReply *rep)
 {
-    char n;
-
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swaps(&rep->num_masks, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swaps(&rep->num_masks);
     WriteToClient(client, len, (char *)rep);
 }
 
diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c
index 09db8ff..934747d 100644
--- a/Xi/xisetclientpointer.c
+++ b/Xi/xisetclientpointer.c
@@ -51,12 +51,10 @@
 int
 SProcXISetClientPointer(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXISetClientPointerReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->win, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swapl(&stuff->win);
+    swaps(&stuff->deviceid);
     REQUEST_SIZE_MATCH(xXISetClientPointerReq);
     return (ProcXISetClientPointer(client));
 }
diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c
index 059424e..294df7c 100644
--- a/Xi/xisetdevfocus.c
+++ b/Xi/xisetdevfocus.c
@@ -43,13 +43,11 @@
 int
 SProcXISetFocus(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXISetFocusReq);
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
-    swapl(&stuff->focus, n);
-    swapl(&stuff->time, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
+    swapl(&stuff->focus);
+    swapl(&stuff->time);
 
     return ProcXISetFocus(client);
 }
@@ -57,11 +55,9 @@ SProcXISetFocus(ClientPtr client)
 int
 SProcXIGetFocus(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIGetFocusReq);
-    swaps(&stuff->length, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swaps(&stuff->deviceid);
 
     return ProcXIGetFocus(client);
 }
@@ -122,9 +118,8 @@ ProcXIGetFocus(ClientPtr client)
 void
 SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep)
 {
-    char n;
-    swaps(&rep->sequenceNumber, n);
-    swapl(&rep->length, n);
-    swapl(&rep->focus, n);
+    swaps(&rep->sequenceNumber);
+    swapl(&rep->length);
+    swapl(&rep->focus);
     WriteToClient(client, len, (char *)rep);
 }
diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c
index a463ab9..8fcb4d1 100644
--- a/Xi/xiwarppointer.c
+++ b/Xi/xiwarppointer.c
@@ -56,19 +56,17 @@
 int
 SProcXIWarpPointer(ClientPtr client)
 {
-    char n;
-
     REQUEST(xXIWarpPointerReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->src_win, n);
-    swapl(&stuff->dst_win, n);
-    swapl(&stuff->src_x, n);
-    swapl(&stuff->src_y, n);
-    swaps(&stuff->src_width, n);
-    swaps(&stuff->src_height, n);
-    swapl(&stuff->dst_x, n);
-    swapl(&stuff->dst_y, n);
-    swaps(&stuff->deviceid, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src_win);
+    swapl(&stuff->dst_win);
+    swapl(&stuff->src_x);
+    swapl(&stuff->src_y);
+    swaps(&stuff->src_width);
+    swaps(&stuff->src_height);
+    swapl(&stuff->dst_x);
+    swapl(&stuff->dst_y);
+    swaps(&stuff->deviceid);
     return (ProcXIWarpPointer(client));
 }
 
diff --git a/composite/compext.c b/composite/compext.c
index e0d8e75..722587a 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -109,7 +109,6 @@ ProcCompositeQueryVersion (ClientPtr client)
 {
     CompositeClientPtr pCompositeClient = GetCompositeClient (client);
     xCompositeQueryVersionReply rep;
-    register int n;
     REQUEST(xCompositeQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
@@ -126,10 +125,10 @@ ProcCompositeQueryVersion (ClientPtr client)
     pCompositeClient->major_version = rep.majorVersion;
     pCompositeClient->minor_version = rep.minorVersion;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
     return Success;
@@ -315,10 +314,9 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
 
     if (client->swapped)
     {
-	int n;
-	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.overlayWin, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.overlayWin);
     }
     (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
 
@@ -377,111 +375,102 @@ ProcCompositeDispatch (ClientPtr client)
 static int
 SProcCompositeQueryVersion (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeQueryVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
-    swapl(&stuff->majorVersion, n);
-    swapl(&stuff->minorVersion, n);
+    swapl(&stuff->majorVersion);
+    swapl(&stuff->minorVersion);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeRedirectWindow (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeRedirectWindowReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeRedirectSubwindows (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeRedirectSubwindowsReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeUnredirectWindow (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeUnredirectWindowReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeUnredirectSubwindows (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeUnredirectSubwindowsReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeCreateRegionFromBorderClip (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeCreateRegionFromBorderClipReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
-    swapl (&stuff->region, n);
-    swapl (&stuff->window, n);
+    swapl(&stuff->region);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeNameWindowPixmap (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeNameWindowPixmapReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
-    swapl (&stuff->window, n);
-    swapl (&stuff->pixmap, n);
+    swapl(&stuff->window);
+    swapl(&stuff->pixmap);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeGetOverlayWindow (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeGetOverlayWindowReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
-    swapl(&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
 static int
 SProcCompositeReleaseOverlayWindow (ClientPtr client)
 {
-    int n;
     REQUEST(xCompositeReleaseOverlayWindowReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
-    swapl(&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcCompositeVector[stuff->compositeReqType]) (client);
 }
 
@@ -839,10 +828,9 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
 
     if (client->swapped)
     {
-	int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.overlayWin, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.overlayWin);
     }
     (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
 
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 02db88a..86f880c 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -129,7 +129,6 @@ ProcDamageQueryVersion(ClientPtr client)
 {
     DamageClientPtr pDamageClient = GetDamageClient (client);
     xDamageQueryVersionReply rep;
-    register int n;
     REQUEST(xDamageQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
@@ -150,10 +149,10 @@ ProcDamageQueryVersion(ClientPtr client)
     pDamageClient->major_version = rep.majorVersion;
     pDamageClient->minor_version = rep.minorVersion;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
     return Success;
@@ -334,65 +333,60 @@ ProcDamageDispatch (ClientPtr client)
 static int
 SProcDamageQueryVersion(ClientPtr client)
 {
-    register int n;
     REQUEST(xDamageQueryVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
-    swapl(&stuff->majorVersion, n);
-    swapl(&stuff->minorVersion, n);
+    swapl(&stuff->majorVersion);
+    swapl(&stuff->minorVersion);
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
 static int
 SProcDamageCreate (ClientPtr client)
 {
-    register int n;
     REQUEST(xDamageCreateReq);
     
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDamageCreateReq);
-    swapl (&stuff->damage, n);
-    swapl (&stuff->drawable, n);
+    swapl(&stuff->damage);
+    swapl(&stuff->drawable);
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
 static int
 SProcDamageDestroy (ClientPtr client)
 {
-    register int n;
     REQUEST(xDamageDestroyReq);
     
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDamageDestroyReq);
-    swapl (&stuff->damage, n);
+    swapl(&stuff->damage);
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
 static int
 SProcDamageSubtract (ClientPtr client)
 {
-    register int n;
     REQUEST(xDamageSubtractReq);
     
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDamageSubtractReq);
-    swapl (&stuff->damage, n);
-    swapl (&stuff->repair, n);
-    swapl (&stuff->parts, n);
+    swapl(&stuff->damage);
+    swapl(&stuff->repair);
+    swapl(&stuff->parts);
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
 static int
 SProcDamageAdd (ClientPtr client)
 {
-    register int n;
     REQUEST(xDamageAddReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDamageSubtractReq);
-    swapl (&stuff->drawable, n);
-    swapl (&stuff->region, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->region);
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
diff --git a/dbe/dbe.c b/dbe/dbe.c
index 51bbdc6..86d8220 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -127,8 +127,6 @@ ProcDbeGetVersion(ClientPtr client)
 {
     /* REQUEST(xDbeGetVersionReq); */
     xDbeGetVersionReply	rep;
-    register int	n;
-
 
     REQUEST_SIZE_MATCH(xDbeGetVersionReq);
 
@@ -140,7 +138,7 @@ ProcDbeGetVersion(ClientPtr client)
 
     if (client->swapped)
     {
-        swaps(&rep.sequenceNumber, n);
+        swaps(&rep.sequenceNumber);
     }
 
     WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
@@ -656,7 +654,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
     xDbeGetVisualInfoReply	rep;
     Drawable			*drawables;
     DrawablePtr			*pDrawables = NULL;
-    register int		i, j, n, rc;
+    register int		i, j, rc;
     register int		count;  /* number of visual infos in reply */
     register int		length; /* length of reply */
     ScreenPtr			pScreen;
@@ -732,9 +730,9 @@ ProcDbeGetVisualInfo(ClientPtr client)
 
     if (client->swapped)
     {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.m, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.m);
     }
 
     /* Send off reply. */
@@ -751,7 +749,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
 
         if (client->swapped)
         {
-            swapl(&data32, n);
+            swapl(&data32);
         }
 
         WriteToClient(client, sizeof(CARD32), (char *)&data32);
@@ -772,7 +770,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
 
             if (client->swapped)
             {
-                swapl(&visInfo.visualID, n);
+                swapl(&visInfo.visualID);
 
                 /* We do not need to swap depth and perfLevel since they are
                  * already 1 byte quantities.
@@ -822,7 +820,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
     REQUEST(xDbeGetBackBufferAttributesReq);
     xDbeGetBackBufferAttributesReply	rep;
     DbeWindowPrivPtr			pDbeWindowPriv;
-    int					rc, n;
+    int					rc;
 
 
     REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
@@ -845,9 +843,9 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
     
     if (client->swapped)
     {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.attributes, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.attributes);
     }
 
     WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
@@ -926,10 +924,8 @@ static int
 SProcDbeGetVersion(ClientPtr client)
 {
     REQUEST(xDbeGetVersionReq);
-    register int	n;
-
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return(ProcDbeGetVersion(client));
 
 } /* SProcDbeGetVersion() */
@@ -962,13 +958,12 @@ static int
 SProcDbeAllocateBackBufferName(ClientPtr client)
 {
     REQUEST(xDbeAllocateBackBufferNameReq);
-    register int	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
 
-    swapl(&stuff->window, n);
-    swapl(&stuff->buffer, n);
+    swapl(&stuff->window);
+    swapl(&stuff->buffer);
     /* stuff->swapAction is a byte.  We do not need to swap this field. */
 
     return(ProcDbeAllocateBackBufferName(client));
@@ -997,13 +992,11 @@ static int
 SProcDbeDeallocateBackBufferName(ClientPtr client)
 {
     REQUEST (xDbeDeallocateBackBufferNameReq);
-    register int	n;
-
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
 
-    swapl(&stuff->buffer, n);
+    swapl(&stuff->buffer);
 
     return(ProcDbeDeallocateBackBufferName(client));
 
@@ -1035,14 +1028,14 @@ static int
 SProcDbeSwapBuffers(ClientPtr client)
 {
     REQUEST(xDbeSwapBuffersReq);
-    register int	i, n;
+    register int	i;
     xDbeSwapInfo	*pSwapInfo;
 
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
 
-    swapl(&stuff->n, n);
+    swapl(&stuff->n);
 
     if (stuff->n != 0)
     { 
@@ -1054,7 +1047,7 @@ SProcDbeSwapBuffers(ClientPtr client)
          */
         for (i = 0; i < stuff->n; i++)
         {
-            swapl(&pSwapInfo->window, n);
+            swapl(&pSwapInfo->window);
         }
     }
 
@@ -1083,9 +1076,8 @@ static int
 SProcDbeBeginIdiom(ClientPtr client)
 {
     REQUEST(xDbeBeginIdiomReq);
-    register int	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return(ProcDbeBeginIdiom(client));
 
 } /* SProcDbeBeginIdiom() */
@@ -1112,13 +1104,11 @@ static int
 SProcDbeGetVisualInfo(ClientPtr client)
 {
     REQUEST(xDbeGetVisualInfoReq);
-    register int	n;
-
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
 
-    swapl(&stuff->n, n);
+    swapl(&stuff->n);
     SwapRestL(stuff);
 
     return(ProcDbeGetVisualInfo(client));
@@ -1146,12 +1136,11 @@ static int
 SProcDbeGetBackBufferAttributes(ClientPtr client)
 {
     REQUEST (xDbeGetBackBufferAttributesReq);
-    register int	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
 
-    swapl(&stuff->buffer, n);
+    swapl(&stuff->buffer);
 
     return(ProcDbeGetBackBufferAttributes(client));
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 192c8c3..78e252e 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3584,7 +3584,7 @@ ProcInitialConnection(ClientPtr client)
 		     bytes_to_int32(prefix->nbytesAuthString);
     if (client->swapped)
     {
-	swaps(&stuff->length, whichbyte);
+	swaps(&stuff->length);
     }
     ResetCurrentRequest(client);
     return Success;
diff --git a/dix/swaprep.c b/dix/swaprep.c
index c173411..a02333d 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -74,14 +74,13 @@ void
 Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
 {
     int i;
-    char n;
 
     size >>= 2;
     for(i = 0; i < size; i++)
     /* brackets are mandatory here, because "swapl" macro expands
        to several statements */
     {   
-	swapl(&pbuf[i], n);
+	swapl(&pbuf[i]);
     }
     (void)WriteToClient(pClient, size << 2, (char *) pbuf);
 }
@@ -187,9 +186,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
 void
 SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
+    swaps(&pRep->sequenceNumber);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -198,67 +195,57 @@ void
 SGetWindowAttributesReply(ClientPtr pClient, int size,
                           xGetWindowAttributesReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->visualID, n);
-    swaps(&pRep->class, n);
-    swapl(&pRep->backingBitPlanes, n);
-    swapl(&pRep->backingPixel, n);
-    swapl(&pRep->colormap, n);
-    swapl(&pRep->allEventMasks, n);
-    swapl(&pRep->yourEventMask, n);
-    swaps(&pRep->doNotPropagateMask, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->visualID);
+    swaps(&pRep->class);
+    swapl(&pRep->backingBitPlanes);
+    swapl(&pRep->backingPixel);
+    swapl(&pRep->colormap);
+    swapl(&pRep->allEventMasks);
+    swapl(&pRep->yourEventMask);
+    swaps(&pRep->doNotPropagateMask);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->root, n);
-    swaps(&pRep->x, n);
-    swaps(&pRep->y, n);
-    swaps(&pRep->width, n);
-    swaps(&pRep->height, n);
-    swaps(&pRep->borderWidth, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->root);
+    swaps(&pRep->x);
+    swaps(&pRep->y);
+    swaps(&pRep->width);
+    swaps(&pRep->height);
+    swaps(&pRep->borderWidth);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->root, n);
-    swapl(&pRep->parent, n);
-    swaps(&pRep->nChildren, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->root);
+    swapl(&pRep->parent);
+    swaps(&pRep->nChildren);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->atom, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->atom);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nameLength, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nameLength);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -266,24 +253,20 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
 void
 SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->propertyType, n);
-    swapl(&pRep->bytesAfter, n);
-    swapl(&pRep->nItems, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->propertyType);
+    swapl(&pRep->bytesAfter);
+    swapl(&pRep->nItems);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nProperties, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nProperties);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -291,10 +274,8 @@ void
 SGetSelectionOwnerReply(ClientPtr pClient, int size,
                         xGetSelectionOwnerReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->owner, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->owner);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -302,27 +283,23 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size,
 void
 SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->root, n);
-    swapl(&pRep->child, n);
-    swaps(&pRep->rootX, n);
-    swaps(&pRep->rootY, n);
-    swaps(&pRep->winX, n);
-    swaps(&pRep->winY, n);
-    swaps(&pRep->mask, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->root);
+    swapl(&pRep->child);
+    swaps(&pRep->rootX);
+    swaps(&pRep->rootY);
+    swaps(&pRep->winX);
+    swaps(&pRep->winY);
+    swaps(&pRep->mask);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 static void
 SwapTimecoord(xTimecoord* pCoord)
 {
-    char n;
-
-    swapl(&pCoord->time, n);
-    swaps(&pCoord->x, n);
-    swaps(&pCoord->y, n);
+    swapl(&pCoord->time);
+    swaps(&pCoord->x);
+    swaps(&pCoord->y);
 }
 
 void
@@ -344,33 +321,27 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep)
 void
 SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->nEvents, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->nEvents);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->child, n);
-    swaps(&pRep->dstX, n);
-    swaps(&pRep->dstY, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->child);
+    swaps(&pRep->dstX);
+    swaps(&pRep->dstY);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->focus, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->focus);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -378,40 +349,34 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
 void
 SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 static void
 SwapCharInfo(xCharInfo *pInfo)
 {
-    char n;
-
-    swaps(&pInfo->leftSideBearing, n);
-    swaps(&pInfo->rightSideBearing, n);
-    swaps(&pInfo->characterWidth, n);
-    swaps(&pInfo->ascent, n);
-    swaps(&pInfo->descent, n);
-    swaps(&pInfo->attributes, n);
+    swaps(&pInfo->leftSideBearing);
+    swaps(&pInfo->rightSideBearing);
+    swaps(&pInfo->characterWidth);
+    swaps(&pInfo->ascent);
+    swaps(&pInfo->descent);
+    swaps(&pInfo->attributes);
 }
 
 static void
 SwapFontInfo(xQueryFontReply *pr)
 {
-    char n;
-
-    swaps(&pr->minCharOrByte2, n);
-    swaps(&pr->maxCharOrByte2, n);
-    swaps(&pr->defaultChar, n);
-    swaps(&pr->nFontProps, n);
-    swaps(&pr->fontAscent, n);
-    swaps(&pr->fontDescent, n);
+    swaps(&pr->minCharOrByte2);
+    swaps(&pr->maxCharOrByte2);
+    swaps(&pr->defaultChar);
+    swaps(&pr->nFontProps);
+    swaps(&pr->fontAscent);
+    swaps(&pr->fontDescent);
     SwapCharInfo( &pr->minBounds);
     SwapCharInfo( &pr->maxBounds);
-    swapl(&pr->nCharInfos, n);
+    swapl(&pr->nCharInfos);
 }
 
 static void
@@ -421,10 +386,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
     xCharInfo *	pxci;
     unsigned	nchars, nprops;
     char	*pby;
-    char n;
 
-    swaps(&pr->sequenceNumber, n);
-    swapl(&pr->length, n);
+    swaps(&pr->sequenceNumber);
+    swapl(&pr->length);
     nchars = pr->nCharInfos;
     nprops = pr->nFontProps;
     SwapFontInfo(pr);
@@ -433,9 +397,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
      * they are always 2 4 byte values */
     for(i = 0; i < nprops; i++)
     {
-	swapl(pby, n);
+	swapl(pby);
 	pby += 4;
-	swapl(pby, n);
+	swapl(pby);
 	pby += 4;
     }
     if (hasGlyphs)
@@ -456,27 +420,23 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep)
 void
 SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->fontAscent, n);
-    swaps(&pRep->fontDescent, n);
-    swaps(&pRep->overallAscent, n);
-    swaps(&pRep->overallDescent, n);
-    swapl(&pRep->overallWidth, n);
-    swapl(&pRep->overallLeft, n);
-    swapl(&pRep->overallRight, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->fontAscent);
+    swaps(&pRep->fontDescent);
+    swaps(&pRep->overallAscent);
+    swaps(&pRep->overallDescent);
+    swapl(&pRep->overallWidth);
+    swapl(&pRep->overallLeft);
+    swapl(&pRep->overallRight);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nFonts, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nFonts);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -491,22 +451,18 @@ SListFontsWithInfoReply(ClientPtr pClient, int size,
 void
 SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nPaths, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nPaths);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->visual, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->visual);
     (void)WriteToClient(pClient, size, (char *) pRep);
     /* Fortunately, image doesn't need swapping */
 }
@@ -515,52 +471,44 @@ void
 SListInstalledColormapsReply(ClientPtr pClient, int size,
                              xListInstalledColormapsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nColormaps, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nColormaps);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->red, n);
-    swaps(&pRep->green, n);
-    swaps(&pRep->blue, n);
-    swapl(&pRep->pixel, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->red);
+    swaps(&pRep->green);
+    swaps(&pRep->blue);
+    swapl(&pRep->pixel);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->pixel, n);
-    swaps(&pRep->exactRed, n);
-    swaps(&pRep->exactGreen, n);
-    swaps(&pRep->exactBlue, n);
-    swaps(&pRep->screenRed, n);
-    swaps(&pRep->screenGreen, n);
-    swaps(&pRep->screenBlue, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->pixel);
+    swaps(&pRep->exactRed);
+    swaps(&pRep->exactGreen);
+    swaps(&pRep->exactBlue);
+    swaps(&pRep->screenRed);
+    swaps(&pRep->screenGreen);
+    swaps(&pRep->screenBlue);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nPixels, n);
-    swaps(&pRep->nMasks, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nPixels);
+    swaps(&pRep->nMasks);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -568,25 +516,21 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
 void
 SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nPixels, n);
-    swapl(&pRep->redMask, n);
-    swapl(&pRep->greenMask, n);
-    swapl(&pRep->blueMask, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nPixels);
+    swapl(&pRep->redMask);
+    swapl(&pRep->greenMask);
+    swapl(&pRep->blueMask);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 static void
 SwapRGB(xrgb *prgb)
 {
-    char n;
-
-    swaps(&prgb->red, n);
-    swaps(&prgb->green, n);
-    swaps(&prgb->blue, n);
+    swaps(&prgb->red);
+    swaps(&prgb->green);
+    swaps(&prgb->blue);
 }
 
 void
@@ -608,47 +552,39 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb)
 void
 SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nColors, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nColors);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->exactRed, n);
-    swaps(&pRep->exactGreen, n);
-    swaps(&pRep->exactBlue, n);
-    swaps(&pRep->screenRed, n);
-    swaps(&pRep->screenGreen, n);
-    swaps(&pRep->screenBlue, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->exactRed);
+    swaps(&pRep->exactGreen);
+    swaps(&pRep->exactBlue);
+    swaps(&pRep->screenRed);
+    swaps(&pRep->screenGreen);
+    swaps(&pRep->screenBlue);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->width, n);
-    swaps(&pRep->height, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->width);
+    swaps(&pRep->height);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -656,10 +592,8 @@ void
 SGetKeyboardMappingReply(ClientPtr pClient, int size,
                          xGetKeyboardMappingReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -667,10 +601,8 @@ void
 SGetPointerMappingReply(ClientPtr pClient, int size,
                         xGetPointerMappingReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -678,46 +610,38 @@ void
 SGetModifierMappingReply(ClientPtr pClient, int size,
                          xGetModifierMappingReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swapl(&pRep->ledMask, n);
-    swaps(&pRep->bellPitch, n);
-    swaps(&pRep->bellDuration, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swapl(&pRep->ledMask);
+    swaps(&pRep->bellPitch);
+    swaps(&pRep->bellDuration);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->accelNumerator, n);
-    swaps(&pRep->accelDenominator, n);
-    swaps(&pRep->threshold, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->accelNumerator);
+    swaps(&pRep->accelDenominator);
+    swaps(&pRep->threshold);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
 void
 SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swaps(&pRep->timeout, n);
-    swaps(&pRep->interval, n);
+    swaps(&pRep->sequenceNumber);
+    swaps(&pRep->timeout);
+    swaps(&pRep->interval);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
@@ -729,8 +653,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
     while (bufT < endbuf) {
 	xHostEntry *host = (xHostEntry *) bufT;
 	int len = host->length;
-        char n;
-	swaps (&host->length, n);
+	swaps(&host->length);
 	bufT += sizeof (xHostEntry) + pad_to_int32(len);
 	}
     (void)WriteToClient (pClient, size, buf);
@@ -739,11 +662,9 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
 void
 SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
 {
-    char n;
-
-    swaps(&pRep->sequenceNumber, n);
-    swapl(&pRep->length, n);
-    swaps(&pRep->nHosts, n);
+    swaps(&pRep->sequenceNumber);
+    swapl(&pRep->length);
+    swaps(&pRep->nHosts);
     (void)WriteToClient(pClient, size, (char *) pRep);
 }
 
diff --git a/dix/swapreq.c b/dix/swapreq.c
index 2e34711..d07cd10 100644
--- a/dix/swapreq.c
+++ b/dix/swapreq.c
@@ -64,23 +64,21 @@ SOFTWARE.
 void
 SwapLongs (CARD32 *list, unsigned long count)
 {
-	char n;
-
 	while (count >= 8) {
-	    swapl(list+0, n);
-	    swapl(list+1, n);
-	    swapl(list+2, n);
-	    swapl(list+3, n);
-	    swapl(list+4, n);
-	    swapl(list+5, n);
-	    swapl(list+6, n);
-	    swapl(list+7, n);
+	    swapl(list + 0);
+	    swapl(list + 1);
+	    swapl(list + 2);
+	    swapl(list + 3);
+	    swapl(list + 4);
+	    swapl(list + 5);
+	    swapl(list + 6);
+	    swapl(list + 7);
 	    list += 8;
 	    count -= 8;
 	}
 	if (count != 0) {
 	    do {
-		swapl(list, n);
+		swapl(list);
 		list++;
 	    } while (--count != 0);
 	}
@@ -90,31 +88,29 @@ SwapLongs (CARD32 *list, unsigned long count)
 void
 SwapShorts (short *list, unsigned long count)
 {
-	char n;
-
 	while (count >= 16) {
-	    swaps(list+0, n);
-	    swaps(list+1, n);
-	    swaps(list+2, n);
-	    swaps(list+3, n);
-	    swaps(list+4, n);
-	    swaps(list+5, n);
-	    swaps(list+6, n);
-	    swaps(list+7, n);
-	    swaps(list+8, n);
-	    swaps(list+9, n);
-	    swaps(list+10, n);
-	    swaps(list+11, n);
-	    swaps(list+12, n);
-	    swaps(list+13, n);
-	    swaps(list+14, n);
-	    swaps(list+15, n);
+	    swaps(list + 0);
+	    swaps(list + 1);
+	    swaps(list + 2);
+	    swaps(list + 3);
+	    swaps(list + 4);
+	    swaps(list + 5);
+	    swaps(list + 6);
+	    swaps(list + 7);
+	    swaps(list + 8);
+	    swaps(list + 9);
+	    swaps(list + 10);
+	    swaps(list + 11);
+	    swaps(list + 12);
+	    swaps(list + 13);
+	    swaps(list + 14);
+	    swaps(list + 15);
 	    list += 16;
 	    count -= 16;
 	}
 	if (count != 0) {
 	    do {
-		swaps(list, n);
+		swaps(list);
 		list++;
 	    } while (--count != 0);
 	}
@@ -125,10 +121,8 @@ SwapShorts (short *list, unsigned long count)
 int
 SProcSimpleReq(ClientPtr client)
 {
-    char n;
-
     REQUEST(xReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return(*ProcVector[stuff->reqType])(client);
 }
 
@@ -138,33 +132,29 @@ SProcSimpleReq(ClientPtr client)
 int
 SProcResourceReq(ClientPtr client)
 {
-    char n;
-
     REQUEST(xResourceReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
-    swapl(&stuff->id, n);
+    swapl(&stuff->id);
     return(*ProcVector[stuff->reqType])(client);
 }
 
 int
 SProcCreateWindow(ClientPtr client)
 {
-    char n;
-
     REQUEST(xCreateWindowReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
-    swapl(&stuff->wid, n);
-    swapl(&stuff->parent, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swaps(&stuff->borderWidth, n);
-    swaps(&stuff->class, n);
-    swapl(&stuff->visual, n);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->wid);
+    swapl(&stuff->parent);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swaps(&stuff->borderWidth);
+    swaps(&stuff->class);
+    swapl(&stuff->visual);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return((* ProcVector[X_CreateWindow])(client));
 }
@@ -172,13 +162,11 @@ SProcCreateWindow(ClientPtr client)
 int
 SProcChangeWindowAttributes(ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangeWindowAttributesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->window);
+    swapl(&stuff->valueMask);
     SwapRestL(stuff);
     return((* ProcVector[X_ChangeWindowAttributes])(client));
 }
@@ -186,26 +174,24 @@ SProcChangeWindowAttributes(ClientPtr client)
 int
 SProcReparentWindow(ClientPtr client)
 {
-    char n;
     REQUEST(xReparentWindowReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xReparentWindowReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->parent, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
+    swapl(&stuff->window);
+    swapl(&stuff->parent);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
     return((* ProcVector[X_ReparentWindow])(client));
 }
 
 int
 SProcConfigureWindow(ClientPtr client)
 {
-    char n;
     REQUEST(xConfigureWindowReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
-    swapl(&stuff->window, n);
-    swaps(&stuff->mask, n);
+    swapl(&stuff->window);
+    swaps(&stuff->mask);
     SwapRestL(stuff);
     return((* ProcVector[X_ConfigureWindow])(client));
 
@@ -215,25 +201,23 @@ SProcConfigureWindow(ClientPtr client)
 int
 SProcInternAtom(ClientPtr client)
 {
-    char n;
     REQUEST(xInternAtomReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xInternAtomReq);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_InternAtom])(client));
 }
 
 int
 SProcChangeProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xChangePropertyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->nUnits, n);
+    swapl(&stuff->window);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->nUnits);
     switch ( stuff->format ) {
         case 8 :
 	    break;
@@ -250,12 +234,11 @@ SProcChangeProperty(ClientPtr client)
 int
 SProcDeleteProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xDeletePropertyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDeletePropertyReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->property, n);
+    swapl(&stuff->window);
+    swapl(&stuff->property);
     return((* ProcVector[X_DeleteProperty])(client));
               
 }
@@ -263,57 +246,53 @@ SProcDeleteProperty(ClientPtr client)
 int
 SProcGetProperty(ClientPtr client)
 {
-    char n;
     REQUEST(xGetPropertyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetPropertyReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->longOffset, n);
-    swapl(&stuff->longLength, n);
+    swapl(&stuff->window);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->longOffset);
+    swapl(&stuff->longLength);
     return((* ProcVector[X_GetProperty])(client));
 }
 
 int
 SProcSetSelectionOwner(ClientPtr client)
 {
-    char n;
     REQUEST(xSetSelectionOwnerReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->selection, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->window);
+    swapl(&stuff->selection);
+    swapl(&stuff->time);
     return((* ProcVector[X_SetSelectionOwner])(client));
 }
 
 int
 SProcConvertSelection(ClientPtr client)
 {
-    char n;
     REQUEST(xConvertSelectionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xConvertSelectionReq);
-    swapl(&stuff->requestor, n);
-    swapl(&stuff->selection, n);
-    swapl(&stuff->target, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->requestor);
+    swapl(&stuff->selection);
+    swapl(&stuff->target);
+    swapl(&stuff->property);
+    swapl(&stuff->time);
     return((* ProcVector[X_ConvertSelection])(client));
 }
 
 int
 SProcSendEvent(ClientPtr client)
 {
-    char n;
     xEvent eventT;
     EventSwapPtr proc;
     REQUEST(xSendEventReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSendEventReq);
-    swapl(&stuff->destination, n);
-    swapl(&stuff->eventMask, n);
+    swapl(&stuff->destination);
+    swapl(&stuff->eventMask);
 
     /* Swap event */
     proc = EventSwapVector[stuff->event.u.u.type & 0177];
@@ -328,223 +307,206 @@ SProcSendEvent(ClientPtr client)
 int
 SProcGrabPointer(ClientPtr client)
 {
-    char n;
     REQUEST(xGrabPointerReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGrabPointerReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->eventMask, n);
-    swapl(&stuff->confineTo, n);
-    swapl(&stuff->cursor, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->eventMask);
+    swapl(&stuff->confineTo);
+    swapl(&stuff->cursor);
+    swapl(&stuff->time);
     return((* ProcVector[X_GrabPointer])(client));
 }
 
 int
 SProcGrabButton(ClientPtr client)
 {
-    char n;
     REQUEST(xGrabButtonReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGrabButtonReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->eventMask, n);
-    swapl(&stuff->confineTo, n);
-    swapl(&stuff->cursor, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->eventMask);
+    swapl(&stuff->confineTo);
+    swapl(&stuff->cursor);
+    swaps(&stuff->modifiers);
     return((* ProcVector[X_GrabButton])(client));
 }
 
 int
 SProcUngrabButton(ClientPtr client)
 {
-    char n;
     REQUEST(xUngrabButtonReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xUngrabButtonReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
     return((* ProcVector[X_UngrabButton])(client));
 }
 
 int
 SProcChangeActivePointerGrab(ClientPtr client)
 {
-    char n;
     REQUEST(xChangeActivePointerGrabReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
-    swapl(&stuff->cursor, n);
-    swapl(&stuff->time, n);
-    swaps(&stuff->eventMask, n);
+    swapl(&stuff->cursor);
+    swapl(&stuff->time);
+    swaps(&stuff->eventMask);
     return((* ProcVector[X_ChangeActivePointerGrab])(client));
 }
 
 int
 SProcGrabKeyboard(ClientPtr client)
 {
-    char n;
     REQUEST(xGrabKeyboardReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGrabKeyboardReq);
-    swapl(&stuff->grabWindow, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->grabWindow);
+    swapl(&stuff->time);
     return((* ProcVector[X_GrabKeyboard])(client));
 }
 
 int
 SProcGrabKey(ClientPtr client)
 {
-    char n;
     REQUEST(xGrabKeyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGrabKeyReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
     return((* ProcVector[X_GrabKey])(client));
 }
 
 int
 SProcUngrabKey(ClientPtr client)
 {
-    char n;
     REQUEST(xUngrabKeyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xUngrabKeyReq);
-    swapl(&stuff->grabWindow, n);
-    swaps(&stuff->modifiers, n);
+    swapl(&stuff->grabWindow);
+    swaps(&stuff->modifiers);
     return((* ProcVector[X_UngrabKey])(client));
 }
 
 int
 SProcGetMotionEvents(ClientPtr client)
 {
-    char n;
     REQUEST(xGetMotionEventsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetMotionEventsReq);
-    swapl(&stuff->window, n);
-    swapl(&stuff->start, n);
-    swapl(&stuff->stop, n);
+    swapl(&stuff->window);
+    swapl(&stuff->start);
+    swapl(&stuff->stop);
     return((* ProcVector[X_GetMotionEvents])(client));
 }
 
 int
 SProcTranslateCoords(ClientPtr client)
 {
-    char n;
     REQUEST(xTranslateCoordsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xTranslateCoordsReq);
-    swapl(&stuff->srcWid, n);
-    swapl(&stuff->dstWid, n);
-    swaps(&stuff->srcX, n);
-    swaps(&stuff->srcY, n);
+    swapl(&stuff->srcWid);
+    swapl(&stuff->dstWid);
+    swaps(&stuff->srcX);
+    swaps(&stuff->srcY);
     return((* ProcVector[X_TranslateCoords])(client));
 }
 
 int
 SProcWarpPointer(ClientPtr client)
 {
-    char n;
     REQUEST(xWarpPointerReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xWarpPointerReq);
-    swapl(&stuff->srcWid, n);
-    swapl(&stuff->dstWid, n);
-    swaps(&stuff->srcX, n);
-    swaps(&stuff->srcY, n);
-    swaps(&stuff->srcWidth, n);
-    swaps(&stuff->srcHeight, n);
-    swaps(&stuff->dstX, n);
-    swaps(&stuff->dstY, n);
+    swapl(&stuff->srcWid);
+    swapl(&stuff->dstWid);
+    swaps(&stuff->srcX);
+    swaps(&stuff->srcY);
+    swaps(&stuff->srcWidth);
+    swaps(&stuff->srcHeight);
+    swaps(&stuff->dstX);
+    swaps(&stuff->dstY);
     return((* ProcVector[X_WarpPointer])(client));
 }
 
 int
 SProcSetInputFocus(ClientPtr client)
 {
-    char n;
     REQUEST(xSetInputFocusReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSetInputFocusReq);
-    swapl(&stuff->focus, n);
-    swapl(&stuff->time, n);
+    swapl(&stuff->focus);
+    swapl(&stuff->time);
     return((* ProcVector[X_SetInputFocus])(client));
 }
 
 int
 SProcOpenFont(ClientPtr client)
 {
-    char n;
     REQUEST(xOpenFontReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xOpenFontReq);
-    swapl(&stuff->fid, n);
-    swaps(&stuff->nbytes, n);
+    swapl(&stuff->fid);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_OpenFont])(client));
 }
 
 int
 SProcListFonts(ClientPtr client)
 {
-    char n;
     REQUEST(xListFontsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xListFontsReq);
-    swaps(&stuff->maxNames, n);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->maxNames);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_ListFonts])(client));
 }
 
 int
 SProcListFontsWithInfo(ClientPtr client)
 {
-    char n;
     REQUEST(xListFontsWithInfoReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
-    swaps(&stuff->maxNames, n);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->maxNames);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_ListFontsWithInfo])(client));
 }
 
 int
 SProcSetFontPath(ClientPtr client)
 {
-    char n;
     REQUEST(xSetFontPathReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
-    swaps(&stuff->nFonts, n);
+    swaps(&stuff->nFonts);
     return((* ProcVector[X_SetFontPath])(client));
 }
 
 int
 SProcCreatePixmap(ClientPtr client)
 {
-    char n;
     REQUEST(xCreatePixmapReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCreatePixmapReq);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->drawable, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swapl(&stuff->pid);
+    swapl(&stuff->drawable);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return((* ProcVector[X_CreatePixmap])(client));
 }
 
 int
 SProcCreateGC(ClientPtr client)
 {
-    char n;
     REQUEST(xCreateGCReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xCreateGCReq);
-    swapl(&stuff->gc, n);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->gc);
+    swapl(&stuff->drawable);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return((* ProcVector[X_CreateGC])(client));
 }
@@ -552,12 +514,11 @@ SProcCreateGC(ClientPtr client)
 int
 SProcChangeGC(ClientPtr client)
 {
-    char n;
     REQUEST(xChangeGCReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeGCReq);
-    swapl(&stuff->gc, n);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->gc);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return((* ProcVector[X_ChangeGC])(client));
 }
@@ -565,26 +526,24 @@ SProcChangeGC(ClientPtr client)
 int
 SProcCopyGC(ClientPtr client)
 {
-    char n;
     REQUEST(xCopyGCReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCopyGCReq);
-    swapl(&stuff->srcGC, n);
-    swapl(&stuff->dstGC, n);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->srcGC);
+    swapl(&stuff->dstGC);
+    swapl(&stuff->mask);
     return((* ProcVector[X_CopyGC])(client));
 }
 
 int
 SProcSetDashes(ClientPtr client)
 {
-    char n;
     REQUEST(xSetDashesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSetDashesReq);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->dashOffset, n);
-    swaps(&stuff->nDashes, n);
+    swapl(&stuff->gc);
+    swaps(&stuff->dashOffset);
+    swaps(&stuff->nDashes);
     return((* ProcVector[X_SetDashes])(client));
 
 }
@@ -592,13 +551,12 @@ SProcSetDashes(ClientPtr client)
 int
 SProcSetClipRectangles(ClientPtr client)
 {
-    char n;
     REQUEST(xSetClipRectanglesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->xOrigin, n);
-    swaps(&stuff->yOrigin, n);
+    swapl(&stuff->gc);
+    swaps(&stuff->xOrigin);
+    swaps(&stuff->yOrigin);
     SwapRestS(stuff);
     return((* ProcVector[X_SetClipRectangles])(client));
 }
@@ -606,54 +564,51 @@ SProcSetClipRectangles(ClientPtr client)
 int
 SProcClearToBackground(ClientPtr client)
 {
-    char n;
     REQUEST(xClearAreaReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xClearAreaReq);
-    swapl(&stuff->window, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swapl(&stuff->window);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return((* ProcVector[X_ClearArea])(client));
 }
 
 int
 SProcCopyArea(ClientPtr client)
 {
-    char n;
     REQUEST(xCopyAreaReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCopyAreaReq);
-    swapl(&stuff->srcDrawable, n);
-    swapl(&stuff->dstDrawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->srcX, n);
-    swaps(&stuff->srcY, n);
-    swaps(&stuff->dstX, n);
-    swaps(&stuff->dstY, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swapl(&stuff->srcDrawable);
+    swapl(&stuff->dstDrawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->srcX);
+    swaps(&stuff->srcY);
+    swaps(&stuff->dstX);
+    swaps(&stuff->dstY);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return((* ProcVector[X_CopyArea])(client));
 }
 
 int
 SProcCopyPlane(ClientPtr client)
 {
-    char n;
     REQUEST(xCopyPlaneReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCopyPlaneReq);
-    swapl(&stuff->srcDrawable, n);
-    swapl(&stuff->dstDrawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->srcX, n);
-    swaps(&stuff->srcY, n);
-    swaps(&stuff->dstX, n);
-    swaps(&stuff->dstY, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swapl(&stuff->bitPlane, n);
+    swapl(&stuff->srcDrawable);
+    swapl(&stuff->dstDrawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->srcX);
+    swaps(&stuff->srcY);
+    swaps(&stuff->dstX);
+    swaps(&stuff->dstY);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->bitPlane);
     return((* ProcVector[X_CopyPlane])(client));
 }
 
@@ -662,13 +617,11 @@ SProcCopyPlane(ClientPtr client)
 int
 SProcPoly(ClientPtr client)
 {
-    char n;
-
     REQUEST(xPolyPointReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xPolyPointReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
     SwapRestS(stuff);
     return((* ProcVector[stuff->reqType])(client));
 }
@@ -679,13 +632,11 @@ SProcPoly(ClientPtr client)
 int
 SProcFillPoly(ClientPtr client)
 {
-    char n;
-
     REQUEST(xFillPolyReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xFillPolyReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
     SwapRestS(stuff);
     return((* ProcVector[X_FillPoly])(client));
 }
@@ -693,16 +644,15 @@ SProcFillPoly(ClientPtr client)
 int
 SProcPutImage(ClientPtr client)
 {
-    char n;
     REQUEST(xPutImageReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xPutImageReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swaps(&stuff->dstX, n);
-    swaps(&stuff->dstY, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swaps(&stuff->dstX);
+    swaps(&stuff->dstY);
     /* Image should already be swapped */
     return((* ProcVector[X_PutImage])(client));
 
@@ -711,16 +661,15 @@ SProcPutImage(ClientPtr client)
 int
 SProcGetImage(ClientPtr client)
 {
-    char n;
     REQUEST(xGetImageReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xGetImageReq);
-    swapl(&stuff->drawable, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swapl(&stuff->planeMask, n);
+    swapl(&stuff->drawable);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->planeMask);
     return((* ProcVector[X_GetImage])(client));
 }
 
@@ -729,14 +678,13 @@ SProcGetImage(ClientPtr client)
 int
 SProcPolyText(ClientPtr client)
 {
-    char n;
     REQUEST(xPolyTextReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xPolyTextReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
     return((* ProcVector[stuff->reqType])(client));
 }
 
@@ -745,27 +693,25 @@ SProcPolyText(ClientPtr client)
 int
 SProcImageText(ClientPtr client)
 {
-    char n;
     REQUEST(xImageTextReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xImageTextReq);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->gc, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
+    swapl(&stuff->drawable);
+    swapl(&stuff->gc);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
     return((* ProcVector[stuff->reqType])(client));
 }
 
 int
 SProcCreateColormap(ClientPtr client)
 {
-    char n;
     REQUEST(xCreateColormapReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCreateColormapReq);
-    swapl(&stuff->mid, n);
-    swapl(&stuff->window, n);
-    swapl(&stuff->visual, n);
+    swapl(&stuff->mid);
+    swapl(&stuff->window);
+    swapl(&stuff->visual);
     return((* ProcVector[X_CreateColormap])(client));
 }
 
@@ -773,12 +719,11 @@ SProcCreateColormap(ClientPtr client)
 int
 SProcCopyColormapAndFree(ClientPtr client)
 {
-    char n;
     REQUEST(xCopyColormapAndFreeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
-    swapl(&stuff->mid, n);
-    swapl(&stuff->srcCmap, n);
+    swapl(&stuff->mid);
+    swapl(&stuff->srcCmap);
     return((* ProcVector[X_CopyColormapAndFree])(client));
 
 }
@@ -786,67 +731,61 @@ SProcCopyColormapAndFree(ClientPtr client)
 int
 SProcAllocColor(ClientPtr client)
 {
-    char n;
     REQUEST(xAllocColorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xAllocColorReq);
-    swapl(&stuff->cmap, n);
-    swaps(&stuff->red, n);
-    swaps(&stuff->green, n);
-    swaps(&stuff->blue, n);
+    swapl(&stuff->cmap);
+    swaps(&stuff->red);
+    swaps(&stuff->green);
+    swaps(&stuff->blue);
     return((* ProcVector[X_AllocColor])(client));
 }
 
 int
 SProcAllocNamedColor(ClientPtr client)
 {
-    char n;
-
     REQUEST(xAllocNamedColorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
-    swapl(&stuff->cmap, n);
-    swaps(&stuff->nbytes, n);
+    swapl(&stuff->cmap);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_AllocNamedColor])(client));
 }
 
 int
 SProcAllocColorCells(ClientPtr client)
 {
-    char n;
     REQUEST(xAllocColorCellsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xAllocColorCellsReq);
-    swapl(&stuff->cmap, n);
-    swaps(&stuff->colors, n);
-    swaps(&stuff->planes, n);
+    swapl(&stuff->cmap);
+    swaps(&stuff->colors);
+    swaps(&stuff->planes);
     return((* ProcVector[X_AllocColorCells])(client));
 }
 
 int
 SProcAllocColorPlanes(ClientPtr client)
 {
-    char n;
     REQUEST(xAllocColorPlanesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
-    swapl(&stuff->cmap, n);
-    swaps(&stuff->colors, n);
-    swaps(&stuff->red, n);
-    swaps(&stuff->green, n);
-    swaps(&stuff->blue, n);
+    swapl(&stuff->cmap);
+    swaps(&stuff->colors);
+    swaps(&stuff->red);
+    swaps(&stuff->green);
+    swaps(&stuff->blue);
     return((* ProcVector[X_AllocColorPlanes])(client));
 }
 
 int
 SProcFreeColors(ClientPtr client)
 {
-    char n;
     REQUEST(xFreeColorsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
-    swapl(&stuff->cmap, n);
-    swapl(&stuff->planeMask, n);
+    swapl(&stuff->cmap);
+    swapl(&stuff->planeMask);
     SwapRestL(stuff);
     return((* ProcVector[X_FreeColors])(client));
 
@@ -855,25 +794,22 @@ SProcFreeColors(ClientPtr client)
 void
 SwapColorItem(xColorItem *pItem)
 {
-    char n;
-
-    swapl(&pItem->pixel, n);
-    swaps(&pItem->red, n);
-    swaps(&pItem->green, n);
-    swaps(&pItem->blue, n);
+    swapl(&pItem->pixel);
+    swaps(&pItem->red);
+    swaps(&pItem->green);
+    swaps(&pItem->blue);
 }
 
 int
 SProcStoreColors(ClientPtr client)
 {
-    char n;
     long count;
     xColorItem 	*pItem;
 
     REQUEST(xStoreColorsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
-    swapl(&stuff->cmap, n);
+    swapl(&stuff->cmap);
     pItem = (xColorItem *) &stuff[1];
     for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
 	SwapColorItem(pItem++);
@@ -883,24 +819,22 @@ SProcStoreColors(ClientPtr client)
 int
 SProcStoreNamedColor (ClientPtr client)
 {
-    char n;
     REQUEST(xStoreNamedColorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
-    swapl(&stuff->cmap, n);
-    swapl(&stuff->pixel, n);
-    swaps(&stuff->nbytes, n);
+    swapl(&stuff->cmap);
+    swapl(&stuff->pixel);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_StoreNamedColor])(client));
 }
 
 int
 SProcQueryColors (ClientPtr client)
 {
-    char n;
     REQUEST(xQueryColorsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
-    swapl(&stuff->cmap, n);
+    swapl(&stuff->cmap);
     SwapRestL(stuff);
     return((* ProcVector[X_QueryColors])(client));
 } 
@@ -908,54 +842,51 @@ SProcQueryColors (ClientPtr client)
 int
 SProcLookupColor (ClientPtr client)
 {
-    char n;
     REQUEST(xLookupColorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xLookupColorReq);
-    swapl(&stuff->cmap, n);
-    swaps(&stuff->nbytes, n);
+    swapl(&stuff->cmap);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_LookupColor])(client));
 }
 
 int
 SProcCreateCursor (ClientPtr client)
 {
-    char n;
     REQUEST(xCreateCursorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCreateCursorReq);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->source, n);
-    swapl(&stuff->mask, n);
-    swaps(&stuff->foreRed, n);
-    swaps(&stuff->foreGreen, n);
-    swaps(&stuff->foreBlue, n);
-    swaps(&stuff->backRed, n);
-    swaps(&stuff->backGreen, n);
-    swaps(&stuff->backBlue, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
+    swapl(&stuff->cid);
+    swapl(&stuff->source);
+    swapl(&stuff->mask);
+    swaps(&stuff->foreRed);
+    swaps(&stuff->foreGreen);
+    swaps(&stuff->foreBlue);
+    swaps(&stuff->backRed);
+    swaps(&stuff->backGreen);
+    swaps(&stuff->backBlue);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
     return((* ProcVector[X_CreateCursor])(client));
 }
 
 int
 SProcCreateGlyphCursor (ClientPtr client)
 {
-    char n;
     REQUEST(xCreateGlyphCursorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->source, n);
-    swapl(&stuff->mask, n);
-    swaps(&stuff->sourceChar, n);
-    swaps(&stuff->maskChar, n);
-    swaps(&stuff->foreRed, n);
-    swaps(&stuff->foreGreen, n);
-    swaps(&stuff->foreBlue, n);
-    swaps(&stuff->backRed, n);
-    swaps(&stuff->backGreen, n);
-    swaps(&stuff->backBlue, n);
+    swapl(&stuff->cid);
+    swapl(&stuff->source);
+    swapl(&stuff->mask);
+    swaps(&stuff->sourceChar);
+    swaps(&stuff->maskChar);
+    swaps(&stuff->foreRed);
+    swaps(&stuff->foreGreen);
+    swaps(&stuff->foreBlue);
+    swaps(&stuff->backRed);
+    swaps(&stuff->backGreen);
+    swaps(&stuff->backBlue);
     return((* ProcVector[X_CreateGlyphCursor])(client));
 }
 
@@ -963,30 +894,28 @@ SProcCreateGlyphCursor (ClientPtr client)
 int
 SProcRecolorCursor (ClientPtr client)
 {
-    char n;
     REQUEST(xRecolorCursorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecolorCursorReq);
-    swapl(&stuff->cursor, n);
-    swaps(&stuff->foreRed, n);
-    swaps(&stuff->foreGreen, n);
-    swaps(&stuff->foreBlue, n);
-    swaps(&stuff->backRed, n);
-    swaps(&stuff->backGreen, n);
-    swaps(&stuff->backBlue, n);
+    swapl(&stuff->cursor);
+    swaps(&stuff->foreRed);
+    swaps(&stuff->foreGreen);
+    swaps(&stuff->foreBlue);
+    swaps(&stuff->backRed);
+    swaps(&stuff->backGreen);
+    swaps(&stuff->backBlue);
     return((* ProcVector[X_RecolorCursor])(client));
 }
 
 int
 SProcQueryBestSize (ClientPtr client)
 {
-    char n;
     REQUEST(xQueryBestSizeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xQueryBestSizeReq);
-    swapl(&stuff->drawable, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swapl(&stuff->drawable);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return((* ProcVector[X_QueryBestSize])(client));
 
 }
@@ -994,20 +923,18 @@ SProcQueryBestSize (ClientPtr client)
 int
 SProcQueryExtension (ClientPtr client)
 {
-    char n;
     REQUEST(xQueryExtensionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->nbytes);
     return((* ProcVector[X_QueryExtension])(client));
 }
 
 int
 SProcChangeKeyboardMapping (ClientPtr client)
 {
-    char n;
     REQUEST(xChangeKeyboardMappingReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
     SwapRestL(stuff);
     return((* ProcVector[X_ChangeKeyboardMapping])(client));
@@ -1017,11 +944,10 @@ SProcChangeKeyboardMapping (ClientPtr client)
 int
 SProcChangeKeyboardControl (ClientPtr client)
 {
-    char n;
     REQUEST(xChangeKeyboardControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
-    swapl(&stuff->mask, n);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return((* ProcVector[X_ChangeKeyboardControl])(client));
 }
@@ -1029,13 +955,12 @@ SProcChangeKeyboardControl (ClientPtr client)
 int
 SProcChangePointerControl (ClientPtr client)
 {
-    char n;
     REQUEST(xChangePointerControlReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xChangePointerControlReq);
-    swaps(&stuff->accelNum, n);
-    swaps(&stuff->accelDenum, n);
-    swaps(&stuff->threshold, n);
+    swaps(&stuff->accelNum);
+    swaps(&stuff->accelDenum);
+    swaps(&stuff->threshold);
     return((* ProcVector[X_ChangePointerControl])(client));
 }
 
@@ -1043,37 +968,33 @@ SProcChangePointerControl (ClientPtr client)
 int
 SProcSetScreenSaver (ClientPtr client)
 {
-    char n;
     REQUEST(xSetScreenSaverReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xSetScreenSaverReq);
-    swaps(&stuff->timeout, n);
-    swaps(&stuff->interval, n);
+    swaps(&stuff->timeout);
+    swaps(&stuff->interval);
     return((* ProcVector[X_SetScreenSaver])(client));
 }
 
 int
 SProcChangeHosts (ClientPtr client)
 {
-    char n;
-
     REQUEST(xChangeHostsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
-    swaps(&stuff->hostLength, n);
+    swaps(&stuff->hostLength);
     return((* ProcVector[X_ChangeHosts])(client));
 
 }
 
 int SProcRotateProperties (ClientPtr client)
 {
-    char n;
     REQUEST(xRotatePropertiesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
-    swapl(&stuff->window, n);
-    swaps(&stuff->nAtoms, n);
-    swaps(&stuff->nPositions, n);
+    swapl(&stuff->window);
+    swaps(&stuff->nAtoms);
+    swaps(&stuff->nPositions);
     SwapRestL(stuff);
     return ((* ProcVector[X_RotateProperties])(client));
 }
@@ -1081,19 +1002,16 @@ int SProcRotateProperties (ClientPtr client)
 int
 SProcNoOperation(ClientPtr client)
 {
-    char n;
     REQUEST(xReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ((* ProcVector[X_NoOperation])(client));
 }
 
 void
 SwapConnClientPrefix(xConnClientPrefix *pCCP)
 {
-    char n;
-
-    swaps(&pCCP->majorVersion, n);
-    swaps(&pCCP->minorVersion, n);
-    swaps(&pCCP->nbytesAuthProto, n);
-    swaps(&pCCP->nbytesAuthString, n);
+    swaps(&pCCP->majorVersion);
+    swaps(&pCCP->minorVersion);
+    swaps(&pCCP->nbytesAuthProto);
+    swaps(&pCCP->nbytesAuthString);
 }
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
index f3e41ac..c05bd52 100644
--- a/hw/dmx/dmx.c
+++ b/hw/dmx/dmx.c
@@ -174,7 +174,6 @@ static int dmxFetchInputAttributes(unsigned int mask,
 static int ProcDMXQueryVersion(ClientPtr client)
 {
     xDMXQueryVersionReply rep;
-    int                   n;
 
     REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
 
@@ -185,11 +184,11 @@ static int ProcDMXQueryVersion(ClientPtr client)
     rep.minorVersion   = SERVER_DMX_MINOR_VERSION;
     rep.patchVersion   = SERVER_DMX_PATCH_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
-	swapl(&rep.patchVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
+	swapl(&rep.patchVersion);
     }
     WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
     return Success;
@@ -198,7 +197,6 @@ static int ProcDMXQueryVersion(ClientPtr client)
 static int ProcDMXSync(ClientPtr client)
 {
     xDMXSyncReply rep;
-    int           n;
 
     REQUEST_SIZE_MATCH(xDMXSyncReq);
 
@@ -209,9 +207,9 @@ static int ProcDMXSync(ClientPtr client)
     rep.length         = 0;
     rep.status         = 0;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
     }
     WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
     return Success;
@@ -222,7 +220,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
     xDMXForceWindowCreationReply rep;
     REQUEST(xDMXForceWindowCreationReq);
     WindowPtr     pWin;
-    int           n;
 
     REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
 
@@ -259,9 +256,9 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
     rep.length         = 0;
     rep.status         = 0;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
     }
     WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
     return Success;
@@ -270,7 +267,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
 static int ProcDMXGetScreenCount(ClientPtr client)
 {
     xDMXGetScreenCountReply rep;
-    int                     n;
 
     REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
 
@@ -279,9 +275,9 @@ static int ProcDMXGetScreenCount(ClientPtr client)
     rep.length         = 0;
     rep.screenCount    = dmxGetNumScreens();
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.screenCount, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.screenCount);
     }
     WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
     return Success;
@@ -291,7 +287,6 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
 {
     REQUEST(xDMXGetScreenAttributesReq);
     xDMXGetScreenAttributesReply rep;
-    int                          n;
     int                          length;
     int                          paddedLength;
     DMXScreenAttributesRec       attr;
@@ -325,20 +320,20 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
     rep.displayNameLength   = length;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.displayNameLength, n);
-        swapl(&rep.logicalScreen, n);
-        swaps(&rep.screenWindowWidth, n);
-        swaps(&rep.screenWindowHeight, n);
-        swaps(&rep.screenWindowXoffset, n);
-        swaps(&rep.screenWindowYoffset, n);
-        swaps(&rep.rootWindowWidth, n);
-        swaps(&rep.rootWindowHeight, n);
-        swaps(&rep.rootWindowXoffset, n);
-        swaps(&rep.rootWindowYoffset, n);
-        swaps(&rep.rootWindowXorigin, n);
-        swaps(&rep.rootWindowYorigin, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.displayNameLength);
+        swapl(&rep.logicalScreen);
+        swaps(&rep.screenWindowWidth);
+        swaps(&rep.screenWindowHeight);
+        swaps(&rep.screenWindowXoffset);
+        swaps(&rep.screenWindowYoffset);
+        swaps(&rep.rootWindowWidth);
+        swaps(&rep.rootWindowHeight);
+        swaps(&rep.rootWindowXoffset);
+        swaps(&rep.rootWindowYoffset);
+        swaps(&rep.rootWindowXorigin);
+        swaps(&rep.rootWindowYorigin);
     }
     WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
     if (length) WriteToClient(client, length, (char *)attr.displayName);
@@ -349,7 +344,6 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
 {
     REQUEST(xDMXChangeScreensAttributesReq);
     xDMXChangeScreensAttributesReply rep;
-    int                              n;
     int                              status = DMX_BAD_XINERAMA;
     unsigned int                     mask   = 0;
     unsigned int                     i;
@@ -407,10 +401,10 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
     rep.status         = status;
     rep.errorScreen    = errorScreen;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
-        swapl(&rep.errorScreen, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
+        swapl(&rep.errorScreen);
     }
     WriteToClient(client,
                   sizeof(xDMXChangeScreensAttributesReply),
@@ -422,7 +416,6 @@ static int ProcDMXAddScreen(ClientPtr client)
 {
     REQUEST(xDMXAddScreenReq);
     xDMXAddScreenReply     rep;
-    int                    n;
     int                    status = 0;
     CARD32                 *value_list;
     DMXScreenAttributesRec attr;
@@ -458,10 +451,10 @@ static int ProcDMXAddScreen(ClientPtr client)
     rep.status         = status;
     rep.physicalScreen = stuff->physicalScreen;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
-        swapl(&rep.physicalScreen, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
+        swapl(&rep.physicalScreen);
     }
     WriteToClient(client,
                   sizeof(xDMXAddScreenReply),
@@ -473,7 +466,6 @@ static int ProcDMXRemoveScreen(ClientPtr client)
 {
     REQUEST(xDMXRemoveScreenReq);
     xDMXRemoveScreenReply rep;
-    int                   n;
     int                   status = 0;
 
     REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
@@ -485,9 +477,9 @@ static int ProcDMXRemoveScreen(ClientPtr client)
     rep.length         = 0;
     rep.status         = status;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
     }
     WriteToClient(client,
                   sizeof(xDMXRemoveScreenReply),
@@ -563,7 +555,7 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
 {
     REQUEST(xDMXGetWindowAttributesReq);
     xDMXGetWindowAttributesReply rep;
-    int                          i, n;
+    int                          i;
     CARD32                       *screens;
     CARD32                       *windows;
     xRectangle                   *pos, *vis;
@@ -603,22 +595,22 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
     rep.length         = count * 6;
     rep.screenCount    = count;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.screenCount, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.screenCount);
         for (i = 0; i < count; i++) {
-            swapl(&screens[i], n);
-            swapl(&windows[i], n);
+            swapl(&screens[i]);
+            swapl(&windows[i]);
             
-            swaps(&pos[i].x, n);
-            swaps(&pos[i].y, n);
-            swaps(&pos[i].width, n);
-            swaps(&pos[i].height, n);
+            swaps(&pos[i].x);
+            swaps(&pos[i].y);
+            swaps(&pos[i].width);
+            swaps(&pos[i].height);
             
-            swaps(&vis[i].x, n);
-            swaps(&vis[i].y, n);
-            swaps(&vis[i].width, n);
-            swaps(&vis[i].height, n);
+            swaps(&vis[i].x);
+            swaps(&vis[i].y);
+            swaps(&vis[i].width);
+            swaps(&vis[i].height);
         }
     }
 
@@ -643,7 +635,6 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
 static int ProcDMXGetDesktopAttributes(ClientPtr client)
 {
     xDMXGetDesktopAttributesReply rep;
-    int                           n;
     DMXDesktopAttributesRec       attr;
 
     REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
@@ -660,12 +651,12 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client)
     rep.length              = 0;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.width, n);
-        swapl(&rep.height, n);
-        swapl(&rep.shiftX, n);
-        swapl(&rep.shiftY, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.width);
+        swapl(&rep.height);
+        swapl(&rep.shiftX);
+        swapl(&rep.shiftY);
     }
     WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
     return Success;
@@ -675,7 +666,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
 {
     REQUEST(xDMXChangeDesktopAttributesReq);
     xDMXChangeDesktopAttributesReply rep;
-    int                              n;
     int                              status = DMX_BAD_XINERAMA;
     CARD32                           *value_list;
     DMXDesktopAttributesRec          attr;
@@ -704,9 +694,9 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
     rep.length         = 0;
     rep.status         = status;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
     }
     WriteToClient(client,
                   sizeof(xDMXChangeDesktopAttributesReply),
@@ -717,7 +707,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client)
 static int ProcDMXGetInputCount(ClientPtr client)
 {
     xDMXGetInputCountReply rep;
-    int                     n;
 
     REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
 
@@ -726,9 +715,9 @@ static int ProcDMXGetInputCount(ClientPtr client)
     rep.length         = 0;
     rep.inputCount     = dmxGetInputCount();
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.inputCount, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.inputCount);
     }
     WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
     return Success;
@@ -738,7 +727,6 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
 {
     REQUEST(xDMXGetInputAttributesReq);
     xDMXGetInputAttributesReply rep;
-    int                          n;
     int                          length;
     int                          paddedLength;
     DMXInputAttributesRec        attr;
@@ -760,12 +748,12 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
     rep.length         = bytes_to_int32(paddedLength);
     rep.nameLength     = length;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.inputType, n);
-        swapl(&rep.physicalScreen, n);
-        swapl(&rep.physicalId, n);
-        swapl(&rep.nameLength, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.inputType);
+        swapl(&rep.physicalScreen);
+        swapl(&rep.physicalId);
+        swapl(&rep.nameLength);
     }
     WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
     if (length) WriteToClient(client, length, (char *)attr.name);
@@ -776,7 +764,6 @@ static int ProcDMXAddInput(ClientPtr client)
 {
     REQUEST(xDMXAddInputReq);
     xDMXAddInputReply      rep;
-    int                    n;
     int                    status = 0;
     CARD32                 *value_list;
     DMXInputAttributesRec  attr;
@@ -814,10 +801,10 @@ static int ProcDMXAddInput(ClientPtr client)
     rep.status         = status;
     rep.physicalId     = id;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
-        swapl(&rep.physicalId, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
+        swapl(&rep.physicalId);
     }
     WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
     return Success;
@@ -827,7 +814,6 @@ static int ProcDMXRemoveInput(ClientPtr client)
 {
     REQUEST(xDMXRemoveInputReq);
     xDMXRemoveInputReply     rep;
-    int                      n;
     int                      status = 0;
 
     REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
@@ -841,9 +827,9 @@ static int ProcDMXRemoveInput(ClientPtr client)
     rep.length         = 0;
     rep.status         = status;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.status, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.status);
     }
     WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
     return Success;
@@ -883,79 +869,72 @@ static int ProcDMXDispatch(ClientPtr client)
 
 static int SProcDMXQueryVersion(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXQueryVersionReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
     return ProcDMXQueryVersion(client);
 }
 
 static int SProcDMXSync(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXSyncReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXSyncReq);
     return ProcDMXSync(client);
 }
 
 static int SProcDMXForceWindowCreation(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXForceWindowCreationReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
-    swaps(&stuff->window, n);
+    swaps(&stuff->window);
     return ProcDMXForceWindowCreation(client);
 }
 
 static int SProcDMXGetScreenCount(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetScreenCountReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
     return ProcDMXGetScreenCount(client);
 }
 
 static int SProcDMXGetScreenAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetScreenAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
-    swapl(&stuff->physicalScreen, n);
+    swapl(&stuff->physicalScreen);
     return ProcDMXGetScreenAttributes(client);
 }
 
 static int SProcDMXChangeScreensAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXChangeScreensAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
-    swapl(&stuff->screenCount, n);
-    swapl(&stuff->maskCount, n);
+    swapl(&stuff->screenCount);
+    swapl(&stuff->maskCount);
     SwapRestL(stuff);
     return ProcDMXGetScreenAttributes(client);
 }
 
 static int SProcDMXAddScreen(ClientPtr client)
 {
-    int n;
     int paddedLength;
     REQUEST(xDMXAddScreenReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
-    swapl(&stuff->displayNameLength, n);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->displayNameLength);
+    swapl(&stuff->valueMask);
     paddedLength = pad_to_int32(stuff->displayNameLength);
     SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
     return ProcDMXAddScreen(client);
@@ -963,79 +942,72 @@ static int SProcDMXAddScreen(ClientPtr client)
 
 static int SProcDMXRemoveScreen(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXRemoveScreenReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
-    swapl(&stuff->physicalScreen, n);
+    swapl(&stuff->physicalScreen);
     return ProcDMXRemoveScreen(client);
 }
 
 static int SProcDMXGetWindowAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetWindowAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
-    swapl(&stuff->window, n);
+    swapl(&stuff->window);
     return ProcDMXGetWindowAttributes(client);
 }
 
 static int SProcDMXGetDesktopAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetDesktopAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
     return ProcDMXGetDesktopAttributes(client);
 }
 
 static int SProcDMXChangeDesktopAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXChangeDesktopAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->valueMask);
     SwapRestL(stuff);
     return ProcDMXChangeDesktopAttributes(client);
 }
 
 static int SProcDMXGetInputCount(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetInputCountReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
     return ProcDMXGetInputCount(client);
 }
 
 static int SProcDMXGetInputAttributes(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXGetInputAttributesReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
-    swapl(&stuff->deviceId, n);
+    swapl(&stuff->deviceId);
     return ProcDMXGetInputAttributes(client);
 }
 
 static int SProcDMXAddInput(ClientPtr client)
 {
-    int n;
     int paddedLength;
     REQUEST(xDMXAddInputReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
-    swapl(&stuff->displayNameLength, n);
-    swapl(&stuff->valueMask, n);
+    swapl(&stuff->displayNameLength);
+    swapl(&stuff->valueMask);
     paddedLength = pad_to_int32(stuff->displayNameLength);
     SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
     return ProcDMXAddInput(client);
@@ -1043,12 +1015,11 @@ static int SProcDMXAddInput(ClientPtr client)
 
 static int SProcDMXRemoveInput(ClientPtr client)
 {
-    int n;
     REQUEST(xDMXRemoveInputReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
-    swapl(&stuff->physicalId, n);
+    swapl(&stuff->physicalId);
     return ProcDMXRemoveInput(client);
 }
 
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index 0bd51b2..0741a72 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -541,7 +541,6 @@ static int
 ProcXF86DRIQueryVersion (register ClientPtr client)
 {
     xXF86DRIQueryVersionReply rep;
-    register int n;
     REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
 
     EPHYR_LOG ("enter\n") ;
@@ -553,11 +552,11 @@ ProcXF86DRIQueryVersion (register ClientPtr client)
     rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
     rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
-	swapl(&rep.patchVersion, n);
+    swaps(&rep.sequenceNumber);
+    swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
+	swapl(&rep.patchVersion);
     }
     WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
     EPHYR_LOG ("leave\n") ;
@@ -569,7 +568,6 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
 {
     xXF86DRIQueryDirectRenderingCapableReply	rep;
     Bool isCapable;
-    register int n;
     REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
     REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
 
@@ -592,8 +590,8 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
 	rep.isCapable = 0;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
 
     WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
@@ -1311,19 +1309,17 @@ ProcXF86DRIDispatch (register ClientPtr	client)
 static int
 SProcXF86DRIQueryVersion (register ClientPtr	client)
 {
-    register int n;
     REQUEST(xXF86DRIQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcXF86DRIQueryVersion(client);
 }
 
 static int
 SProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->screen, n);
+    swaps(&stuff->length);
+    swapl(&stuff->screen);
     return ProcXF86DRIQueryDirectRenderingCapable(client);
 }
 
diff --git a/hw/kdrive/ephyr/ephyrhostproxy.c b/hw/kdrive/ephyr/ephyrhostproxy.c
index ce3f018..3137055 100644
--- a/hw/kdrive/ephyr/ephyrhostproxy.c
+++ b/hw/kdrive/ephyr/ephyrhostproxy.c
@@ -68,7 +68,7 @@ ephyrHostProxyDoForward (pointer a_request_buffer,
     EPHYR_LOG ("enter\n") ;
 
     if (a_do_swap) {
-        swaps (&in_req->length, n) ;
+        swaps(&in_req->length) ;
     }
     EPHYR_LOG ("Req {type:%d, data:%d, length:%d}\n",
                in_req->reqType, in_req->data, in_req->length) ;
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 31ed505..0e701e5 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -760,8 +760,7 @@ vfbWriteXWDFileHeader(ScreenPtr pScreen)
 	SwapLongs((CARD32 *)pXWDHeader, SIZEOF(XWDheader)/4);
 	for (i = 0; i < pvfb->ncolors; i++)
 	{
-	    register char n;
-	    swapl(&pvfb->pXWDCmap[i].pixel, n);
+	    swapl(&pvfb->pXWDCmap[i].pixel);
 	}
     }
 }
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 4737f2d..46ff3bf 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -282,7 +282,6 @@ static int
 ProcXF86VidModeQueryVersion(ClientPtr client)
 {
     xXF86VidModeQueryVersionReply rep;
-    register int n;
 
     DEBUG_P("XF86VidModeQueryVersion");
 
@@ -293,10 +292,10 @@ ProcXF86VidModeQueryVersion(ClientPtr client)
     rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION;
     rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-    	swaps(&rep.majorVersion, n);
-    	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
     return Success;
@@ -309,7 +308,6 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
     xXF86VidModeGetModeLineReply rep;
     xXF86OldVidModeGetModeLineReply oldrep;
     pointer mode;
-    register int n;
     int dotClock;
     int ver;
 
@@ -364,20 +362,20 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
     rep.privsize = 0;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.dotclock, n);
-    	swaps(&rep.hdisplay, n);
-    	swaps(&rep.hsyncstart, n);
-    	swaps(&rep.hsyncend, n);
-    	swaps(&rep.htotal, n);
-    	swaps(&rep.hskew, n);
-    	swaps(&rep.vdisplay, n);
-    	swaps(&rep.vsyncstart, n);
-    	swaps(&rep.vsyncend, n);
-    	swaps(&rep.vtotal, n);
-	swapl(&rep.flags, n);
-	swapl(&rep.privsize, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.dotclock);
+	swaps(&rep.hdisplay);
+	swaps(&rep.hsyncstart);
+	swaps(&rep.hsyncend);
+	swaps(&rep.htotal);
+	swaps(&rep.hskew);
+	swaps(&rep.vdisplay);
+	swaps(&rep.vsyncstart);
+	swaps(&rep.vsyncend);
+	swaps(&rep.vtotal);
+	swapl(&rep.flags);
+	swapl(&rep.privsize);
     }
     if (ver < 2) {
 	oldrep.type = rep.type;
@@ -412,7 +410,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
     xXF86OldVidModeModeInfo oldmdinf;
     pointer mode;
     int modecount, dotClock;
-    register int n;
     int ver;
 
     DEBUG_P("XF86VidModeGetAllModelines");
@@ -442,9 +439,9 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.modecount = modecount;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.modecount, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.modecount);
     }
     WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep);
 
@@ -462,18 +459,18 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
 	mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
 	mdinf.privsize = 0;
         if (client->swapped) {
-	    swapl(&mdinf.dotclock, n);
-    	    swaps(&mdinf.hdisplay, n);
-    	    swaps(&mdinf.hsyncstart, n);
-    	    swaps(&mdinf.hsyncend, n);
-    	    swaps(&mdinf.htotal, n);
-    	    swaps(&mdinf.hskew, n);
-    	    swaps(&mdinf.vdisplay, n);
-    	    swaps(&mdinf.vsyncstart, n);
-    	    swaps(&mdinf.vsyncend, n);
-    	    swaps(&mdinf.vtotal, n);
-	    swapl(&mdinf.flags, n);
-	    swapl(&mdinf.privsize, n);
+	    swapl(&mdinf.dotclock);
+	    swaps(&mdinf.hdisplay);
+	    swaps(&mdinf.hsyncstart);
+	    swaps(&mdinf.hsyncend);
+	    swaps(&mdinf.htotal);
+	    swaps(&mdinf.hskew);
+	    swaps(&mdinf.vdisplay);
+	    swaps(&mdinf.vsyncstart);
+	    swaps(&mdinf.vsyncend);
+	    swaps(&mdinf.vtotal);
+	    swapl(&mdinf.flags);
+	    swapl(&mdinf.privsize);
 	}
 	if (ver < 2) {
 	    oldmdinf.dotclock = mdinf.dotclock;
@@ -1016,10 +1013,9 @@ status_reply:
     rep.sequenceNumber = client->sequence;
     rep.status = status;
     if (client->swapped) {
-        register int n;
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.status, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.status);
     }
     WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
     if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
@@ -1164,7 +1160,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetMonitorReq);
     xXF86VidModeGetMonitorReply rep;
-    register int n;
     CARD32 *hsyncdata, *vsyncdata;
     int i, nHsync, nVrefresh;
     pointer monitor;
@@ -1226,8 +1221,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
     
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
     WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep);
     client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@@ -1251,7 +1246,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetViewPortReq);
     xXF86VidModeGetViewPortReply rep;
-    int x, y, n;
+    int x, y;
 
     DEBUG_P("XF86VidModeGetViewPort");
 
@@ -1269,10 +1264,10 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
     rep.y = y;
 
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.x, n);
-	swapl(&rep.y, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.x);
+	swapl(&rep.y);
     }
     WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
     return Success;
@@ -1301,7 +1296,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetDotClocksReq);
     xXF86VidModeGetDotClocksReply rep;
-    register int n;
+	int n;
     int numClocks;
     CARD32 dotclock;
     int *Clocks = NULL;
@@ -1338,11 +1333,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
     	rep.flags |= CLKFLAG_PROGRAMABLE;
     }
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.clocks, n);
-	swapl(&rep.maxclocks, n);
-	swapl(&rep.flags, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.clocks);
+	swapl(&rep.maxclocks);
+	swapl(&rep.flags);
     }
     WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep);
     if (!ClockProg) {
@@ -1384,7 +1379,6 @@ ProcXF86VidModeGetGamma(ClientPtr client)
 {
     REQUEST(xXF86VidModeGetGammaReq);
     xXF86VidModeGetGammaReply rep;
-    register int n;
     float red, green, blue;
 
     DEBUG_P("XF86VidModeGetGamma");
@@ -1403,11 +1397,11 @@ ProcXF86VidModeGetGamma(ClientPtr client)
     rep.green = (CARD32)(green * 10000.);
     rep.blue = (CARD32)(blue * 10000.);
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-    	swapl(&rep.red, n);
-    	swapl(&rep.green, n);
-    	swapl(&rep.blue, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.red);
+	swapl(&rep.green);
+	swapl(&rep.blue);
     }
     WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
     return Success;
@@ -1444,7 +1438,7 @@ static int
 ProcXF86VidModeGetGammaRamp(ClientPtr client)
 {
     CARD16 *ramp = NULL;
-    int n, length;
+    int length;
     size_t ramplen = 0;
     xXF86VidModeGetGammaRampReply rep;
     REQUEST(xXF86VidModeGetGammaRampReq);
@@ -1476,9 +1470,9 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.size = stuff->size;
     if(client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swaps(&rep.size, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.size);
 	SwapShorts((short*)ramp, length * 3);
     }
     WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
@@ -1496,7 +1490,6 @@ static int
 ProcXF86VidModeGetGammaRampSize(ClientPtr client)
 {
     xXF86VidModeGetGammaRampSizeReply rep;
-    int n;
     REQUEST(xXF86VidModeGetGammaRampSizeReq);
 
     if(stuff->screen >= screenInfo.numScreens)
@@ -1509,9 +1502,9 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.size = VidModeGetGammaRampSize(stuff->screen); 
     if(client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swaps(&rep.size, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.size);
     }
     WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
 
@@ -1522,7 +1515,6 @@ static int
 ProcXF86VidModeGetPermissions(ClientPtr client)
 {
     xXF86VidModeGetPermissionsReply rep;
-    int n;
     REQUEST(xXF86VidModeGetPermissionsReq);
 
     if(stuff->screen >= screenInfo.numScreens)
@@ -1539,9 +1531,9 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
 	rep.permissions |= XF86VM_WRITE_PERMISSION;
     }
     if(client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swapl(&rep.permissions, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.permissions);
     }
     WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
 
@@ -1636,31 +1628,28 @@ ProcXF86VidModeDispatch(ClientPtr client)
 static int
 SProcXF86VidModeQueryVersion(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcXF86VidModeQueryVersion(client);
 }
 
 static int
 SProcXF86VidModeGetModeLine(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetModeLineReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetModeLine(client);
 }
 
 static int
 SProcXF86VidModeGetAllModeLines(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetAllModeLinesReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetAllModeLines(client);
 }
 
@@ -1670,40 +1659,39 @@ SProcXF86VidModeAddModeLine(ClientPtr client)
     xXF86OldVidModeAddModeLineReq *oldstuff =
 			(xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
     int ver;
-    register int n;
     
     REQUEST(xXF86VidModeAddModeLineReq);
     ver = ClientMajorVersion(client);
     if (ver < 2) {
-	swaps(&oldstuff->length, n);
+	swaps(&oldstuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
-	swapl(&oldstuff->screen, n);
-	swaps(&oldstuff->hdisplay, n);
-	swaps(&oldstuff->hsyncstart, n);
-	swaps(&oldstuff->hsyncend, n);
-	swaps(&oldstuff->htotal, n);
-	swaps(&oldstuff->vdisplay, n);
-	swaps(&oldstuff->vsyncstart, n);
-	swaps(&oldstuff->vsyncend, n);
-	swaps(&oldstuff->vtotal, n);
-	swapl(&oldstuff->flags, n);
-	swapl(&oldstuff->privsize, n);
+	swapl(&oldstuff->screen);
+	swaps(&oldstuff->hdisplay);
+	swaps(&oldstuff->hsyncstart);
+	swaps(&oldstuff->hsyncend);
+	swaps(&oldstuff->htotal);
+	swaps(&oldstuff->vdisplay);
+	swaps(&oldstuff->vsyncstart);
+	swaps(&oldstuff->vsyncend);
+	swaps(&oldstuff->vtotal);
+	swapl(&oldstuff->flags);
+	swapl(&oldstuff->privsize);
 	SwapRestL(oldstuff);
     } else {
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
-	swapl(&stuff->screen, n);
-	swaps(&stuff->hdisplay, n);
-	swaps(&stuff->hsyncstart, n);
-	swaps(&stuff->hsyncend, n);
-	swaps(&stuff->htotal, n);
-	swaps(&stuff->hskew, n);
-	swaps(&stuff->vdisplay, n);
-	swaps(&stuff->vsyncstart, n);
-	swaps(&stuff->vsyncend, n);
-	swaps(&stuff->vtotal, n);
-	swapl(&stuff->flags, n);
-	swapl(&stuff->privsize, n);
+	swapl(&stuff->screen);
+	swaps(&stuff->hdisplay);
+	swaps(&stuff->hsyncstart);
+	swaps(&stuff->hsyncend);
+	swaps(&stuff->htotal);
+	swaps(&stuff->hskew);
+	swaps(&stuff->vdisplay);
+	swaps(&stuff->vsyncstart);
+	swaps(&stuff->vsyncend);
+	swaps(&stuff->vtotal);
+	swapl(&stuff->flags);
+	swapl(&stuff->privsize);
 	SwapRestL(stuff);
     }
     return ProcXF86VidModeAddModeLine(client);
@@ -1715,40 +1703,39 @@ SProcXF86VidModeDeleteModeLine(ClientPtr client)
     xXF86OldVidModeDeleteModeLineReq *oldstuff =
 		(xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
     int ver;
-    register int n;
 
     REQUEST(xXF86VidModeDeleteModeLineReq);
     ver = ClientMajorVersion(client);
     if (ver < 2) {
-	swaps(&oldstuff->length, n);
+	swaps(&oldstuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
-	swapl(&oldstuff->screen, n);
-	swaps(&oldstuff->hdisplay, n);
-	swaps(&oldstuff->hsyncstart, n);
-	swaps(&oldstuff->hsyncend, n);
-	swaps(&oldstuff->htotal, n);
-	swaps(&oldstuff->vdisplay, n);
-	swaps(&oldstuff->vsyncstart, n);
-	swaps(&oldstuff->vsyncend, n);
-	swaps(&oldstuff->vtotal, n);
-	swapl(&oldstuff->flags, n);
-	swapl(&oldstuff->privsize, n);
+	swapl(&oldstuff->screen);
+	swaps(&oldstuff->hdisplay);
+	swaps(&oldstuff->hsyncstart);
+	swaps(&oldstuff->hsyncend);
+	swaps(&oldstuff->htotal);
+	swaps(&oldstuff->vdisplay);
+	swaps(&oldstuff->vsyncstart);
+	swaps(&oldstuff->vsyncend);
+	swaps(&oldstuff->vtotal);
+	swapl(&oldstuff->flags);
+	swapl(&oldstuff->privsize);
 	SwapRestL(oldstuff);
     } else {
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
-	swapl(&stuff->screen, n);
-	swaps(&stuff->hdisplay, n);
-	swaps(&stuff->hsyncstart, n);
-	swaps(&stuff->hsyncend, n);
-	swaps(&stuff->htotal, n);
-	swaps(&stuff->hskew, n);
-	swaps(&stuff->vdisplay, n);
-	swaps(&stuff->vsyncstart, n);
-	swaps(&stuff->vsyncend, n);
-	swaps(&stuff->vtotal, n);
-	swapl(&stuff->flags, n);
-	swapl(&stuff->privsize, n);
+	swapl(&stuff->screen);
+	swaps(&stuff->hdisplay);
+	swaps(&stuff->hsyncstart);
+	swaps(&stuff->hsyncend);
+	swaps(&stuff->htotal);
+	swaps(&stuff->hskew);
+	swaps(&stuff->vdisplay);
+	swaps(&stuff->vsyncstart);
+	swaps(&stuff->vsyncend);
+	swaps(&stuff->vtotal);
+	swapl(&stuff->flags);
+	swapl(&stuff->privsize);
 	SwapRestL(stuff);
     }
     return ProcXF86VidModeDeleteModeLine(client);
@@ -1760,40 +1747,39 @@ SProcXF86VidModeModModeLine(ClientPtr client)
     xXF86OldVidModeModModeLineReq *oldstuff =
 		(xXF86OldVidModeModModeLineReq *)client->requestBuffer;
     int ver;
-    register int n;
 
     REQUEST(xXF86VidModeModModeLineReq);
     ver = ClientMajorVersion(client);
     if (ver < 2) {
-	swaps(&oldstuff->length, n);
+	swaps(&oldstuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
-	swapl(&oldstuff->screen, n);
-	swaps(&oldstuff->hdisplay, n);
-	swaps(&oldstuff->hsyncstart, n);
-	swaps(&oldstuff->hsyncend, n);
-	swaps(&oldstuff->htotal, n);
-	swaps(&oldstuff->vdisplay, n);
-	swaps(&oldstuff->vsyncstart, n);
-	swaps(&oldstuff->vsyncend, n);
-	swaps(&oldstuff->vtotal, n);
-	swapl(&oldstuff->flags, n);
-	swapl(&oldstuff->privsize, n);
+	swapl(&oldstuff->screen);
+	swaps(&oldstuff->hdisplay);
+	swaps(&oldstuff->hsyncstart);
+	swaps(&oldstuff->hsyncend);
+	swaps(&oldstuff->htotal);
+	swaps(&oldstuff->vdisplay);
+	swaps(&oldstuff->vsyncstart);
+	swaps(&oldstuff->vsyncend);
+	swaps(&oldstuff->vtotal);
+	swapl(&oldstuff->flags);
+	swapl(&oldstuff->privsize);
 	SwapRestL(oldstuff);
     } else {
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
-	swapl(&stuff->screen, n);
-	swaps(&stuff->hdisplay, n);
-	swaps(&stuff->hsyncstart, n);
-	swaps(&stuff->hsyncend, n);
-	swaps(&stuff->htotal, n);
-	swaps(&stuff->hskew, n);
-	swaps(&stuff->vdisplay, n);
-	swaps(&stuff->vsyncstart, n);
-	swaps(&stuff->vsyncend, n);
-	swaps(&stuff->vtotal, n);
-	swapl(&stuff->flags, n);
-	swapl(&stuff->privsize, n);
+	swapl(&stuff->screen);
+	swaps(&stuff->hdisplay);
+	swaps(&stuff->hsyncstart);
+	swaps(&stuff->hsyncend);
+	swaps(&stuff->htotal);
+	swaps(&stuff->hskew);
+	swaps(&stuff->vdisplay);
+	swaps(&stuff->vsyncstart);
+	swaps(&stuff->vsyncend);
+	swaps(&stuff->vtotal);
+	swapl(&stuff->flags);
+	swapl(&stuff->privsize);
 	SwapRestL(stuff);      
     }
     return ProcXF86VidModeModModeLine(client);
@@ -1805,40 +1791,39 @@ SProcXF86VidModeValidateModeLine(ClientPtr client)
     xXF86OldVidModeValidateModeLineReq *oldstuff =
 		(xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
     int ver;
-    register int n;
 
     REQUEST(xXF86VidModeValidateModeLineReq);
     ver = ClientMajorVersion(client);
     if (ver < 2) {
-	swaps(&oldstuff->length, n);
+	swaps(&oldstuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
-	swapl(&oldstuff->screen, n);
-	swaps(&oldstuff->hdisplay, n);
-	swaps(&oldstuff->hsyncstart, n);
-	swaps(&oldstuff->hsyncend, n);
-	swaps(&oldstuff->htotal, n);
-	swaps(&oldstuff->vdisplay, n);
-	swaps(&oldstuff->vsyncstart, n);
-	swaps(&oldstuff->vsyncend, n);
-	swaps(&oldstuff->vtotal, n);
-	swapl(&oldstuff->flags, n);
-	swapl(&oldstuff->privsize, n);
+	swapl(&oldstuff->screen);
+	swaps(&oldstuff->hdisplay);
+	swaps(&oldstuff->hsyncstart);
+	swaps(&oldstuff->hsyncend);
+	swaps(&oldstuff->htotal);
+	swaps(&oldstuff->vdisplay);
+	swaps(&oldstuff->vsyncstart);
+	swaps(&oldstuff->vsyncend);
+	swaps(&oldstuff->vtotal);
+	swapl(&oldstuff->flags);
+	swapl(&oldstuff->privsize);
 	SwapRestL(oldstuff);
     } else {
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
-	swapl(&stuff->screen, n);
-	swaps(&stuff->hdisplay, n);
-	swaps(&stuff->hsyncstart, n);
-	swaps(&stuff->hsyncend, n);
-	swaps(&stuff->htotal, n);
-	swaps(&stuff->hskew, n);
-	swaps(&stuff->vdisplay, n);
-	swaps(&stuff->vsyncstart, n);
-	swaps(&stuff->vsyncend, n);
-	swaps(&stuff->vtotal, n);
-	swapl(&stuff->flags, n);
-	swapl(&stuff->privsize, n);
+	swapl(&stuff->screen);
+	swaps(&stuff->hdisplay);
+	swaps(&stuff->hsyncstart);
+	swaps(&stuff->hsyncend);
+	swaps(&stuff->htotal);
+	swaps(&stuff->hskew);
+	swaps(&stuff->vdisplay);
+	swaps(&stuff->vsyncstart);
+	swaps(&stuff->vsyncend);
+	swaps(&stuff->vtotal);
+	swapl(&stuff->flags);
+	swapl(&stuff->privsize);
 	SwapRestL(stuff);
     }
     return ProcXF86VidModeValidateModeLine(client);
@@ -1847,130 +1832,120 @@ SProcXF86VidModeValidateModeLine(ClientPtr client)
 static int
 SProcXF86VidModeSwitchMode(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeSwitchModeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
-    swaps(&stuff->screen, n);
-    swaps(&stuff->zoom, n);
+    swaps(&stuff->screen);
+    swaps(&stuff->zoom);
     return ProcXF86VidModeSwitchMode(client);
 }
 
 static int
 SProcXF86VidModeSwitchToMode(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeSwitchToModeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeSwitchToMode(client);
 }
 
 static int
 SProcXF86VidModeLockModeSwitch(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeLockModeSwitchReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
-    swaps(&stuff->screen, n);
-    swaps(&stuff->lock, n);
+    swaps(&stuff->screen);
+    swaps(&stuff->lock);
     return ProcXF86VidModeLockModeSwitch(client);
 }
 
 static int
 SProcXF86VidModeGetMonitor(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetMonitorReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetMonitor(client);
 }
 
 static int
 SProcXF86VidModeGetViewPort(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetViewPortReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetViewPort(client);
 }
 
 static int
 SProcXF86VidModeSetViewPort(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeSetViewPortReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
-    swaps(&stuff->screen, n);
-    swapl(&stuff->x, n);
-    swapl(&stuff->y, n);
+    swaps(&stuff->screen);
+    swapl(&stuff->x);
+    swapl(&stuff->y);
     return ProcXF86VidModeSetViewPort(client);
 }
 
 static int
 SProcXF86VidModeGetDotClocks(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetDotClocksReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetDotClocks(client);
 }
 
 static int
 SProcXF86VidModeSetClientVersion(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeSetClientVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
-    swaps(&stuff->major, n);
-    swaps(&stuff->minor, n);
+    swaps(&stuff->major);
+    swaps(&stuff->minor);
     return ProcXF86VidModeSetClientVersion(client);
 }
 
 static int
 SProcXF86VidModeSetGamma(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeSetGammaReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
-    swaps(&stuff->screen, n);
-    swapl(&stuff->red, n);
-    swapl(&stuff->green, n);
-    swapl(&stuff->blue, n);
+    swaps(&stuff->screen);
+    swapl(&stuff->red);
+    swapl(&stuff->green);
+    swapl(&stuff->blue);
     return ProcXF86VidModeSetGamma(client);
 }
 
 static int
 SProcXF86VidModeGetGamma(ClientPtr client)
 {
-    register int n;
     REQUEST(xXF86VidModeGetGammaReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetGamma(client);
 }
 
 static int
 SProcXF86VidModeSetGammaRamp(ClientPtr client)
 {
-    int length, n;
+    int length;
     REQUEST(xXF86VidModeSetGammaRampReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
-    swaps(&stuff->size, n);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->size);
+    swaps(&stuff->screen);
     length = ((stuff->size + 1) & ~1) * 6;
     REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
     SwapRestS(stuff);
@@ -1980,34 +1955,31 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client)
 static int
 SProcXF86VidModeGetGammaRamp(ClientPtr client)
 {
-    int n;
     REQUEST(xXF86VidModeGetGammaRampReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
-    swaps(&stuff->size, n);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->size);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetGammaRamp(client);
 }
 
 static int
 SProcXF86VidModeGetGammaRampSize(ClientPtr client)
 {   
-    int n;
     REQUEST(xXF86VidModeGetGammaRampSizeReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetGammaRampSize(client);
 }
 
 static int
 SProcXF86VidModeGetPermissions(ClientPtr client)
 {   
-    int n;
     REQUEST(xXF86VidModeGetPermissionsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
-    swaps(&stuff->screen, n);
+    swaps(&stuff->screen);
     return ProcXF86VidModeGetPermissions(client);
 }
 
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index e02644a..c35ba2f 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -86,7 +86,6 @@ ProcXF86DRIQueryVersion(
 )
 {
     xXF86DRIQueryVersionReply rep;
-    register int n;
 
     REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
     rep.type = X_Reply;
@@ -96,11 +95,11 @@ ProcXF86DRIQueryVersion(
     rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
     rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
-	swapl(&rep.patchVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
+	swapl(&rep.patchVersion);
     }
     WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
     return Success;
@@ -113,7 +112,6 @@ ProcXF86DRIQueryDirectRenderingCapable(
 {
     xXF86DRIQueryDirectRenderingCapableReply	rep;
     Bool isCapable;
-    register int n;
 
     REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
     REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
@@ -136,8 +134,8 @@ ProcXF86DRIQueryDirectRenderingCapable(
 	rep.isCapable = 0;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
 
     WriteToClient(client, 
@@ -595,9 +593,8 @@ SProcXF86DRIQueryVersion(
     register ClientPtr	client
 )
 {
-    register int n;
     REQUEST(xXF86DRIQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcXF86DRIQueryVersion(client);
 }
 
@@ -606,10 +603,9 @@ SProcXF86DRIQueryDirectRenderingCapable(
     register ClientPtr client
 )
 {
-    register int n;
     REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->screen, n);
+    swaps(&stuff->length);
+    swapl(&stuff->screen);
     return ProcXF86DRIQueryDirectRenderingCapable(client);
 }
 
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 552b26b..934abf6 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -71,10 +71,9 @@ ProcDRI2QueryVersion(ClientPtr client)
 {
     REQUEST(xDRI2QueryVersionReq);
     xDRI2QueryVersionReply rep;
-    int n;
 
     if (client->swapped)
-	swaps(&stuff->length, n);
+	swaps(&stuff->length);
 
     REQUEST_SIZE_MATCH(xDRI2QueryVersionReq);
     rep.type = X_Reply;
@@ -84,10 +83,10 @@ ProcDRI2QueryVersion(ClientPtr client)
     rep.minorVersion = dri2_minor;
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
 
     WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep);
@@ -585,16 +584,15 @@ SProcDRI2Connect(ClientPtr client)
 {
     REQUEST(xDRI2ConnectReq);
     xDRI2ConnectReply rep;
-    int n;
 
     /* If the client is swapped, it's not local.  Talk to the hand. */
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     if (sizeof(*stuff) / 4 != client->req_len)
 	return BadLength;
 
     rep.sequenceNumber = client->sequence;
-    swaps(&rep.sequenceNumber, n);
+    swaps(&rep.sequenceNumber);
     rep.length = 0;
     rep.driverNameLength = 0;
     rep.deviceNameLength = 0;
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 2f26e61..27fb125 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -147,7 +147,6 @@ ProcAppleWMQueryVersion(
 )
 {
     xAppleWMQueryVersionReply rep;
-    register int n;
 
     REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
     rep.type = X_Reply;
@@ -157,8 +156,8 @@ ProcAppleWMQueryVersion(
     rep.minorVersion = SERVER_APPLEWM_MINOR_VERSION;
     rep.patchVersion = SERVER_APPLEWM_PATCH_VERSION;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
     }
     WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
     return Success;
@@ -681,9 +680,8 @@ SProcAppleWMQueryVersion(
     register ClientPtr  client
 )
 {
-    register int n;
     REQUEST(xAppleWMQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcAppleWMQueryVersion(client);
 }
 
diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index 298ec2b..5a5b9c2 100644
--- a/hw/xquartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -183,7 +183,7 @@ static int ProcPseudoramiXGetState(ClientPtr client)
     REQUEST(xPanoramiXGetStateReq);
     WindowPtr pWin;
     xPanoramiXGetStateReply rep;
-    register int n, rc;
+    register int rc;
 
     TRACE();
     
@@ -197,9 +197,9 @@ static int ProcPseudoramiXGetState(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.state = !noPseudoramiXExtension;
     if (client->swapped) {
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swaps (&rep.state, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.state);
     }
     WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
     return Success;
@@ -212,7 +212,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
     REQUEST(xPanoramiXGetScreenCountReq);
     WindowPtr pWin;
     xPanoramiXGetScreenCountReply rep;
-    register int n, rc;
+    register int rc;
 
     TRACE();
     
@@ -226,9 +226,9 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.ScreenCount = pseudoramiXNumScreens;
     if (client->swapped) {
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swaps (&rep.ScreenCount, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.ScreenCount);
     }
     WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
     return Success;
@@ -259,10 +259,10 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
     rep.height = pseudoramiXScreens[stuff->screen].h;
     // was screenInfo.screens[stuff->screen]->height;
     if (client->swapped) {
-        swaps (&rep.sequenceNumber, n);
-        swapl (&rep.length, n);
-        swaps (&rep.width, n);
-        swaps (&rep.height, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.width);
+        swaps(&rep.height);
     }
     WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
     return Success;
@@ -284,10 +284,9 @@ static int ProcPseudoramiXIsActive(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.state = !noPseudoramiXExtension;
     if (client->swapped) {
-	register int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.state, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.state);
     }
     WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
     return Success;
@@ -309,10 +308,9 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
     rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
     rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
     if (client->swapped) {
-	register int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swapl (&rep.number, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.number);
     }
     WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
 
@@ -327,11 +325,10 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
 	    scratch.height = pseudoramiXScreens[i].h;
 
 	    if(client->swapped) {
-		register int n;
-		swaps (&scratch.x_org, n);
-		swaps (&scratch.y_org, n);
-		swaps (&scratch.width, n);
-		swaps (&scratch.height, n);
+		swaps(&scratch.x_org);
+		swaps(&scratch.y_org);
+		swaps(&scratch.width);
+		swaps(&scratch.height);
 	    }
 	    WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
 	}
@@ -369,11 +366,10 @@ static int
 SProcPseudoramiXQueryVersion (ClientPtr client)
 {
 	REQUEST(xPanoramiXQueryVersionReq);
-	register int n;
 
     TRACE();
 
-	swaps(&stuff->length,n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
 	return ProcPseudoramiXQueryVersion(client);
 }
@@ -382,11 +378,10 @@ static int
 SProcPseudoramiXGetState(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetStateReq);
-	register int n;
 
     TRACE();
 
- 	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
 	return ProcPseudoramiXGetState(client);
 }
@@ -395,11 +390,10 @@ static int
 SProcPseudoramiXGetScreenCount(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetScreenCountReq);
-	register int n;
 
     TRACE();
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
 	return ProcPseudoramiXGetScreenCount(client);
 }
@@ -408,11 +402,10 @@ static int
 SProcPseudoramiXGetScreenSize(ClientPtr client)
 {
 	REQUEST(xPanoramiXGetScreenSizeReq);
-	register int n;
 
     TRACE();
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
 	return ProcPseudoramiXGetScreenSize(client);
 }
@@ -422,11 +415,10 @@ static int
 SProcPseudoramiXIsActive(ClientPtr client)
 {
 	REQUEST(xXineramaIsActiveReq);
-	register int n;
 
     TRACE();
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 	return ProcPseudoramiXIsActive(client);
 }
@@ -436,11 +428,10 @@ static int
 SProcPseudoramiXQueryScreens(ClientPtr client)
 {
 	REQUEST(xXineramaQueryScreensReq);
-	register int n;
 
     TRACE();
 
-	swaps (&stuff->length, n);
+	swaps(&stuff->length);
 	REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 	return ProcPseudoramiXQueryScreens(client);
 }
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index ff70a38..1304d5a 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -91,7 +91,6 @@ ProcAppleDRIQueryVersion(
 )
 {
     xAppleDRIQueryVersionReply rep;
-    register int n;
 
     REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
     rep.type = X_Reply;
@@ -101,8 +100,8 @@ ProcAppleDRIQueryVersion(
     rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION;
     rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION;
     if (client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
     }
     WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
     return Success;
@@ -372,9 +371,8 @@ SProcAppleDRIQueryVersion(
     register ClientPtr client
 )
 {
-    register int n;
     REQUEST(xAppleDRIQueryVersionReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return ProcAppleDRIQueryVersion(client);
 }
 
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 7138409..403c859 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -91,8 +91,8 @@ ProcWindowsWMQueryVersion(ClientPtr client)
   rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
   if (client->swapped)
     {
-      swaps(&rep.sequenceNumber, n);
-      swapl(&rep.length, n);
+      swaps(&rep.sequenceNumber);
+      swapl(&rep.length);
     }
   WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep);
   return Success;
@@ -588,7 +588,7 @@ SProcWindowsWMQueryVersion (ClientPtr client)
 {
   int n;
   REQUEST(xWindowsWMQueryVersionReq);
-  swaps(&stuff->length, n);
+  swaps(&stuff->length);
   return ProcWindowsWMQueryVersion(client);
 }
 
diff --git a/include/misc.h b/include/misc.h
index 4849257..cca30d2 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -256,19 +256,21 @@ version_compare(uint16_t a_major, uint16_t a_minor,
     SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
 
 /* byte swap a 32-bit value */
-#define swapl(x, n) { \
-		 n = ((char *) (x))[0];\
+#define swapl(x) do { \
+		 char n = ((char *) (x))[0];\
 		 ((char *) (x))[0] = ((char *) (x))[3];\
 		 ((char *) (x))[3] = n;\
 		 n = ((char *) (x))[1];\
 		 ((char *) (x))[1] = ((char *) (x))[2];\
-		 ((char *) (x))[2] = n; }
+		 ((char *) (x))[2] = n;\
+	} while (0)
 
 /* byte swap a short */
-#define swaps(x, n) { \
-		 n = ((char *) (x))[0];\
+#define swaps(x) do { \
+		 char  n = ((char *) (x))[0];\
 		 ((char *) (x))[0] = ((char *) (x))[1];\
-		 ((char *) (x))[1] = n; }
+		 ((char *) (x))[1] = n;\
+	} while (0)
 
 /* copy 32-bit value from src to dst byteswapping on the way */
 #define cpswapl(src, dst) { \
diff --git a/os/connection.c b/os/connection.c
index 0c580ab..b339f4e 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -905,9 +905,9 @@ ErrorConnMax(XtransConnInfo trans_conn)
 	if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
 	    (!(*(char *) &whichbyte) && (byteOrder == 'l')))
 	{
-	    swaps(&csp.majorVersion, whichbyte);
-	    swaps(&csp.minorVersion, whichbyte);
-	    swaps(&csp.length, whichbyte);
+	    swaps(&csp.majorVersion);
+	    swaps(&csp.minorVersion);
+	    swaps(&csp.length);
 	}
 	iov[0].iov_len = sz_xConnSetupPrefix;
 	iov[0].iov_base = (char *) &csp;
diff --git a/os/io.c b/os/io.c
index 4210238..068f5f0 100644
--- a/os/io.c
+++ b/os/io.c
@@ -598,8 +598,7 @@ ResetCurrentRequest(ClientPtr client)
 	    ((xBigReq *)oci->bufptr)->length = client->req_len;
 	    if (client->swapped)
 	    {
-		char n;
-		swapl(&((xBigReq *)oci->bufptr)->length, n);
+		swapl(&((xBigReq *)oci->bufptr)->length);
 	    }
 	}
 	if (gotnow >= (needed << 2))
@@ -822,11 +821,10 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
         { /* start of new reply */
 	    CARD32 replylen;
 	    unsigned long bytesleft;
-	    char n;
 
 	    replylen = ((xGenericReply *)buf)->length;
 	    if (who->swapped)
-		swapl(&replylen, n);
+		swapl(&replylen);
 	    bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
 	    replyinfo.startOfReply = TRUE;
 	    replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 0437795..a8b73d9 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -751,7 +751,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
     RRModePtr			mode;
     RROutput			*outputs;
     RROutput			*possible;
-    int				i, j, k, n;
+    int				i, j, k;
     int				width, height;
     BoxRec			panned_area;
     
@@ -818,7 +818,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
     {
 	outputs[i] = crtc->outputs[i]->id;
 	if (client->swapped)
-	    swapl (&outputs[i], n);
+	    swapl(&outputs[i]);
     }
     k = 0;
     for (i = 0; i < pScrPriv->numOutputs; i++)
@@ -827,23 +827,23 @@ ProcRRGetCrtcInfo (ClientPtr client)
 	    {
 		possible[k] = pScrPriv->outputs[i]->id;
 		if (client->swapped)
-		    swapl (&possible[k], n);
+		    swapl(&possible[k]);
 		k++;
 	    }
     
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.timestamp, n);
-	swaps(&rep.x, n);
-	swaps(&rep.y, n);
-	swaps(&rep.width, n);
-	swaps(&rep.height, n);
-	swapl(&rep.mode, n);
-	swaps(&rep.rotation, n);
-	swaps(&rep.rotations, n);
-	swaps(&rep.nOutput, n);
-	swaps(&rep.nPossibleOutput, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.timestamp);
+	swaps(&rep.x);
+	swaps(&rep.y);
+	swaps(&rep.width);
+	swaps(&rep.height);
+	swapl(&rep.mode);
+	swaps(&rep.rotation);
+	swaps(&rep.rotations);
+	swaps(&rep.nOutput);
+	swaps(&rep.nPossibleOutput);
     }
     WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep);
     if (extraLen)
@@ -1058,10 +1058,9 @@ sendReply:
 
     if (client->swapped) 
     {
-	int n;
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.newTimestamp, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.newTimestamp);
     }
     WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep);
     
@@ -1079,7 +1078,6 @@ ProcRRGetPanning (ClientPtr client)
     BoxRec		total;
     BoxRec		tracking;
     INT16		border[4];
-    int			n;
     
     REQUEST_SIZE_MATCH(xRRGetPanningReq);
     VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1117,21 +1115,21 @@ ProcRRGetPanning (ClientPtr client)
     }
 
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swaps(&rep.timestamp, n);
-	swaps(&rep.left, n);
-	swaps(&rep.top, n);
-	swaps(&rep.width, n);
-	swaps(&rep.height, n);
-	swaps(&rep.track_left, n);
-	swaps(&rep.track_top, n);
-	swaps(&rep.track_width, n);
-	swaps(&rep.track_height, n);
-	swaps(&rep.border_left, n);
-	swaps(&rep.border_top, n);
-	swaps(&rep.border_right, n);
-	swaps(&rep.border_bottom, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.timestamp);
+	swaps(&rep.left);
+	swaps(&rep.top);
+	swaps(&rep.width);
+	swaps(&rep.height);
+	swaps(&rep.track_left);
+	swaps(&rep.track_top);
+	swaps(&rep.track_width);
+	swaps(&rep.track_height);
+	swaps(&rep.border_left);
+	swaps(&rep.border_top);
+	swaps(&rep.border_right);
+	swaps(&rep.border_bottom);
     }
     WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep);
     return Success;
@@ -1149,7 +1147,6 @@ ProcRRSetPanning (ClientPtr client)
     BoxRec		total;
     BoxRec		tracking;
     INT16		border[4];
-    int			n;
     
     REQUEST_SIZE_MATCH(xRRSetPanningReq);
     VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1198,9 +1195,9 @@ sendReply:
     rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
 
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swaps(&rep.newTimestamp, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.newTimestamp);
     }
     WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
     return Success;
@@ -1212,7 +1209,6 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
     REQUEST(xRRGetCrtcGammaSizeReq);
     xRRGetCrtcGammaSizeReply	reply;
     RRCrtcPtr			crtc;
-    int				n;
 
     REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
     VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1226,9 +1222,9 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
     reply.length = 0;
     reply.size = crtc->gammaSize;
     if (client->swapped) {
-	swaps (&reply.sequenceNumber, n);
-	swapl (&reply.length, n);
-	swaps (&reply.size, n);
+	swaps(&reply.sequenceNumber);
+	swapl(&reply.length);
+	swaps(&reply.size);
     }
     WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply);
     return Success;
@@ -1240,7 +1236,6 @@ ProcRRGetCrtcGamma (ClientPtr client)
     REQUEST(xRRGetCrtcGammaReq);
     xRRGetCrtcGammaReply	reply;
     RRCrtcPtr			crtc;
-    int				n;
     unsigned long		len;
     char			*extra = NULL;
     
@@ -1264,9 +1259,9 @@ ProcRRGetCrtcGamma (ClientPtr client)
     reply.length = bytes_to_int32(len);
     reply.size = crtc->gammaSize;
     if (client->swapped) {
-	swaps (&reply.sequenceNumber, n);
-	swapl (&reply.length, n);
-	swaps (&reply.size, n);
+	swaps(&reply.sequenceNumber);
+	swapl(&reply.length);
+	swaps(&reply.size);
     }
     WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply);
     if (crtc->gammaSize)
@@ -1361,7 +1356,6 @@ transform_filter_encode (ClientPtr client, char *output,
 			 RRTransformPtr transform)
 {
     int	    nbytes, nparams;
-    int	    n;
 
     if (transform->filter == NULL) {
 	*nbytesFilter = 0;
@@ -1377,8 +1371,8 @@ transform_filter_encode (ClientPtr client, char *output,
 	output[nbytes++] = 0;
     memcpy (output + nbytes, transform->params, nparams * sizeof (xFixed));
     if (client->swapped) {
-	swaps (nbytesFilter, n);
-	swaps (nparamsFilter, n);
+	swaps(nbytesFilter);
+	swaps(nparamsFilter);
 	SwapLongs ((CARD32 *) (output + nbytes), nparams);
     }
     nbytes += nparams * sizeof (xFixed);
@@ -1399,7 +1393,7 @@ ProcRRGetCrtcTransform (ClientPtr client)
     REQUEST(xRRGetCrtcTransformReq);
     xRRGetCrtcTransformReply	*reply;
     RRCrtcPtr			crtc;
-    int				n, nextra;
+    int				nextra;
     RRTransformPtr		current, pending;
     char			*extra;
 
@@ -1436,8 +1430,8 @@ ProcRRGetCrtcTransform (ClientPtr client)
 				      current);
 
     if (client->swapped) {
-	swaps (&reply->sequenceNumber, n);
-	swapl (&reply->length, n);
+	swaps(&reply->sequenceNumber);
+	swapl(&reply->length);
     }
     WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
     free(reply);
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index d1c99c2..5a6a852 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -36,7 +36,6 @@ static int
 ProcRRQueryVersion (ClientPtr client)
 {
     xRRQueryVersionReply rep = {0};
-    register int n;
     REQUEST(xRRQueryVersionReq);
     rrClientPriv(client);
 
@@ -59,10 +58,10 @@ ProcRRQueryVersion (ClientPtr client)
     }
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep);
     return Success;
diff --git a/randr/rrmode.c b/randr/rrmode.c
index d7560dc..63a2d2a 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -325,10 +325,9 @@ ProcRRCreateMode (ClientPtr client)
     rep.mode = mode->mode.id;
     if (client->swapped)
     {
-	int n;
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.mode, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.mode);
     }
     WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
     /* Drop out reference to this mode */
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 5edeb7d..b57be19 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -447,7 +447,7 @@ ProcRRGetOutputInfo (ClientPtr client)
     RRMode			*modes;
     RROutput			*clones;
     char			*name;
-    int				i, n;
+    int				i;
     
     REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
     VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
@@ -494,7 +494,7 @@ ProcRRGetOutputInfo (ClientPtr client)
     {
 	crtcs[i] = output->crtcs[i]->id;
 	if (client->swapped)
-	    swapl (&crtcs[i], n);
+	    swapl(&crtcs[i]);
     }
     for (i = 0; i < output->numModes + output->numUserModes; i++)
     {
@@ -503,26 +503,26 @@ ProcRRGetOutputInfo (ClientPtr client)
 	else
 	    modes[i] = output->userModes[i - output->numModes]->mode.id;
 	if (client->swapped)
-	    swapl (&modes[i], n);
+	    swapl(&modes[i]);
     }
     for (i = 0; i < output->numClones; i++)
     {
 	clones[i] = output->clones[i]->id;
 	if (client->swapped)
-	    swapl (&clones[i], n);
+	    swapl(&clones[i]);
     }
     memcpy (name, output->name, output->nameLength);
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.timestamp, n);
-	swapl(&rep.crtc, n);
-	swapl(&rep.mmWidth, n);
-	swapl(&rep.mmHeight, n);
-	swaps(&rep.nCrtcs, n);
-	swaps(&rep.nModes, n);
-	swaps(&rep.nClones, n);
-	swaps(&rep.nameLength, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.timestamp);
+	swapl(&rep.crtc);
+	swapl(&rep.mmWidth);
+	swapl(&rep.mmHeight);
+	swaps(&rep.nCrtcs);
+	swaps(&rep.nModes);
+	swaps(&rep.nClones);
+	swaps(&rep.nameLength);
     }
     WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep);
     if (extraLen)
@@ -614,9 +614,8 @@ ProcRRGetOutputPrimary(ClientPtr client)
     rep.output = primary ? primary->id : None;
 
     if (client->swapped) {
-	int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.output, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.output);
     }
 
     WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 61e7bb4..6ed24d3 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -409,10 +409,9 @@ ProcRRListOutputProperties (ClientPtr client)
     rep.nAtoms = numProps;
     if (client->swapped) 
     {
-	int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
-	swaps (&rep.nAtoms, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.nAtoms);
     }
     temppAtoms = pAtoms;
     for (prop = output->properties; prop; prop = prop->next)
@@ -458,9 +457,8 @@ ProcRRQueryOutputProperty (ClientPtr client)
     rep.immutable = prop->immutable;
     if (client->swapped) 
     {
-	int n;
-	swaps (&rep.sequenceNumber, n);
-	swapl (&rep.length, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
     }
     WriteToClient (client, sizeof (xRRQueryOutputPropertyReply), (char*)&rep);
     if (prop->num_valid)
@@ -615,13 +613,11 @@ ProcRRGetOutputProperty (ClientPtr client)
 	reply.propertyType = None;
 	reply.format = 0;
 	if (client->swapped) {
-	    int n;
-
-	    swaps(&reply.sequenceNumber, n);
-	    swapl(&reply.length, n);
-	    swapl(&reply.propertyType, n);
-	    swapl(&reply.bytesAfter, n);
-	    swapl(&reply.nItems, n);
+	    swaps(&reply.sequenceNumber);
+	    swapl(&reply.length);
+	    swapl(&reply.propertyType);
+	    swapl(&reply.bytesAfter);
+	    swapl(&reply.nItems);
 	}
 	WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
 	return Success;
@@ -647,13 +643,11 @@ ProcRRGetOutputProperty (ClientPtr client)
 	reply.nItems = 0;
 	reply.propertyType = prop_value->type;
 	if (client->swapped) {
-	    int n;
-
-	    swaps(&reply.sequenceNumber, n);
-	    swapl(&reply.length, n);
-	    swapl(&reply.propertyType, n);
-	    swapl(&reply.bytesAfter, n);
-	    swapl(&reply.nItems, n);
+	    swaps(&reply.sequenceNumber);
+	    swapl(&reply.length);
+	    swapl(&reply.propertyType);
+	    swapl(&reply.bytesAfter);
+	    swapl(&reply.nItems);
 	}
 	WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
 	return Success;
@@ -704,13 +698,11 @@ ProcRRGetOutputProperty (ClientPtr client)
     }
 
     if (client->swapped) {
-	int n;
-
-	swaps(&reply.sequenceNumber, n);
-	swapl(&reply.length, n);
-	swapl(&reply.propertyType, n);
-	swapl(&reply.bytesAfter, n);
-	swapl(&reply.nItems, n);
+	swaps(&reply.sequenceNumber);
+	swapl(&reply.length);
+	swapl(&reply.propertyType);
+	swapl(&reply.bytesAfter);
+	swapl(&reply.nItems);
     }
     WriteToClient(client, sizeof(xGenericReply), &reply);
     if (len)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index da6d48d..ab46757 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -232,14 +232,12 @@ ProcRRGetScreenSizeRange (ClientPtr client)
     }
     if (client->swapped) 
     {
-	int n;
-	
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swaps(&rep.minWidth, n);
-	swaps(&rep.minHeight, n);
-	swaps(&rep.maxWidth, n);
-	swaps(&rep.maxHeight, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.minWidth);
+	swaps(&rep.minHeight);
+	swaps(&rep.maxWidth);
+	swaps(&rep.maxHeight);
     }
     WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep);
     return Success;
@@ -318,7 +316,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
     rrScrPrivPtr		pScrPriv;
     CARD8			*extra;
     unsigned long		extraLen;
-    int				i, n, rc, has_primary = 0;
+    int				i, rc, has_primary = 0;
     RRCrtc			*crtcs;
     RROutput			*outputs;
     xRRModeInfo			*modeinfos;
@@ -401,7 +399,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
 	    has_primary = 1;
 	    crtcs[0] = pScrPriv->primaryOutput->crtc->id;
 	    if (client->swapped)
-		swapl (&crtcs[0], n);
+		swapl(&crtcs[0]);
 	}
 	
 	for (i = 0; i < pScrPriv->numCrtcs; i++)
@@ -414,14 +412,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
 	    }
 	    crtcs[i + has_primary] = pScrPriv->crtcs[i]->id;
 	    if (client->swapped)
-		swapl (&crtcs[i + has_primary], n);
+		swapl(&crtcs[i + has_primary]);
 	}
 	
 	for (i = 0; i < pScrPriv->numOutputs; i++)
 	{
 	    outputs[i] = pScrPriv->outputs[i]->id;
 	    if (client->swapped)
-		swapl (&outputs[i], n);
+		swapl(&outputs[i]);
 	}
 	
 	for (i = 0; i < num_modes; i++)
@@ -430,19 +428,19 @@ rrGetScreenResources(ClientPtr client, Bool query)
 	    modeinfos[i] = mode->mode;
 	    if (client->swapped)
 	    {
-		swapl (&modeinfos[i].id, n);
-		swaps (&modeinfos[i].width, n);
-		swaps (&modeinfos[i].height, n);
-		swapl (&modeinfos[i].dotClock, n);
-		swaps (&modeinfos[i].hSyncStart, n);
-		swaps (&modeinfos[i].hSyncEnd, n);
-		swaps (&modeinfos[i].hTotal, n);
-		swaps (&modeinfos[i].hSkew, n);
-		swaps (&modeinfos[i].vSyncStart, n);
-		swaps (&modeinfos[i].vSyncEnd, n);
-		swaps (&modeinfos[i].vTotal, n);
-		swaps (&modeinfos[i].nameLength, n);
-		swapl (&modeinfos[i].modeFlags, n);
+		swapl(&modeinfos[i].id);
+		swaps(&modeinfos[i].width);
+		swaps(&modeinfos[i].height);
+		swapl(&modeinfos[i].dotClock);
+		swaps(&modeinfos[i].hSyncStart);
+		swaps(&modeinfos[i].hSyncEnd);
+		swaps(&modeinfos[i].hTotal);
+		swaps(&modeinfos[i].hSkew);
+		swaps(&modeinfos[i].vSyncStart);
+		swaps(&modeinfos[i].vSyncEnd);
+		swaps(&modeinfos[i].vTotal);
+		swaps(&modeinfos[i].nameLength);
+		swapl(&modeinfos[i].modeFlags);
 	    }
 	    memcpy (names, mode->name, 
 		    mode->mode.nameLength);
@@ -453,14 +451,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
     }
     
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.timestamp, n);
-	swapl(&rep.configTimestamp, n);
-	swaps(&rep.nCrtcs, n);
-	swaps(&rep.nOutputs, n);
-	swaps(&rep.nModes, n);
-	swaps(&rep.nbytesNames, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.timestamp);
+	swapl(&rep.configTimestamp);
+	swaps(&rep.nCrtcs);
+	swaps(&rep.nOutputs);
+	swaps(&rep.nModes);
+	swaps(&rep.nbytesNames);
     }
     WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep);
     if (extraLen)
@@ -592,7 +590,7 @@ ProcRRGetScreenInfo (ClientPtr client)
     REQUEST(xRRGetScreenInfoReq);
     xRRGetScreenInfoReply   rep;
     WindowPtr	    	    pWin;
-    int			    n, rc;
+    int			    rc;
     ScreenPtr		    pScreen;
     rrScrPrivPtr	    pScrPriv;
     CARD8		    *extra;
@@ -688,10 +686,10 @@ ProcRRGetScreenInfo (ClientPtr client)
 	    size->heightInMillimeters = pSize->mmHeight;
 	    if (client->swapped)
 	    {
-	        swaps (&size->widthInPixels, n);
-	        swaps (&size->heightInPixels, n);
-	        swaps (&size->widthInMillimeters, n);
-	        swaps (&size->heightInMillimeters, n);
+	        swaps(&size->widthInPixels);
+	        swaps(&size->heightInPixels);
+	        swaps(&size->widthInMillimeters);
+	        swaps(&size->heightInMillimeters);
 	    }
 	    size++;
 	    if (has_rate)
@@ -699,7 +697,7 @@ ProcRRGetScreenInfo (ClientPtr client)
 		*rates = pSize->nRates;
 		if (client->swapped)
 		{
-		    swaps (rates, n);
+		    swaps(rates);
 		}
 		rates++;
 		for (j = 0; j < pSize->nRates; j++)
@@ -707,7 +705,7 @@ ProcRRGetScreenInfo (ClientPtr client)
 		    *rates = pSize->pRates[j].rate;
 		    if (client->swapped)
 		    {
-			swaps (rates, n);
+			swaps(rates);
 		    }
 		    rates++;
 		}
@@ -723,14 +721,14 @@ ProcRRGetScreenInfo (ClientPtr client)
 	rep.length =  bytes_to_int32(extraLen);
     }
     if (client->swapped) {
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.timestamp, n);
-	swaps(&rep.rotation, n);
-	swaps(&rep.nSizes, n);
-	swaps(&rep.sizeID, n);
-	swaps(&rep.rate, n);
-	swaps(&rep.nrateEnts, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.timestamp);
+	swaps(&rep.rotation);
+	swaps(&rep.nSizes);
+	swaps(&rep.sizeID);
+	swaps(&rep.rate);
+	swaps(&rep.nrateEnts);
     }
     WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep);
     if (extraLen)
@@ -747,7 +745,7 @@ ProcRRSetScreenConfig (ClientPtr client)
     REQUEST(xRRSetScreenConfigReq);
     xRRSetScreenConfigReply rep;
     DrawablePtr		    pDraw;
-    int			    n, rc;
+    int			    rc;
     ScreenPtr		    pScreen;
     rrScrPrivPtr	    pScrPriv;
     TimeStamp		    time;
@@ -976,11 +974,11 @@ sendReply:
 
     if (client->swapped) 
     {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.newTimestamp, n);
-	swapl(&rep.newConfigTimestamp, n);
-	swapl(&rep.root, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.newTimestamp);
+	swapl(&rep.newConfigTimestamp);
+	swapl(&rep.root);
     }
     WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep);
 
diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index e16090a..543fc90 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -25,149 +25,138 @@
 static int
 SProcRRQueryVersion (ClientPtr client)
 {
-    register int n;
     REQUEST(xRRQueryVersionReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->majorVersion, n);
-    swapl(&stuff->minorVersion, n);
+    swaps(&stuff->length);
+    swapl(&stuff->majorVersion);
+    swapl(&stuff->minorVersion);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetScreenInfo (ClientPtr client)
 {
-    register int n;
     REQUEST(xRRGetScreenInfoReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetScreenConfig (ClientPtr client)
 {
-    register int n;
     REQUEST(xRRSetScreenConfigReq);
 
     if (RRClientKnowsRates (client))
     {
 	REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
-	swaps (&stuff->rate, n);
+	swaps(&stuff->rate);
     }
     else
     {
 	REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
     }
     
-    swaps(&stuff->length, n);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->timestamp, n);
-    swaps(&stuff->sizeID, n);
-    swaps(&stuff->rotation, n);
+    swaps(&stuff->length);
+    swapl(&stuff->drawable);
+    swapl(&stuff->timestamp);
+    swaps(&stuff->sizeID);
+    swaps(&stuff->rotation);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSelectInput (ClientPtr client)
 {
-    register int n;
     REQUEST(xRRSelectInputReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
-    swaps(&stuff->enable, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    swaps(&stuff->enable);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetScreenSizeRange (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetScreenSizeRangeReq);
 
     REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetScreenSize (ClientPtr client)
 {
-    int n;
     REQUEST(xRRSetScreenSizeReq);
 
     REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swapl(&stuff->widthInMillimeters, n);
-    swapl(&stuff->heightInMillimeters, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->widthInMillimeters);
+    swapl(&stuff->heightInMillimeters);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetScreenResources (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetScreenResourcesReq);
 
     REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetOutputInfo (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetOutputInfoReq);
 
     REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->configTimestamp, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->configTimestamp);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRListOutputProperties (ClientPtr client)
 {
-    int n;
     REQUEST(xRRListOutputPropertiesReq);
 
     REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRQueryOutputProperty (ClientPtr client)
 {
-    int n;
     REQUEST(xRRQueryOutputPropertyReq);
 
     REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->property, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->property);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRConfigureOutputProperty (ClientPtr client)
 {
-    int n;
     REQUEST(xRRConfigureOutputPropertyReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->property, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->property);
     SwapRestL(stuff);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
@@ -175,15 +164,14 @@ SProcRRConfigureOutputProperty (ClientPtr client)
 static int
 SProcRRChangeOutputProperty (ClientPtr client)
 {
-    int n;
     REQUEST(xRRChangeOutputPropertyReq);
 
     REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->nUnits, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->nUnits);
     switch(stuff->format) {
 	case 8:
 	    break;
@@ -203,125 +191,117 @@ SProcRRChangeOutputProperty (ClientPtr client)
 static int
 SProcRRDeleteOutputProperty (ClientPtr client)
 {
-    int n;
     REQUEST(xRRDeleteOutputPropertyReq);
     
     REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->property, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->property);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetOutputProperty (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetOutputPropertyReq);
 
     REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->property, n);
-    swapl(&stuff->type, n);
-    swapl(&stuff->longOffset, n);
-    swapl(&stuff->longLength, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->property);
+    swapl(&stuff->type);
+    swapl(&stuff->longOffset);
+    swapl(&stuff->longLength);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRCreateMode (ClientPtr client)
 {
-    int n;
     xRRModeInfo *modeinfo;
     REQUEST(xRRCreateModeReq);
 
     REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
 
     modeinfo = &stuff->modeInfo;
-    swapl(&modeinfo->id, n);
-    swaps(&modeinfo->width, n);
-    swaps(&modeinfo->height, n);
-    swapl(&modeinfo->dotClock, n);
-    swaps(&modeinfo->hSyncStart, n);
-    swaps(&modeinfo->hSyncEnd, n);
-    swaps(&modeinfo->hTotal, n);
-    swaps(&modeinfo->vSyncStart, n);
-    swaps(&modeinfo->vSyncEnd, n);
-    swaps(&modeinfo->vTotal, n);
-    swaps(&modeinfo->nameLength, n);
-    swapl(&modeinfo->modeFlags, n);
+    swapl(&modeinfo->id);
+    swaps(&modeinfo->width);
+    swaps(&modeinfo->height);
+    swapl(&modeinfo->dotClock);
+    swaps(&modeinfo->hSyncStart);
+    swaps(&modeinfo->hSyncEnd);
+    swaps(&modeinfo->hTotal);
+    swaps(&modeinfo->vSyncStart);
+    swaps(&modeinfo->vSyncEnd);
+    swaps(&modeinfo->vTotal);
+    swaps(&modeinfo->nameLength);
+    swapl(&modeinfo->modeFlags);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRDestroyMode (ClientPtr client)
 {
-    int n;
     REQUEST(xRRDestroyModeReq);
 
     REQUEST_SIZE_MATCH(xRRDestroyModeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->mode, n);
+    swaps(&stuff->length);
+    swapl(&stuff->mode);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRAddOutputMode (ClientPtr client)
 {
-    int n;
     REQUEST(xRRAddOutputModeReq);
 
     REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->mode, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->mode);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRDeleteOutputMode (ClientPtr client)
 {
-    int n;
     REQUEST(xRRDeleteOutputModeReq);
 
     REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->output, n);
-    swapl(&stuff->mode, n);
+    swaps(&stuff->length);
+    swapl(&stuff->output);
+    swapl(&stuff->mode);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetCrtcInfo (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetCrtcInfoReq);
 
     REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
-    swapl(&stuff->configTimestamp, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
+    swapl(&stuff->configTimestamp);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetCrtcConfig (ClientPtr client)
 {
-    int n;
     REQUEST(xRRSetCrtcConfigReq);
 
     REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
-    swapl(&stuff->timestamp, n);
-    swapl(&stuff->configTimestamp, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
-    swapl(&stuff->mode, n);
-    swaps(&stuff->rotation, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
+    swapl(&stuff->timestamp);
+    swapl(&stuff->configTimestamp);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swapl(&stuff->mode);
+    swaps(&stuff->rotation);
     SwapRestL(stuff);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
@@ -329,37 +309,34 @@ SProcRRSetCrtcConfig (ClientPtr client)
 static int
 SProcRRGetCrtcGammaSize (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetCrtcGammaSizeReq);
 
     REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetCrtcGamma (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetCrtcGammaReq);
 
     REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetCrtcGamma (ClientPtr client)
 {
-    int n;
     REQUEST(xRRSetCrtcGammaReq);
 
     REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
-    swaps(&stuff->size, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
+    swaps(&stuff->size);
     SwapRestS(stuff);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
@@ -367,16 +344,16 @@ SProcRRSetCrtcGamma (ClientPtr client)
 static int
 SProcRRSetCrtcTransform (ClientPtr client)
 {
-    int n, nparams;
+    int nparams;
     char *filter;
     CARD32 *params;
     REQUEST(xRRSetCrtcTransformReq);
 
     REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
     SwapLongs((CARD32 *)&stuff->transform, bytes_to_int32(sizeof(xRenderTransform)));
-    swaps(&stuff->nbytesFilter, n);
+    swaps(&stuff->nbytesFilter);
     filter = (char *)(stuff + 1);
     params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
     nparams = ((CARD32 *) stuff + client->req_len) - params;
@@ -390,74 +367,69 @@ SProcRRSetCrtcTransform (ClientPtr client)
 static int
 SProcRRGetCrtcTransform (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetCrtcTransformReq);
 
     REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRGetPanning (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetPanningReq);
     
     REQUEST_SIZE_MATCH(xRRGetPanningReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetPanning (ClientPtr client)
 {
-    int n;
     REQUEST(xRRSetPanningReq);
     
     REQUEST_SIZE_MATCH(xRRSetPanningReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->crtc, n);
-    swapl(&stuff->timestamp, n);
-    swaps(&stuff->left, n);
-    swaps(&stuff->top, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
-    swaps(&stuff->track_left, n);
-    swaps(&stuff->track_top, n);
-    swaps(&stuff->track_width, n);
-    swaps(&stuff->track_height, n);
-    swaps(&stuff->border_left, n);
-    swaps(&stuff->border_top, n);
-    swaps(&stuff->border_right, n);
-    swaps(&stuff->border_bottom, n);
+    swaps(&stuff->length);
+    swapl(&stuff->crtc);
+    swapl(&stuff->timestamp);
+    swaps(&stuff->left);
+    swaps(&stuff->top);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swaps(&stuff->track_left);
+    swaps(&stuff->track_top);
+    swaps(&stuff->track_width);
+    swaps(&stuff->track_height);
+    swaps(&stuff->border_left);
+    swaps(&stuff->border_top);
+    swaps(&stuff->border_right);
+    swaps(&stuff->border_bottom);
     return (*ProcRandrVector[stuff->randrReqType]) (client);
 }
 
 static int
 SProcRRSetOutputPrimary (ClientPtr client)
 {
-    int n;
     REQUEST(xRRSetOutputPrimaryReq);
 
     REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
-    swapl(&stuff->output, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    swapl(&stuff->output);
     return ProcRandrVector[stuff->randrReqType](client);
 }
 
 static int
 SProcRRGetOutputPrimary (ClientPtr client)
 {
-    int n;
     REQUEST(xRRGetOutputPrimaryReq);
 
     REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
     return ProcRandrVector[stuff->randrReqType](client);
 }
 
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index c1bd5bb..6d45190 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -90,7 +90,6 @@ int
 ProcRRXineramaQueryVersion(ClientPtr client)
 {
     xPanoramiXQueryVersionReply	  rep;
-    register int		  n;
 
     REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
     rep.type = X_Reply;
@@ -99,10 +98,10 @@ ProcRRXineramaQueryVersion(ClientPtr client)
     rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
     rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
     if(client->swapped) {
-        swaps(&rep.sequenceNumber, n);
-        swapl(&rep.length, n);
-        swaps(&rep.majorVersion, n);
-        swaps(&rep.minorVersion, n);
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swaps(&rep.majorVersion);
+        swaps(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep);
     return Success;
@@ -114,7 +113,7 @@ ProcRRXineramaGetState(ClientPtr client)
     REQUEST(xPanoramiXGetStateReq);
     WindowPtr			pWin;
     xPanoramiXGetStateReply	rep;
-    register int		n, rc;
+    register int		rc;
     ScreenPtr			pScreen;
     rrScrPrivPtr		pScrPriv;
     Bool			active = FALSE;
@@ -138,9 +137,9 @@ ProcRRXineramaGetState(ClientPtr client)
     rep.state = active;
     rep.window = stuff->window;
     if(client->swapped) {
-       swaps (&rep.sequenceNumber, n);
-       swapl (&rep.length, n);
-       swapl (&rep.window, n);
+       swaps(&rep.sequenceNumber);
+       swapl(&rep.length);
+       swapl(&rep.window);
     }
     WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
     return Success;
@@ -180,7 +179,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
     REQUEST(xPanoramiXGetScreenCountReq);
     WindowPtr				pWin;
     xPanoramiXGetScreenCountReply	rep;
-    register int			n, rc;
+    register int			rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -193,9 +192,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
     rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen);
     rep.window = stuff->window;
     if(client->swapped) {
-       swaps(&rep.sequenceNumber, n);
-       swapl(&rep.length, n);
-       swapl(&rep.window, n);
+       swaps(&rep.sequenceNumber);
+       swapl(&rep.length);
+       swapl(&rep.window);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
     return Success;
@@ -208,7 +207,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
     WindowPtr				pWin, pRoot;
     ScreenPtr				pScreen;
     xPanoramiXGetScreenSizeReply	rep;
-    register int			n, rc;
+    register int			rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -226,12 +225,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
     rep.window = stuff->window;
     rep.screen = stuff->screen;
     if(client->swapped) {
-       swaps(&rep.sequenceNumber, n);
-       swapl(&rep.length, n);
-       swapl(&rep.width, n);
-       swapl(&rep.height, n);
-       swapl(&rep.window, n);
-       swapl(&rep.screen, n);
+       swaps(&rep.sequenceNumber);
+       swapl(&rep.length);
+       swapl(&rep.width);
+       swapl(&rep.height);
+       swapl(&rep.window);
+       swapl(&rep.screen);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
     return Success;
@@ -250,10 +249,9 @@ ProcRRXineramaIsActive(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]);
     if(client->swapped) {
-	register int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.state, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.state);
     }
     WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
     return Success;
@@ -287,11 +285,10 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
 	    scratch.height = height;
 	}
 	if(client->swapped) {
-	    register int n;
-	    swaps(&scratch.x_org, n);
-	    swaps(&scratch.y_org, n);
-	    swaps(&scratch.width, n);
-	    swaps(&scratch.height, n);
+	    swaps(&scratch.x_org);
+	    swaps(&scratch.y_org);
+	    swaps(&scratch.width);
+	    swaps(&scratch.height);
 	}
 	WriteToClient(client, sz_XineramaScreenInfo, &scratch);
     }
@@ -313,10 +310,9 @@ ProcRRXineramaQueryScreens(ClientPtr client)
     rep.number = RRXineramaScreenCount (pScreen);
     rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
     if(client->swapped) {
-	register int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length, n);
-	swapl(&rep.number, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.number);
     }
     WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep);
 
@@ -371,8 +367,7 @@ static int
 SProcRRXineramaQueryVersion (ClientPtr client)
 {
     REQUEST(xPanoramiXQueryVersionReq);
-    register int n;
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
     return ProcRRXineramaQueryVersion(client);
 }
@@ -381,10 +376,9 @@ static int
 SProcRRXineramaGetState(ClientPtr client)
 {
     REQUEST(xPanoramiXGetStateReq);
-    register int n;
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcRRXineramaGetState(client);
 }
 
@@ -392,10 +386,9 @@ static int
 SProcRRXineramaGetScreenCount(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenCountReq);
-    register int n;
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return ProcRRXineramaGetScreenCount(client);
 }
 
@@ -403,11 +396,10 @@ static int
 SProcRRXineramaGetScreenSize(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenSizeReq);
-    register int n;
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    swapl (&stuff->window, n);
-    swapl (&stuff->screen, n);
+    swapl(&stuff->window);
+    swapl(&stuff->screen);
     return ProcRRXineramaGetScreenSize(client);
 }
 
@@ -415,8 +407,7 @@ static int
 SProcRRXineramaIsActive(ClientPtr client)
 {
     REQUEST(xXineramaIsActiveReq);
-    register int n;
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
     return ProcRRXineramaIsActive(client);
 }
@@ -425,8 +416,7 @@ static int
 SProcRRXineramaQueryScreens(ClientPtr client)
 {
     REQUEST(xXineramaQueryScreensReq);
-    register int n;
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
     return ProcRRXineramaQueryScreens(client);
 }
diff --git a/record/record.c b/record/record.c
index 69fca72..68311ac 100644
--- a/record/record.c
+++ b/record/record.c
@@ -295,7 +295,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
     CARD32 elemHeaderData[2];
     int numElemHeaders = 0;
     Bool recordingClientSwapped = pContext->pRecordingClient->swapped;
-    int n;
     CARD32 serverTime = 0;
     Bool gotServerTime = FALSE;
     int replylen;
@@ -339,11 +338,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
 
 	    if (recordingClientSwapped)
 	    {
-		swaps(&pRep->sequenceNumber, n);
-		swapl(&pRep->length, n);
-		swapl(&pRep->idBase, n);
-		swapl(&pRep->serverTime, n);
-		swapl(&pRep->recordedSequenceNumber, n);
+		swaps(&pRep->sequenceNumber);
+		swapl(&pRep->length);
+		swapl(&pRep->idBase);
+		swapl(&pRep->serverTime);
+		swapl(&pRep->recordedSequenceNumber);
 	    }
 	    pContext->numBufBytes = SIZEOF(xRecordEnableContextReply);
 	}
@@ -361,7 +360,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
 	    else
 		elemHeaderData[numElemHeaders] = GetTimeInMillis();
 	    if (recordingClientSwapped)
-		swapl(&elemHeaderData[numElemHeaders], n);
+		swapl(&elemHeaderData[numElemHeaders]);
 	    numElemHeaders++;
 	}
 
@@ -371,17 +370,17 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
 	{
 	    elemHeaderData[numElemHeaders] = pClient->sequence;
 	    if (recordingClientSwapped)
-		swapl(&elemHeaderData[numElemHeaders], n);
+		swapl(&elemHeaderData[numElemHeaders]);
 	    numElemHeaders++;
 	}
 
 	/* adjust reply length */
 
 	replylen = pRep->length;
-	if (recordingClientSwapped) swapl(&replylen, n);
+	if (recordingClientSwapped) swapl(&replylen);
 	replylen += numElemHeaders + bytes_to_int32(datalen) +
             bytes_to_int32(futurelen);
-	if (recordingClientSwapped) swapl(&replylen, n);
+	if (recordingClientSwapped) swapl(&replylen);
 	pRep->length = replylen;
     } /* end if not continued reply */
 
@@ -473,7 +472,6 @@ static void
 RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
 {
     CARD32 bigLength;
-    char n;
     int bytesLeft;
 
     /* note: client->req_len has been frobbed by ReadRequestFromClient
@@ -490,7 +488,7 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
     /* reinsert the extended length field that was squished out */
     bigLength = client->req_len + bytes_to_int32(sizeof(bigLength));
     if (client->swapped)
-	swapl(&bigLength, n);
+	swapl(&bigLength);
     RecordAProtocolElement(pContext, client, XRecordFromClient,
 		(pointer)&bigLength, sizeof(bigLength), /* continuation */ -1);
     bytesLeft -= sizeof(bigLength);
@@ -1892,7 +1890,6 @@ ProcRecordQueryVersion(ClientPtr client)
 {
     /* REQUEST(xRecordQueryVersionReq); */
     xRecordQueryVersionReply 	rep;
-    int 		n;
 
     REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
     rep.type        	= X_Reply;
@@ -1902,9 +1899,9 @@ ProcRecordQueryVersion(ClientPtr client)
     rep.minorVersion  	= SERVER_RECORD_MINOR_VERSION;
     if(client->swapped)
     {
-    	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.majorVersion, n);
-	swaps(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.majorVersion);
+	swaps(&rep.minorVersion);
     }
     (void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
 			(char *)&rep);
@@ -2207,13 +2204,12 @@ static void
 RecordSwapRanges(xRecordRange *pRanges, int nRanges)
 {
     int i;
-    register char n;
     for (i = 0; i < nRanges; i++, pRanges++)
     {
-	swaps(&pRanges->extRequestsMinorFirst, n);
-	swaps(&pRanges->extRequestsMinorLast, n);
-	swaps(&pRanges->extRepliesMinorFirst, n);
-	swaps(&pRanges->extRepliesMinorLast, n);
+	swaps(&pRanges->extRequestsMinorFirst);
+	swaps(&pRanges->extRequestsMinorLast);
+	swaps(&pRanges->extRepliesMinorFirst);
+	swaps(&pRanges->extRepliesMinorLast);
     }
 } /* RecordSwapRanges */
 
@@ -2224,7 +2220,6 @@ ProcRecordGetContext(ClientPtr client)
     RecordContextPtr pContext;
     REQUEST(xRecordGetContextReq);
     xRecordGetContextReply rep;
-    int n;
     RecordClientsAndProtocolPtr pRCAP;
     int nRCAPs = 0;
     GetContextRangeInfoPtr pRangeInfo;
@@ -2323,9 +2318,9 @@ ProcRecordGetContext(ClientPtr client)
     rep.elementHeader = pContext->elemHeaders;
     if(client->swapped)
     {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-    	swapl(&rep.nClients, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.nClients);
     }
     (void)WriteToClient(client, sizeof(xRecordGetContextReply),
 			(char *)&rep);
@@ -2340,13 +2335,13 @@ ProcRecordGetContext(ClientPtr client)
 	rci.nRanges = pri->nRanges;
 	if (client->swapped)
 	{
-	    swapl(&rci.nRanges, n);
+	    swapl(&rci.nRanges);
 	    RecordSwapRanges(pri->pRanges, pri->nRanges);
 	}
 	for (i = 0; i < pRCAP->numClients; i++)
 	{
 	    rci.clientResource = pRCAP->pClientIDs[i];
-	    if (client->swapped) swapl(&rci.clientResource, n);
+	    if (client->swapped) swapl(&rci.clientResource);
 	    WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci);
 	    WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
 			  (char *)pri->pRanges);
@@ -2590,12 +2585,11 @@ static int
 SProcRecordQueryVersion(ClientPtr client)
 {
     REQUEST(xRecordQueryVersionReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
-    swaps(&stuff->majorVersion, n);
-    swaps(&stuff->minorVersion,n);
+    swaps(&stuff->majorVersion);
+    swaps(&stuff->minorVersion);
     return ProcRecordQueryVersion(client);
 } /* SProcRecordQueryVersion */
 
@@ -2603,19 +2597,18 @@ SProcRecordQueryVersion(ClientPtr client)
 static int
 SwapCreateRegister(xRecordRegisterClientsReq *stuff)
 {
-    register char n;
     int i;
     XID *pClientID;
 
-    swapl(&stuff->context, n);
-    swapl(&stuff->nClients, n);
-    swapl(&stuff->nRanges, n);
+    swapl(&stuff->context);
+    swapl(&stuff->nClients);
+    swapl(&stuff->nRanges);
     pClientID = (XID *)&stuff[1];
     if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq))
 	return BadLength;
     for (i = 0; i < stuff->nClients; i++, pClientID++)
     {
-	swapl(pClientID, n);
+	swapl(pClientID);
     }
     if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)
 	- stuff->nClients)
@@ -2630,9 +2623,8 @@ SProcRecordCreateContext(ClientPtr client)
 {
     REQUEST(xRecordCreateContextReq);
     int			status;
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
     if ((status = SwapCreateRegister((pointer)stuff)) != Success)
 	return status;
@@ -2645,9 +2637,8 @@ SProcRecordRegisterClients(ClientPtr client)
 {
     REQUEST(xRecordRegisterClientsReq);
     int			status;
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
     if ((status = SwapCreateRegister((pointer)stuff)) != Success)
 	return status;
@@ -2659,12 +2650,11 @@ static int
 SProcRecordUnregisterClients(ClientPtr client)
 {
     REQUEST(xRecordUnregisterClientsReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
-    swapl(&stuff->context, n);
-    swapl(&stuff->nClients, n);
+    swapl(&stuff->context);
+    swapl(&stuff->nClients);
     SwapRestL(stuff);
     return ProcRecordUnregisterClients(client);
 } /* SProcRecordUnregisterClients */
@@ -2674,11 +2664,10 @@ static int
 SProcRecordGetContext(ClientPtr client)
 {
     REQUEST(xRecordGetContextReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecordGetContextReq);
-    swapl(&stuff->context, n);
+    swapl(&stuff->context);
     return ProcRecordGetContext(client);
 } /* SProcRecordGetContext */
 
@@ -2686,11 +2675,10 @@ static int
 SProcRecordEnableContext(ClientPtr client)
 {
     REQUEST(xRecordEnableContextReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecordEnableContextReq);
-    swapl(&stuff->context, n);
+    swapl(&stuff->context);
     return ProcRecordEnableContext(client);
 } /* SProcRecordEnableContext */
 
@@ -2699,11 +2687,10 @@ static int
 SProcRecordDisableContext(ClientPtr client)
 {
     REQUEST(xRecordDisableContextReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecordDisableContextReq);
-    swapl(&stuff->context, n);
+    swapl(&stuff->context);
     return ProcRecordDisableContext(client);
 } /* SProcRecordDisableContext */
 
@@ -2712,11 +2699,10 @@ static int
 SProcRecordFreeContext(ClientPtr client)
 {
     REQUEST(xRecordFreeContextReq);
-    register char 	n;
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xRecordFreeContextReq);
-    swapl(&stuff->context, n);
+    swapl(&stuff->context);
     return ProcRecordFreeContext(client);
 } /* SProcRecordFreeContext */
 
diff --git a/render/render.c b/render/render.c
index ebb1d63..facc32a 100644
--- a/render/render.c
+++ b/render/render.c
@@ -276,7 +276,6 @@ ProcRenderQueryVersion (ClientPtr client)
 {
     RenderClientPtr pRenderClient = GetRenderClient (client);
     xRenderQueryVersionReply rep;
-    register int n;
     REQUEST(xRenderQueryVersionReq);
 
     pRenderClient->major_version = stuff->majorVersion;
@@ -300,10 +299,10 @@ ProcRenderQueryVersion (ClientPtr client)
     }
 
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
     return Success;
@@ -345,7 +344,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
     int				    nvisual;
     int				    rlength;
     int				    s;
-    int				    n;
     int				    numScreens;
     int				    numSubpixel;
 /*    REQUEST(xRenderQueryPictFormatsReq); */
@@ -432,16 +430,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
 		    pictForm->colormap = None;
 		if (client->swapped)
 		{
-		    swapl (&pictForm->id, n);
-		    swaps (&pictForm->direct.red, n);
-		    swaps (&pictForm->direct.redMask, n);
-		    swaps (&pictForm->direct.green, n);
-		    swaps (&pictForm->direct.greenMask, n);
-		    swaps (&pictForm->direct.blue, n);
-		    swaps (&pictForm->direct.blueMask, n);
-		    swaps (&pictForm->direct.alpha, n);
-		    swaps (&pictForm->direct.alphaMask, n);
-		    swapl (&pictForm->colormap, n);
+		    swapl(&pictForm->id);
+		    swaps(&pictForm->direct.red);
+		    swaps(&pictForm->direct.redMask);
+		    swaps(&pictForm->direct.green);
+		    swaps(&pictForm->direct.greenMask);
+		    swaps(&pictForm->direct.blue);
+		    swaps(&pictForm->direct.blueMask);
+		    swaps(&pictForm->direct.alpha);
+		    swaps(&pictForm->direct.alphaMask);
+		    swapl(&pictForm->colormap);
 		}
 		pictForm++;
 	    }
@@ -471,8 +469,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
 		    pictVisual->format = pFormat->id;
 		    if (client->swapped)
 		    {
-			swapl (&pictVisual->visual, n);
-			swapl (&pictVisual->format, n);
+			swapl(&pictVisual->visual);
+			swapl(&pictVisual->format);
 		    }
 		    pictVisual++;
 		    nvisual++;
@@ -482,7 +480,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
 	    pictDepth->nPictVisuals = nvisual;
 	    if (client->swapped)
 	    {
-		swaps (&pictDepth->nPictVisuals, n);
+		swaps(&pictDepth->nPictVisuals);
 	    }
 	    ndepth++;
 	    pictDepth = (xPictDepth *) pictVisual;
@@ -495,8 +493,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
 	    pictScreen->fallback = 0;
 	if (client->swapped)
 	{
-	    swapl (&pictScreen->nDepth, n);
-	    swapl (&pictScreen->fallback, n);
+	    swapl(&pictScreen->nDepth);
+	    swapl(&pictScreen->fallback);
 	}
 	pictScreen = (xPictScreen *) pictDepth;
     }
@@ -512,20 +510,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
 	    *pictSubpixel = SubPixelUnknown;
 	if (client->swapped)
 	{
-	    swapl (pictSubpixel, n);
+	    swapl(pictSubpixel);
 	}
 	++pictSubpixel;
     }
     
     if (client->swapped)
     {
-	swaps (&reply->sequenceNumber, n);
-	swapl (&reply->length, n);
-	swapl (&reply->numFormats, n);
-	swapl (&reply->numScreens, n);
-	swapl (&reply->numDepths, n);
-	swapl (&reply->numVisuals, n);
-	swapl (&reply->numSubpixel, n);
+	swaps(&reply->sequenceNumber);
+	swapl(&reply->length);
+	swapl(&reply->numFormats);
+	swapl(&reply->numScreens);
+	swapl(&reply->numDepths);
+	swapl(&reply->numVisuals);
+	swapl(&reply->numSubpixel);
     }
     WriteToClient(client, rlength, (char *) reply);
     free(reply);
@@ -538,7 +536,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
     PictFormatPtr   pFormat;
     int		    rc, num;
     int		    rlength;
-    int		    i, n;
+    int		    i;
     REQUEST(xRenderQueryPictIndexValuesReq);
     xRenderQueryPictIndexValuesReply *reply;
     xIndexValue	    *values;
@@ -575,15 +573,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
     {
 	for (i = 0; i < num; i++)
 	{
-	    swapl (&values[i].pixel, n);
-	    swaps (&values[i].red, n);
-	    swaps (&values[i].green, n);
-	    swaps (&values[i].blue, n);
-	    swaps (&values[i].alpha, n);
+	    swapl(&values[i].pixel);
+	    swaps(&values[i].red);
+	    swaps(&values[i].green);
+	    swaps(&values[i].blue);
+	    swaps(&values[i].alpha);
 	}
-	swaps (&reply->sequenceNumber, n);
-	swapl (&reply->length, n);
-	swapl (&reply->numIndexValues, n);
+	swaps(&reply->sequenceNumber);
+	swapl(&reply->length);
+	swapl(&reply->numIndexValues);
     }
 
     WriteToClient(client, rlength, (char *) reply);
@@ -1822,16 +1820,14 @@ ProcRenderQueryFilters (ClientPtr client)
 
     if (client->swapped)
     {
-	register int n;
-
 	for (i = 0; i < reply->numAliases; i++)
 	{
-	    swaps (&aliases[i], n);
+	    swaps(&aliases[i]);
 	}
-    	swaps(&reply->sequenceNumber, n);
-    	swapl(&reply->length, n);
-	swapl(&reply->numAliases, n);
-	swapl(&reply->numFilters, n);
+	swaps(&reply->sequenceNumber);
+	swapl(&reply->length);
+	swapl(&reply->numAliases);
+	swapl(&reply->numFilters);
     }
     WriteToClient(client, total_bytes, (char *) reply);
     free(reply);
@@ -2068,31 +2064,28 @@ ProcRenderDispatch (ClientPtr client)
 static int
 SProcRenderQueryVersion (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderQueryVersionReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->majorVersion, n);
-    swapl(&stuff->minorVersion, n);
+    swaps(&stuff->length);
+    swapl(&stuff->majorVersion);
+    swapl(&stuff->minorVersion);
     return (*ProcRenderVector[stuff->renderReqType])(client);
 }
 
 static int
 SProcRenderQueryPictFormats (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderQueryPictFormatsReq);
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderQueryPictIndexValues (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderQueryPictIndexValuesReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->format, n);
+    swaps(&stuff->length);
+    swapl(&stuff->format);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
@@ -2105,13 +2098,12 @@ SProcRenderQueryDithers (ClientPtr client)
 static int
 SProcRenderCreatePicture (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderCreatePictureReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->drawable, n);
-    swapl(&stuff->format, n);
-    swapl(&stuff->mask, n);
+    swaps(&stuff->length);
+    swapl(&stuff->pid);
+    swapl(&stuff->drawable);
+    swapl(&stuff->format);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2119,11 +2111,10 @@ SProcRenderCreatePicture (ClientPtr client)
 static int
 SProcRenderChangePicture (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderChangePictureReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
-    swapl(&stuff->mask, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
+    swapl(&stuff->mask);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2131,12 +2122,11 @@ SProcRenderChangePicture (ClientPtr client)
 static int
 SProcRenderSetPictureClipRectangles (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderSetPictureClipRectanglesReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
-    swaps(&stuff->xOrigin, n);
-    swaps(&stuff->yOrigin, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
+    swaps(&stuff->xOrigin);
+    swaps(&stuff->yOrigin);
     SwapRestS(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2144,65 +2134,61 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
 static int
 SProcRenderFreePicture (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderFreePictureReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderComposite (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderCompositeReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->src, n);
-    swapl(&stuff->mask, n);
-    swapl(&stuff->dst, n);
-    swaps(&stuff->xSrc, n);
-    swaps(&stuff->ySrc, n);
-    swaps(&stuff->xMask, n);
-    swaps(&stuff->yMask, n);
-    swaps(&stuff->xDst, n);
-    swaps(&stuff->yDst, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->mask);
+    swapl(&stuff->dst);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
+    swaps(&stuff->xMask);
+    swaps(&stuff->yMask);
+    swaps(&stuff->xDst);
+    swaps(&stuff->yDst);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderScale (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderScaleReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->src, n);
-    swapl(&stuff->dst, n);
-    swapl(&stuff->colorScale, n);
-    swapl(&stuff->alphaScale, n);
-    swaps(&stuff->xSrc, n);
-    swaps(&stuff->ySrc, n);
-    swaps(&stuff->xDst, n);
-    swaps(&stuff->yDst, n);
-    swaps(&stuff->width, n);
-    swaps(&stuff->height, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->colorScale);
+    swapl(&stuff->alphaScale);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
+    swaps(&stuff->xDst);
+    swaps(&stuff->yDst);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderTrapezoids (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderTrapezoidsReq);
 
     REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
-    swaps (&stuff->length, n);
-    swapl (&stuff->src, n);
-    swapl (&stuff->dst, n);
-    swapl (&stuff->maskFormat, n);
-    swaps (&stuff->xSrc, n);
-    swaps (&stuff->ySrc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->maskFormat);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2210,16 +2196,15 @@ SProcRenderTrapezoids (ClientPtr client)
 static int
 SProcRenderTriangles (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderTrianglesReq);
 
     REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
-    swaps (&stuff->length, n);
-    swapl (&stuff->src, n);
-    swapl (&stuff->dst, n);
-    swapl (&stuff->maskFormat, n);
-    swaps (&stuff->xSrc, n);
-    swaps (&stuff->ySrc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->maskFormat);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2227,16 +2212,15 @@ SProcRenderTriangles (ClientPtr client)
 static int
 SProcRenderTriStrip (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderTriStripReq);
 
     REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
-    swaps (&stuff->length, n);
-    swapl (&stuff->src, n);
-    swapl (&stuff->dst, n);
-    swapl (&stuff->maskFormat, n);
-    swaps (&stuff->xSrc, n);
-    swaps (&stuff->ySrc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->maskFormat);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2244,16 +2228,15 @@ SProcRenderTriStrip (ClientPtr client)
 static int
 SProcRenderTriFan (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderTriFanReq);
 
     REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
-    swaps (&stuff->length, n);
-    swapl (&stuff->src, n);
-    swapl (&stuff->dst, n);
-    swapl (&stuff->maskFormat, n);
-    swaps (&stuff->xSrc, n);
-    swaps (&stuff->ySrc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->maskFormat);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2279,47 +2262,43 @@ SProcRenderTransform (ClientPtr client)
 static int
 SProcRenderCreateGlyphSet (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderCreateGlyphSetReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->gsid, n);
-    swapl(&stuff->format, n);
+    swaps(&stuff->length);
+    swapl(&stuff->gsid);
+    swapl(&stuff->format);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderReferenceGlyphSet (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderReferenceGlyphSetReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->gsid, n);
-    swapl(&stuff->existing, n);
+    swaps(&stuff->length);
+    swapl(&stuff->gsid);
+    swapl(&stuff->existing);
     return (*ProcRenderVector[stuff->renderReqType])  (client);
 }
 
 static int
 SProcRenderFreeGlyphSet (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderFreeGlyphSetReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->glyphset, n);
+    swaps(&stuff->length);
+    swapl(&stuff->glyphset);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderAddGlyphs (ClientPtr client)
 {
-    register int n;
     register int i;
     CARD32  *gids;
     void    *end;
     xGlyphInfo *gi;
     REQUEST(xRenderAddGlyphsReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->glyphset, n);
-    swapl(&stuff->nglyphs, n);
+    swaps(&stuff->length);
+    swapl(&stuff->glyphset);
+    swapl(&stuff->nglyphs);
     if (stuff->nglyphs & 0xe0000000)
 	return BadLength;
     end = (CARD8 *) stuff + (client->req_len << 2);
@@ -2331,13 +2310,13 @@ SProcRenderAddGlyphs (ClientPtr client)
 	return BadLength;
     for (i = 0; i < stuff->nglyphs; i++)
     {
-	swapl (&gids[i], n);
-	swaps (&gi[i].width, n);
-	swaps (&gi[i].height, n);
-	swaps (&gi[i].x, n);
-	swaps (&gi[i].y, n);
-	swaps (&gi[i].xOff, n);
-	swaps (&gi[i].yOff, n);
+	swapl(&gids[i]);
+	swaps(&gi[i].width);
+	swaps(&gi[i].height);
+	swaps(&gi[i].x);
+	swaps(&gi[i].y);
+	swaps(&gi[i].xOff);
+	swaps(&gi[i].yOff);
     }
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2351,10 +2330,9 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client)
 static int
 SProcRenderFreeGlyphs (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderFreeGlyphsReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->glyphset, n);
+    swaps(&stuff->length);
+    swapl(&stuff->glyphset);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2362,7 +2340,6 @@ SProcRenderFreeGlyphs (ClientPtr client)
 static int
 SProcRenderCompositeGlyphs (ClientPtr client)
 {
-    register int n;
     xGlyphElt	*elt;
     CARD8	*buffer;
     CARD8	*end;
@@ -2378,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
     case X_RenderCompositeGlyphs32: size = 4; break;
     }
 	    
-    swaps(&stuff->length, n);
-    swapl(&stuff->src, n);
-    swapl(&stuff->dst, n);
-    swapl(&stuff->maskFormat, n);
-    swapl(&stuff->glyphset, n);
-    swaps(&stuff->xSrc, n);
-    swaps(&stuff->ySrc, n);
+    swaps(&stuff->length);
+    swapl(&stuff->src);
+    swapl(&stuff->dst);
+    swapl(&stuff->maskFormat);
+    swapl(&stuff->glyphset);
+    swaps(&stuff->xSrc);
+    swaps(&stuff->ySrc);
     buffer = (CARD8 *) (stuff + 1);
     end = (CARD8 *) stuff + (client->req_len << 2);
     while (buffer + sizeof (xGlyphElt) < end)
@@ -2392,13 +2369,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
 	elt = (xGlyphElt *) buffer;
 	buffer += sizeof (xGlyphElt);
 	
-	swaps (&elt->deltax, n);
-	swaps (&elt->deltay, n);
+	swaps(&elt->deltax);
+	swaps(&elt->deltay);
 	
 	i = elt->len;
 	if (i == 0xff)
 	{
-	    swapl (buffer, n);
+	    swapl(buffer);
 	    buffer += 4;
 	}
 	else
@@ -2411,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client)
 	    case 2:
 		while (i--)
 		{
-		    swaps (buffer, n);
+		    swaps(buffer);
 		    buffer += 2;
 		}
 		break;
 	    case 4:
 		while (i--)
 		{
-		    swapl (buffer, n);
+		    swapl(buffer);
 		    buffer += 4;
 		}
 		break;
@@ -2433,16 +2410,15 @@ SProcRenderCompositeGlyphs (ClientPtr client)
 static int
 SProcRenderFillRectangles (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderFillRectanglesReq);
 
     REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
-    swaps(&stuff->length, n);
-    swapl(&stuff->dst, n);
-    swaps(&stuff->color.red, n);
-    swaps(&stuff->color.green, n);
-    swaps(&stuff->color.blue, n);
-    swaps(&stuff->color.alpha, n);
+    swaps(&stuff->length);
+    swapl(&stuff->dst);
+    swaps(&stuff->color.red);
+    swaps(&stuff->color.green);
+    swaps(&stuff->color.blue);
+    swaps(&stuff->color.alpha);
     SwapRestS(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2450,73 +2426,68 @@ SProcRenderFillRectangles (ClientPtr client)
 static int
 SProcRenderCreateCursor (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderCreateCursorReq);
     REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
     
-    swaps(&stuff->length, n);
-    swapl(&stuff->cid, n);
-    swapl(&stuff->src, n);
-    swaps(&stuff->x, n);
-    swaps(&stuff->y, n);
+    swaps(&stuff->length);
+    swapl(&stuff->cid);
+    swapl(&stuff->src);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
     
 static int
 SProcRenderSetPictureTransform (ClientPtr client)
 {
-    register int n;
     REQUEST(xRenderSetPictureTransformReq);
     REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
-    swapl(&stuff->transform.matrix11, n);
-    swapl(&stuff->transform.matrix12, n);
-    swapl(&stuff->transform.matrix13, n);
-    swapl(&stuff->transform.matrix21, n);
-    swapl(&stuff->transform.matrix22, n);
-    swapl(&stuff->transform.matrix23, n);
-    swapl(&stuff->transform.matrix31, n);
-    swapl(&stuff->transform.matrix32, n);
-    swapl(&stuff->transform.matrix33, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
+    swapl(&stuff->transform.matrix11);
+    swapl(&stuff->transform.matrix12);
+    swapl(&stuff->transform.matrix13);
+    swapl(&stuff->transform.matrix21);
+    swapl(&stuff->transform.matrix22);
+    swapl(&stuff->transform.matrix23);
+    swapl(&stuff->transform.matrix31);
+    swapl(&stuff->transform.matrix32);
+    swapl(&stuff->transform.matrix33);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static int
 SProcRenderQueryFilters (ClientPtr client)
 {
-    register int n;
     REQUEST (xRenderQueryFiltersReq);
     REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->drawable, n);
+    swaps(&stuff->length);
+    swapl(&stuff->drawable);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
     
 static int
 SProcRenderSetPictureFilter (ClientPtr client)
 {
-    register int n;
     REQUEST (xRenderSetPictureFilterReq);
     REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
-    swaps(&stuff->nbytes, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
+    swaps(&stuff->nbytes);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
     
 static int
 SProcRenderCreateAnimCursor (ClientPtr client)
 {
-    register int n;
     REQUEST (xRenderCreateAnimCursorReq);
     REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->cid, n);
+    swaps(&stuff->length);
+    swapl(&stuff->cid);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2524,14 +2495,13 @@ SProcRenderCreateAnimCursor (ClientPtr client)
 static int
 SProcRenderAddTraps (ClientPtr client)
 {
-    register int n;
     REQUEST (xRenderAddTrapsReq);
     REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->picture, n);
-    swaps(&stuff->xOff, n);
-    swaps(&stuff->yOff, n);
+    swaps(&stuff->length);
+    swapl(&stuff->picture);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
     SwapRestL(stuff);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
@@ -2539,32 +2509,31 @@ SProcRenderAddTraps (ClientPtr client)
 static int
 SProcRenderCreateSolidFill(ClientPtr client)
 {
-    register int n;
     REQUEST (xRenderCreateSolidFillReq);
     REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->pid, n);
-    swaps(&stuff->color.alpha, n);
-    swaps(&stuff->color.red, n);
-    swaps(&stuff->color.green, n);
-    swaps(&stuff->color.blue, n);
+    swaps(&stuff->length);
+    swapl(&stuff->pid);
+    swaps(&stuff->color.alpha);
+    swaps(&stuff->color.red);
+    swaps(&stuff->color.green);
+    swaps(&stuff->color.blue);
     return (*ProcRenderVector[stuff->renderReqType]) (client);
 }
 
 static void swapStops(void *stuff, int num)
 {
-    int i, n;
+    int i;
     CARD32 *stops;
     CARD16 *colors;
     stops = (CARD32 *)(stuff);
     for (i = 0; i < num; ++i) {
-        swapl(stops, n);
+        swapl(stops);
         ++stops;
     }
     colors = (CARD16 *)(stops);
     for (i = 0; i < 4*num; ++i) {
-        swaps(colors, n);
+        swaps(colors);
         ++colors;
     }
 }
@@ -2572,18 +2541,17 @@ static void swapStops(void *stuff, int num)
 static int
 SProcRenderCreateLinearGradient (ClientPtr client)
 {
-    register int n;
     int len;
     REQUEST (xRenderCreateLinearGradientReq);
     REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->p1.x, n);
-    swapl(&stuff->p1.y, n);
-    swapl(&stuff->p2.x, n);
-    swapl(&stuff->p2.y, n);
-    swapl(&stuff->nStops, n);
+    swaps(&stuff->length);
+    swapl(&stuff->pid);
+    swapl(&stuff->p1.x);
+    swapl(&stuff->p1.y);
+    swapl(&stuff->p2.x);
+    swapl(&stuff->p2.y);
+    swapl(&stuff->nStops);
 
     len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
     if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
@@ -2599,20 +2567,19 @@ SProcRenderCreateLinearGradient (ClientPtr client)
 static int
 SProcRenderCreateRadialGradient (ClientPtr client)
 {
-    register int n;
     int len;
     REQUEST (xRenderCreateRadialGradientReq);
     REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->inner.x, n);
-    swapl(&stuff->inner.y, n);
-    swapl(&stuff->outer.x, n);
-    swapl(&stuff->outer.y, n);
-    swapl(&stuff->inner_radius, n);
-    swapl(&stuff->outer_radius, n);
-    swapl(&stuff->nStops, n);
+    swaps(&stuff->length);
+    swapl(&stuff->pid);
+    swapl(&stuff->inner.x);
+    swapl(&stuff->inner.y);
+    swapl(&stuff->outer.x);
+    swapl(&stuff->outer.y);
+    swapl(&stuff->inner_radius);
+    swapl(&stuff->outer_radius);
+    swapl(&stuff->nStops);
 
     len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
     if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
@@ -2628,17 +2595,16 @@ SProcRenderCreateRadialGradient (ClientPtr client)
 static int
 SProcRenderCreateConicalGradient (ClientPtr client)
 {
-    register int n;
     int len;
     REQUEST (xRenderCreateConicalGradientReq);
     REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->pid, n);
-    swapl(&stuff->center.x, n);
-    swapl(&stuff->center.y, n);
-    swapl(&stuff->angle, n);
-    swapl(&stuff->nStops, n);
+    swaps(&stuff->length);
+    swapl(&stuff->pid);
+    swapl(&stuff->center.x);
+    swapl(&stuff->center.y);
+    swapl(&stuff->angle);
+    swapl(&stuff->nStops);
 
     len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
     if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index 6e61d74..6ec94be 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -44,15 +44,13 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
 
     if (swap)
     {
-        char n;
-
-        swaps(&out->sequenceNumber, n);
-        swapl(&out->length, n);
-        swaps(&out->evtype, n);
-        swaps(&out->deviceid, n);
-        swapl(&out->time, n);
-        swapl(&out->detail, n);
-        swaps(&out->valuators_len, n);
+        swaps(&out->sequenceNumber);
+        swapl(&out->length);
+        swaps(&out->evtype);
+        swaps(&out->deviceid);
+        swapl(&out->time);
+        swapl(&out->detail);
+        swaps(&out->valuators_len);
     }
 
 
@@ -101,9 +99,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
             vo.frac = value->frac;
             if (swap)
             {
-                char n;
-                swapl(&vo.integral, n);
-                swapl(&vo.frac, n);
+                swapl(&vo.integral);
+                swapl(&vo.frac);
             }
 
             assert(vi.integral == vo.integral);
@@ -118,9 +115,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
             vo.frac = raw_value->frac;
             if (swap)
             {
-                char n;
-                swapl(&vo.integral, n);
-                swapl(&vo.frac, n);
+                swapl(&vo.integral);
+                swapl(&vo.frac);
             }
 
             assert(vi.integral == vo.integral);
@@ -276,29 +272,27 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
     FP3232 *values;
 
     if (swap) {
-        char n;
-
-        swaps(&out->sequenceNumber, n);
-        swapl(&out->length, n);
-        swaps(&out->evtype, n);
-        swaps(&out->deviceid, n);
-        swaps(&out->sourceid, n);
-        swapl(&out->time, n);
-        swapl(&out->detail, n);
-        swapl(&out->root, n);
-        swapl(&out->event, n);
-        swapl(&out->child, n);
-        swapl(&out->root_x, n);
-        swapl(&out->root_y, n);
-        swapl(&out->event_x, n);
-        swapl(&out->event_y, n);
-        swaps(&out->buttons_len, n);
-        swaps(&out->valuators_len, n);
-        swapl(&out->mods.base_mods, n);
-        swapl(&out->mods.latched_mods, n);
-        swapl(&out->mods.locked_mods, n);
-        swapl(&out->mods.effective_mods, n);
-        swapl(&out->flags, n);
+        swaps(&out->sequenceNumber);
+        swapl(&out->length);
+        swaps(&out->evtype);
+        swaps(&out->deviceid);
+        swaps(&out->sourceid);
+        swapl(&out->time);
+        swapl(&out->detail);
+        swapl(&out->root);
+        swapl(&out->event);
+        swapl(&out->child);
+        swapl(&out->root_x);
+        swapl(&out->root_y);
+        swapl(&out->event_x);
+        swapl(&out->event_y);
+        swaps(&out->buttons_len);
+        swaps(&out->valuators_len);
+        swapl(&out->mods.base_mods);
+        swapl(&out->mods.latched_mods);
+        swapl(&out->mods.locked_mods);
+        swapl(&out->mods.effective_mods);
+        swapl(&out->flags);
     }
 
     assert(out->extension == 0); /* IReqCode defaults to 0 */
@@ -388,9 +382,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
 
                 if (swap)
                 {
-                    char n;
-                    swapl(&vo.integral, n);
-                    swapl(&vo.frac, n);
+                    swapl(&vo.integral);
+                    swapl(&vo.frac);
                 }
 
 
@@ -647,15 +640,13 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
 
     if (swap)
     {
-        char n;
-
-        swaps(&out->sequenceNumber, n);
-        swapl(&out->length, n);
-        swaps(&out->evtype, n);
-        swaps(&out->deviceid, n);
-        swaps(&out->sourceid, n);
-        swapl(&out->time, n);
-        swaps(&out->num_classes, n);
+        swaps(&out->sequenceNumber);
+        swapl(&out->length);
+        swaps(&out->evtype);
+        swaps(&out->deviceid);
+        swaps(&out->sourceid);
+        swapl(&out->time);
+        swaps(&out->num_classes);
     }
 
     assert(out->type == GenericEvent);
@@ -672,10 +663,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
 
         if (swap)
         {
-            char n;
-            swaps(&any->length, n);
-            swaps(&any->type, n);
-            swaps(&any->sourceid, n);
+            swaps(&any->length);
+            swaps(&any->type);
+            swaps(&any->sourceid);
         }
 
         switch(any->type)
@@ -687,8 +677,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
 
                     if (swap)
                     {
-                        char n;
-                        swaps(&b->num_buttons, n);
+                        swaps(&b->num_buttons);
                     }
 
                     assert(b->length ==
@@ -703,8 +692,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
                     {
                         if (swap)
                         {
-                            char n;
-                            swapl(&names[j], n);
+                            swapl(&names[j]);
                         }
                         assert(names[j] == in->buttons.names[j]);
                     }
@@ -717,8 +705,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
 
                     if (swap)
                     {
-                        char n;
-                        swaps(&k->num_keycodes, n);
+                        swaps(&k->num_keycodes);
                     }
 
                     assert(k->length ==
@@ -732,8 +719,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
                     {
                         if (swap)
                         {
-                            char n;
-                            swapl(&kc[j], n);
+                            swapl(&kc[j]);
                         }
                         assert(kc[j] >= in->keys.min_keycode);
                         assert(kc[j] <= in->keys.max_keycode);
diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c
index 5e45e7b..aec5890 100644
--- a/test/xi2/protocol-xigetclientpointer.c
+++ b/test/xi2/protocol-xigetclientpointer.c
@@ -70,10 +70,9 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
 
     if (client->swapped)
     {
-        char n;
-        swapl(&rep->length, n);
-        swaps(&rep->sequenceNumber, n);
-        swaps(&rep->deviceid, n);
+        swapl(&rep->length);
+        swaps(&rep->sequenceNumber);
+        swaps(&rep->deviceid);
     }
 
     reply_check_defaults(rep, len, XIGetClientPointer);
@@ -85,7 +84,6 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
 
 static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error)
 {
-    char n;
     int rc;
 
     test_data.win = req->win;
@@ -97,8 +95,8 @@ static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq*
         assert(client_request.errorValue == req->win);
 
     client_request.swapped = TRUE;
-    swapl(&req->win, n);
-    swaps(&req->length, n);
+    swapl(&req->win);
+    swaps(&req->length);
     rc = SProcXIGetClientPointer(&client_request);
     assert(rc == error);
 
diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c
index 55de773..a78fb26 100644
--- a/test/xi2/protocol-xigetselectedevents.c
+++ b/test/xi2/protocol-xigetselectedevents.c
@@ -91,10 +91,9 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, voi
 
     if (client->swapped)
     {
-        char n;
-        swapl(&rep->length, n);
-        swaps(&rep->sequenceNumber, n);
-        swaps(&rep->num_masks, n);
+        swapl(&rep->length);
+        swaps(&rep->sequenceNumber);
+        swaps(&rep->num_masks);
     }
 
     reply_check_defaults(rep, len, XIGetSelectedEvents);
@@ -115,9 +114,8 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
     {
         if (client->swapped)
         {
-            char n;
-            swaps(&mask->deviceid, n);
-            swaps(&mask->mask_len, n);
+            swaps(&mask->deviceid);
+            swaps(&mask->mask_len);
         }
 
         assert(mask->deviceid < 6);
@@ -136,7 +134,6 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
 
 static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
 {
-    char n;
     int rc;
     ClientRec client;
     client = init_client(req->length, req);
@@ -148,8 +145,8 @@ static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
 
     reply_handler = reply_XIGetSelectedEvents;
     client.swapped = TRUE;
-    swapl(&req->win, n);
-    swaps(&req->length, n);
+    swapl(&req->win);
+    swaps(&req->length);
     rc = SProcXIGetSelectedEvents(&client);
     assert(rc == error);
 }
diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c
index a61c154..1ffcdee 100644
--- a/test/xi2/protocol-xipassivegrabdevice.c
+++ b/test/xi2/protocol-xipassivegrabdevice.c
@@ -85,10 +85,9 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
 
     if (client->swapped)
     {
-        char n;
-        swaps(&rep->sequenceNumber, n);
-        swapl(&rep->length, n);
-        swaps(&rep->num_modifiers, n);
+        swaps(&rep->sequenceNumber);
+        swapl(&rep->length);
+        swaps(&rep->num_modifiers);
 
         testdata.num_modifiers = rep->num_modifiers;
     }
@@ -104,14 +103,13 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
 static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata)
 {
     int i;
-    int n;
 
     xXIGrabModifierInfo *mods = (xXIGrabModifierInfo*)data;
 
     for (i = 0; i < testdata.num_modifiers; i++, mods++)
     {
         if (client->swapped)
-            swapl(&mods->modifiers, n);
+            swapl(&mods->modifiers);
 
         /* 1 - 7 is the range we use for the global modifiers array
          * above */
@@ -128,7 +126,6 @@ static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data
 
 static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq* req, int error, int errval)
 {
-    char n;
     int rc;
     int modifiers;
 
@@ -139,20 +136,20 @@ static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceRe
         assert(client_request.errorValue == errval);
 
     client_request.swapped = TRUE;
-    swaps(&req->length, n);
-    swapl(&req->time, n);
-    swapl(&req->grab_window, n);
-    swapl(&req->cursor, n);
-    swapl(&req->detail, n);
-    swaps(&req->deviceid, n);
+    swaps(&req->length);
+    swapl(&req->time);
+    swapl(&req->grab_window);
+    swapl(&req->cursor);
+    swapl(&req->detail);
+    swaps(&req->deviceid);
     modifiers = req->num_modifiers;
-    swaps(&req->num_modifiers, n);
-    swaps(&req->mask_len, n);
+    swaps(&req->num_modifiers);
+    swaps(&req->mask_len);
 
     while(modifiers--)
     {
         CARD32 *mod = ((CARD32*)(req + 1)) + modifiers;
-        swapl(mod, n);
+        swapl(mod);
     }
 
     rc = SProcXIPassiveGrabDevice(&client_request);
diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c
index cb1cc81..47eb5b1 100644
--- a/test/xi2/protocol-xiquerydevice.c
+++ b/test/xi2/protocol-xiquerydevice.c
@@ -64,10 +64,9 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use
 
     if (client->swapped)
     {
-        char n;
-        swapl(&rep->length, n);
-        swaps(&rep->sequenceNumber, n);
-        swaps(&rep->num_devices, n);
+        swapl(&rep->length);
+        swaps(&rep->sequenceNumber);
+        swaps(&rep->num_devices);
     }
 
     reply_check_defaults(rep, len, XIQueryDevice);
@@ -86,7 +85,6 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use
 /* reply handling for the trailing bytes that constitute the device info */
 static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
 {
-    char n;
     int i, j;
     struct test_data *querydata = (struct test_data*)userdata;
 
@@ -98,11 +96,11 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
     {
         if (client->swapped)
         {
-            swaps(&info->deviceid, n);
-            swaps(&info->attachment, n);
-            swaps(&info->use, n);
-            swaps(&info->num_classes, n);
-            swaps(&info->name_len, n);
+            swaps(&info->deviceid);
+            swaps(&info->attachment);
+            swaps(&info->use);
+            swaps(&info->num_classes);
+            swaps(&info->name_len);
         }
 
         if (querydata->which_device > XIAllMasterDevices)
@@ -152,9 +150,9 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
         {
             if (client->swapped)
             {
-                swaps(&any->type, n);
-                swaps(&any->length, n);
-                swaps(&any->sourceid, n);
+                swaps(&any->type);
+                swaps(&any->length);
+                swaps(&any->sourceid);
             }
 
             switch(info->deviceid)
@@ -168,7 +166,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
                         uint32_t *kc;
 
                         if (client->swapped)
-                            swaps(&ki->num_keycodes, n);
+                            swaps(&ki->num_keycodes);
 
                         assert(any->type == XIKeyClass);
                         assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1));
@@ -178,7 +176,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
                         for (k = 0; k < ki->num_keycodes; k++, kc++)
                         {
                             if (client->swapped)
-                                swapl(kc, n);
+                                swapl(kc);
 
                             assert(*kc >= xkb->min_key_code);
                             assert(*kc <= xkb->max_key_code);
@@ -197,7 +195,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
                             xXIButtonInfo *bi = (xXIButtonInfo*)any;
 
                             if (client->swapped)
-                                swaps(&bi->num_buttons, n);
+                                swaps(&bi->num_buttons);
 
                             assert(bi->num_buttons == devices.vcp->button->numButtons);
 
@@ -209,13 +207,13 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
 
                             if (client->swapped)
                             {
-                                swaps(&vi->number, n);
-                                swapl(&vi->label, n);
-                                swapl(&vi->min.integral, n);
-                                swapl(&vi->min.frac, n);
-                                swapl(&vi->max.integral, n);
-                                swapl(&vi->max.frac, n);
-                                swapl(&vi->resolution, n);
+                                swaps(&vi->number);
+                                swapl(&vi->label);
+                                swapl(&vi->min.integral);
+                                swapl(&vi->min.frac);
+                                swapl(&vi->max.integral);
+                                swapl(&vi->max.frac);
+                                swapl(&vi->resolution);
                             }
 
                             assert(vi->length == 11);
@@ -244,7 +242,6 @@ static void request_XIQueryDevice(struct test_data *querydata,
                                  int deviceid, int error)
 {
     int rc;
-    char n;
     ClientRec client;
     xXIQueryDeviceReq request;
 
@@ -264,8 +261,8 @@ static void request_XIQueryDevice(struct test_data *querydata,
     reply_handler = reply_XIQueryDevice;
 
     client.swapped = TRUE;
-    swaps(&request.length, n);
-    swaps(&request.deviceid, n);
+    swaps(&request.length);
+    swaps(&request.deviceid);
     rc = SProcXIQueryDevice(&client);
     assert(rc == error);
 
diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c
index 0985ec7..65346ab 100644
--- a/test/xi2/protocol-xiquerypointer.c
+++ b/test/xi2/protocol-xiquerypointer.c
@@ -81,16 +81,15 @@ static void reply_XIQueryPointer(ClientPtr client, int len, char *data,
 
     if (client->swapped)
     {
-        char n;
-        swapl(&rep->length, n);
-        swaps(&rep->sequenceNumber, n);
-        swapl(&rep->root, n);
-        swapl(&rep->child, n);
-        swapl(&rep->root_x, n);
-        swapl(&rep->root_y, n);
-        swapl(&rep->win_x, n);
-        swapl(&rep->win_y, n);
-        swaps(&rep->buttons_len, n);
+        swapl(&rep->length);
+        swaps(&rep->sequenceNumber);
+        swapl(&rep->root);
+        swapl(&rep->child);
+        swapl(&rep->root_x);
+        swapl(&rep->root_y);
+        swapl(&rep->win_x);
+        swapl(&rep->win_y);
+        swaps(&rep->buttons_len);
     }
 
     reply_check_defaults(rep, len, XIQueryPointer);
@@ -132,7 +131,6 @@ static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, voi
 
 static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, int error)
 {
-    char n;
     int rc;
 
     rc = ProcXIQueryPointer(&client_request);
@@ -142,8 +140,8 @@ static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, in
         assert(client_request.errorValue == req->deviceid);
 
     client_request.swapped = TRUE;
-    swaps(&req->deviceid, n);
-    swaps(&req->length, n);
+    swaps(&req->deviceid);
+    swaps(&req->length);
     rc = SProcXIQueryPointer(&client_request);
     assert(rc == error);
 
diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index 3bb356e..d60d16b 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -64,11 +64,10 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us
 
     if (client->swapped)
     {
-        char n;
-        swapl(&rep->length, n);
-        swaps(&rep->sequenceNumber, n);
-        swaps(&rep->major_version, n);
-        swaps(&rep->minor_version, n);
+        swapl(&rep->length);
+        swaps(&rep->sequenceNumber);
+        swaps(&rep->major_version);
+        swaps(&rep->minor_version);
     }
 
     reply_check_defaults(rep, len, XIQueryVersion);
@@ -91,7 +90,6 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us
  */
 static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error)
 {
-    char n;
     int rc;
     struct test_data versions;
     xXIQueryVersionReq request;
@@ -118,9 +116,9 @@ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int e
 
     client.swapped = TRUE;
 
-    swaps(&request.length, n);
-    swaps(&request.major_version, n);
-    swaps(&request.minor_version, n);
+    swaps(&request.length);
+    swaps(&request.major_version);
+    swaps(&request.minor_version);
 
     rc = SProcXIQueryVersion(&client);
     assert(rc == error);
diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c
index fa422e2..4eaf839 100644
--- a/test/xi2/protocol-xiselectevents.c
+++ b/test/xi2/protocol-xiselectevents.c
@@ -89,7 +89,6 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access
 
 static void request_XISelectEvent(xXISelectEventsReq *req, int error)
 {
-    char n;
     int i;
     int rc;
     ClientRec client;
@@ -114,14 +113,14 @@ static void request_XISelectEvent(xXISelectEventsReq *req, int error)
     for (i = 0; i < req->num_masks; i++)
     {
         next = (xXIEventMask*)((char*)&mask[1] + mask->mask_len * 4);
-        swaps(&mask->deviceid, n);
-        swaps(&mask->mask_len, n);
+        swaps(&mask->deviceid);
+        swaps(&mask->mask_len);
         mask = next;
     }
 
-    swapl(&req->win, n);
-    swaps(&req->length, n);
-    swaps(&req->num_masks, n);
+    swapl(&req->win);
+    swaps(&req->length);
+    swaps(&req->num_masks);
     rc = SProcXISelectEvents(&client);
     assert(rc == error);
 }
diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c
index c266b65..d9620e3 100644
--- a/test/xi2/protocol-xisetclientpointer.c
+++ b/test/xi2/protocol-xisetclientpointer.c
@@ -66,7 +66,6 @@ int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask a
 
 static void request_XISetClientPointer(xXISetClientPointerReq* req, int error)
 {
-    char n;
     int rc;
     client_request = init_client(req->length, req);
 
@@ -77,9 +76,9 @@ static void request_XISetClientPointer(xXISetClientPointerReq* req, int error)
         assert(client_request.errorValue == req->deviceid);
 
     client_request.swapped = TRUE;
-    swapl(&req->win, n);
-    swaps(&req->length, n);
-    swaps(&req->deviceid, n);
+    swapl(&req->win);
+    swaps(&req->length);
+    swaps(&req->deviceid);
     rc = SProcXISetClientPointer(&client_request);
     assert(rc == error);
 
diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c
index 0c8db45..2b40f63 100644
--- a/test/xi2/protocol-xiwarppointer.c
+++ b/test/xi2/protocol-xiwarppointer.c
@@ -78,7 +78,6 @@ static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen,
 static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req,
         int error)
 {
-    char n;
     int rc;
 
     rc = ProcXIWarpPointer(client);
@@ -93,15 +92,15 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req,
 
     client->swapped = TRUE;
 
-    swapl(&req->src_win, n);
-    swapl(&req->dst_win, n);
-    swapl(&req->src_x, n);
-    swapl(&req->src_y, n);
-    swapl(&req->dst_x, n);
-    swapl(&req->dst_y, n);
-    swaps(&req->src_width, n);
-    swaps(&req->src_height, n);
-    swaps(&req->deviceid, n);
+    swapl(&req->src_win);
+    swapl(&req->dst_win);
+    swapl(&req->src_x);
+    swapl(&req->src_y);
+    swapl(&req->dst_x);
+    swapl(&req->dst_y);
+    swaps(&req->src_width);
+    swaps(&req->src_height);
+    swaps(&req->deviceid);
 
     rc = SProcXIWarpPointer(client);
     assert(rc == error);
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index ecbed40..2950e45 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -309,12 +309,11 @@ GetBit (unsigned char *line, int x)
 int
 SProcXFixesSelectCursorInput (ClientPtr client)
 {
-    register int n;
     REQUEST(xXFixesSelectCursorInputReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
-    swapl(&stuff->eventMask, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    swapl(&stuff->eventMask);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
     
@@ -418,16 +417,15 @@ ProcXFixesGetCursorImage (ClientPtr client)
     CopyCursorToImage (pCursor, image);
     if (client->swapped)
     {
-	int n;
-	swaps (&rep->sequenceNumber, n);
-	swapl (&rep->length, n);
-	swaps (&rep->x, n);
-	swaps (&rep->y, n);
-	swaps (&rep->width, n);
-	swaps (&rep->height, n);
-	swaps (&rep->xhot, n);
-	swaps (&rep->yhot, n);
-	swapl (&rep->cursorSerial, n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swaps(&rep->x);
+	swaps(&rep->y);
+	swaps(&rep->width);
+	swaps(&rep->height);
+	swaps(&rep->xhot);
+	swaps(&rep->yhot);
+	swapl(&rep->cursorSerial);
 	SwapLongs (image, npixels);
     }
     WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
@@ -439,9 +437,8 @@ ProcXFixesGetCursorImage (ClientPtr client)
 int
 SProcXFixesGetCursorImage (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesGetCursorImageReq);
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -467,13 +464,12 @@ ProcXFixesSetCursorName (ClientPtr client)
 int
 SProcXFixesSetCursorName (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesSetCursorNameReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
-    swapl (&stuff->cursor, n);
-    swaps (&stuff->nbytes, n);
+    swapl(&stuff->cursor);
+    swaps(&stuff->nbytes);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -501,11 +497,10 @@ ProcXFixesGetCursorName (ClientPtr client)
     reply.nbytes = len;
     if (client->swapped)
     {
-	int n;
-	swaps (&reply.sequenceNumber, n);
-	swapl (&reply.length, n);
-	swapl (&reply.atom, n);
-	swaps (&reply.nbytes, n);
+	swaps(&reply.sequenceNumber);
+	swapl(&reply.length);
+	swapl(&reply.atom);
+	swaps(&reply.nbytes);
     }
     WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
     WriteToClient(client, len, str);
@@ -516,12 +511,11 @@ ProcXFixesGetCursorName (ClientPtr client)
 int
 SProcXFixesGetCursorName (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesGetCursorNameReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
-    swapl (&stuff->cursor, n);
+    swapl(&stuff->cursor);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -576,18 +570,17 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
     memcpy ((image + npixels), name, nbytes);
     if (client->swapped)
     {
-	int n;
-	swaps (&rep->sequenceNumber, n);
-	swapl (&rep->length, n);
-	swaps (&rep->x, n);
-	swaps (&rep->y, n);
-	swaps (&rep->width, n);
-	swaps (&rep->height, n);
-	swaps (&rep->xhot, n);
-	swaps (&rep->yhot, n);
-	swapl (&rep->cursorSerial, n);
-	swapl (&rep->cursorName, n);
-	swaps (&rep->nbytes, n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swaps(&rep->x);
+	swaps(&rep->y);
+	swaps(&rep->width);
+	swaps(&rep->height);
+	swaps(&rep->xhot);
+	swaps(&rep->yhot);
+	swapl(&rep->cursorSerial);
+	swapl(&rep->cursorName);
+	swaps(&rep->nbytes);
 	SwapLongs (image, npixels);
     }
     WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
@@ -599,9 +592,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
 int
 SProcXFixesGetCursorImageAndName (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesGetCursorImageAndNameReq);
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -734,13 +726,12 @@ ProcXFixesChangeCursor (ClientPtr client)
 int
 SProcXFixesChangeCursor (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesChangeCursorReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
-    swapl (&stuff->source, n);
-    swapl (&stuff->destination, n);
+    swapl(&stuff->source);
+    swapl(&stuff->destination);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -772,13 +763,12 @@ ProcXFixesChangeCursorByName (ClientPtr client)
 int
 SProcXFixesChangeCursorByName (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesChangeCursorByNameReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq);
-    swapl (&stuff->source, n);
-    swaps (&stuff->nbytes, n);
+    swapl(&stuff->source);
+    swaps(&stuff->nbytes);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -933,12 +923,11 @@ ProcXFixesHideCursor (ClientPtr client)
 int 
 SProcXFixesHideCursor (ClientPtr client) 
 {
-    int n;
     REQUEST(xXFixesHideCursorReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesHideCursorReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -984,12 +973,11 @@ ProcXFixesShowCursor (ClientPtr client)
 int 
 SProcXFixesShowCursor (ClientPtr client) 
 {
-    int n;
     REQUEST(xXFixesShowCursorReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesShowCursorReq);
-    swapl (&stuff->window, n);
+    swapl(&stuff->window);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -1350,18 +1338,17 @@ ProcXFixesCreatePointerBarrier (ClientPtr client)
 int
 SProcXFixesCreatePointerBarrier (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesCreatePointerBarrierReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
-    swapl(&stuff->barrier, n);
-    swapl(&stuff->window, n);
-    swaps(&stuff->x1, n);
-    swaps(&stuff->y1, n);
-    swaps(&stuff->x2, n);
-    swaps(&stuff->y2, n);
-    swapl(&stuff->directions, n);
+    swapl(&stuff->barrier);
+    swapl(&stuff->window);
+    swaps(&stuff->x1);
+    swaps(&stuff->y1);
+    swaps(&stuff->x2);
+    swaps(&stuff->y2);
+    swapl(&stuff->directions);
     return ProcXFixesVector[stuff->xfixesReqType](client);
 }
 
@@ -1412,12 +1399,11 @@ ProcXFixesDestroyPointerBarrier (ClientPtr client)
 int
 SProcXFixesDestroyPointerBarrier (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesDestroyPointerBarrierReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
-    swapl(&stuff->barrier, n);
+    swapl(&stuff->barrier);
     return ProcXFixesVector[stuff->xfixesReqType](client);
 }
 
diff --git a/xfixes/region.c b/xfixes/region.c
index be2d391..4c22637 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -93,12 +93,11 @@ ProcXFixesCreateRegion (ClientPtr client)
 int
 SProcXFixesCreateRegion (ClientPtr client)
 {
-    register int n;
     REQUEST(xXFixesCreateRegionReq);
     
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
-    swapl(&stuff->region, n);
+    swapl(&stuff->region);
     SwapRestS(stuff);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
@@ -138,13 +137,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
 int
 SProcXFixesCreateRegionFromBitmap (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCreateRegionFromBitmapReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq);
-    swapl(&stuff->region, n);
-    swapl(&stuff->bitmap, n);
+    swapl(&stuff->region);
+    swapl(&stuff->bitmap);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -200,13 +198,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
 int
 SProcXFixesCreateRegionFromWindow (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCreateRegionFromWindowReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq);
-    swapl(&stuff->region, n);
-    swapl(&stuff->window, n);
+    swapl(&stuff->region);
+    swapl(&stuff->window);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -250,13 +247,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
 int
 SProcXFixesCreateRegionFromGC (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCreateRegionFromGCReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq);
-    swapl(&stuff->region, n);
-    swapl(&stuff->gc, n);
+    swapl(&stuff->region);
+    swapl(&stuff->gc);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -297,13 +293,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
 int
 SProcXFixesCreateRegionFromPicture (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCreateRegionFromPictureReq);
 
-    swaps(&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq);
-    swapl(&stuff->region, n);
-    swapl(&stuff->picture, n);
+    swapl(&stuff->region);
+    swapl(&stuff->picture);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -322,12 +317,11 @@ ProcXFixesDestroyRegion (ClientPtr client)
 int
 SProcXFixesDestroyRegion (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesDestroyRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
-    swapl (&stuff->region, n);
+    swapl(&stuff->region);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -361,12 +355,11 @@ ProcXFixesSetRegion (ClientPtr client)
 int
 SProcXFixesSetRegion (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesSetRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
-    swapl (&stuff->region, n);
+    swapl(&stuff->region);
     SwapRestS(stuff);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
@@ -389,13 +382,12 @@ ProcXFixesCopyRegion (ClientPtr client)
 int
 SProcXFixesCopyRegion (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCopyRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq);
-    swapl (&stuff->source, n);
-    swapl (&stuff->destination, n);
+    swapl(&stuff->source);
+    swapl(&stuff->destination);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -431,14 +423,13 @@ ProcXFixesCombineRegion (ClientPtr client)
 int
 SProcXFixesCombineRegion (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesCombineRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesCombineRegionReq);
-    swapl (&stuff->source1, n);
-    swapl (&stuff->source2, n);
-    swapl (&stuff->destination, n);
+    swapl(&stuff->source1);
+    swapl(&stuff->source2);
+    swapl(&stuff->destination);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -475,17 +466,16 @@ ProcXFixesInvertRegion (ClientPtr client)
 int
 SProcXFixesInvertRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesInvertRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
-    swapl (&stuff->source, n);
-    swaps (&stuff->x, n);
-    swaps (&stuff->y, n);
-    swaps (&stuff->width, n);
-    swaps (&stuff->height, n);
-    swapl (&stuff->destination, n);
+    swapl(&stuff->source);
+    swaps(&stuff->x);
+    swaps(&stuff->y);
+    swaps(&stuff->width);
+    swaps(&stuff->height);
+    swapl(&stuff->destination);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -505,14 +495,13 @@ ProcXFixesTranslateRegion (ClientPtr client)
 int
 SProcXFixesTranslateRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesTranslateRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
-    swapl (&stuff->region, n);
-    swaps (&stuff->dx, n);
-    swaps (&stuff->dy, n);
+    swapl(&stuff->region);
+    swaps(&stuff->dx);
+    swaps(&stuff->dy);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -534,13 +523,12 @@ ProcXFixesRegionExtents (ClientPtr client)
 int
 SProcXFixesRegionExtents (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesRegionExtentsReq);
     
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
-    swapl (&stuff->source, n);
-    swapl (&stuff->destination, n);
+    swapl(&stuff->source);
+    swapl(&stuff->destination);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -584,13 +572,12 @@ ProcXFixesFetchRegion (ClientPtr client)
     }
     if (client->swapped)
     {
-	int n;
-	swaps (&reply->sequenceNumber, n);
-	swapl (&reply->length, n);
-	swaps (&reply->x, n);
-	swaps (&reply->y, n);
-	swaps (&reply->width, n);
-	swaps (&reply->height, n);
+	swaps(&reply->sequenceNumber);
+	swapl(&reply->length);
+	swaps(&reply->x);
+	swaps(&reply->y);
+	swaps(&reply->width);
+	swaps(&reply->height);
 	SwapShorts ((INT16 *) pRect, nBox * 4);
     }
     (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) +
@@ -602,12 +589,11 @@ ProcXFixesFetchRegion (ClientPtr client)
 int
 SProcXFixesFetchRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesFetchRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
-    swapl (&stuff->region, n);
+    swapl(&stuff->region);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -645,15 +631,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
 int
 SProcXFixesSetGCClipRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesSetGCClipRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
-    swapl (&stuff->gc, n);
-    swapl (&stuff->region, n);
-    swaps (&stuff->xOrigin, n);
-    swaps (&stuff->yOrigin, n);
+    swapl(&stuff->gc);
+    swapl(&stuff->region);
+    swaps(&stuff->xOrigin);
+    swaps(&stuff->yOrigin);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -739,15 +724,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
 int
 SProcXFixesSetWindowShapeRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesSetWindowShapeRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
-    swapl (&stuff->dest, n);
-    swaps (&stuff->xOff, n);
-    swaps (&stuff->yOff, n);
-    swapl (&stuff->region, n);
+    swapl(&stuff->dest);
+    swaps(&stuff->xOff);
+    swaps(&stuff->yOff);
+    swapl(&stuff->region);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -769,15 +753,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
 int
 SProcXFixesSetPictureClipRegion (ClientPtr client)
 {
-    int n;
     REQUEST(xXFixesSetPictureClipRegionReq);
     
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
-    swapl (&stuff->picture, n);
-    swapl (&stuff->region, n);
-    swaps (&stuff->xOrigin, n);
-    swaps (&stuff->yOrigin, n);
+    swapl(&stuff->picture);
+    swapl(&stuff->region);
+    swaps(&stuff->xOrigin);
+    swaps(&stuff->yOrigin);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
@@ -824,17 +807,16 @@ ProcXFixesExpandRegion (ClientPtr client)
 int
 SProcXFixesExpandRegion (ClientPtr client)
 {
-    int n;
     REQUEST (xXFixesExpandRegionReq);
 
-    swaps (&stuff->length, n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH (xXFixesExpandRegionReq);
-    swapl (&stuff->source, n);
-    swapl (&stuff->destination, n);
-    swaps (&stuff->left, n);
-    swaps (&stuff->right, n);
-    swaps (&stuff->top, n);
-    swaps (&stuff->bottom, n);
+    swapl(&stuff->source);
+    swapl(&stuff->destination);
+    swaps(&stuff->left);
+    swaps(&stuff->right);
+    swaps(&stuff->top);
+    swaps(&stuff->bottom);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
diff --git a/xfixes/saveset.c b/xfixes/saveset.c
index 35d8e17..ba959c2 100644
--- a/xfixes/saveset.c
+++ b/xfixes/saveset.c
@@ -63,10 +63,9 @@ ProcXFixesChangeSaveSet(ClientPtr client)
 int
 SProcXFixesChangeSaveSet(ClientPtr client)
 {
-    register int n;
     REQUEST(xXFixesChangeSaveSetReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
     return (*ProcXFixesVector[stuff->xfixesReqType])(client);
 }
diff --git a/xfixes/select.c b/xfixes/select.c
index baf1ef8..2bf13f3 100644
--- a/xfixes/select.c
+++ b/xfixes/select.c
@@ -220,13 +220,12 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
 int
 SProcXFixesSelectSelectionInput (ClientPtr client)
 {
-    register int n;
     REQUEST(xXFixesSelectSelectionInputReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->window, n);
-    swapl(&stuff->selection, n);
-    swapl(&stuff->eventMask, n);
+    swaps(&stuff->length);
+    swapl(&stuff->window);
+    swapl(&stuff->selection);
+    swapl(&stuff->eventMask);
     return (*ProcXFixesVector[stuff->xfixesReqType])(client);
 }
     
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index e0ebedd..96d33c0 100644
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -61,7 +61,6 @@ ProcXFixesQueryVersion(ClientPtr client)
 {
     XFixesClientPtr pXFixesClient = GetXFixesClient (client);
     xXFixesQueryVersionReply rep;
-    register int n;
     REQUEST(xXFixesQueryVersionReq);
 
     REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
@@ -83,10 +82,10 @@ ProcXFixesQueryVersion(ClientPtr client)
     pXFixesClient->major_version = rep.majorVersion;
     pXFixesClient->minor_version = rep.minorVersion;
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-    	swapl(&rep.length, n);
-	swapl(&rep.majorVersion, n);
-	swapl(&rep.minorVersion, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swapl(&rep.majorVersion);
+	swapl(&rep.minorVersion);
     }
     WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep);
     return Success;
@@ -161,12 +160,11 @@ ProcXFixesDispatch (ClientPtr client)
 static int
 SProcXFixesQueryVersion(ClientPtr client)
 {
-    register int n;
     REQUEST(xXFixesQueryVersionReq);
 
-    swaps(&stuff->length, n);
-    swapl(&stuff->majorVersion, n);
-    swapl(&stuff->minorVersion, n);
+    swaps(&stuff->length);
+    swapl(&stuff->majorVersion);
+    swapl(&stuff->minorVersion);
     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
 }
 
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 3d301d8..7de8efc 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -107,9 +107,8 @@ char *		tmp;
     wire16[1]= slen;
     memcpy(wire8,str,slen);
     if (client->swapped) {
-	register int n;
-	swaps(&wire16[0],n);
-	swaps(&wire16[1],n);
+	swaps(&wire16[0]);
+	swaps(&wire16[1]);
     }
     list->nPool+= wlen;
     list->nFound[what]++;
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 9c66955..9ae9b9e 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -158,7 +158,6 @@ ProcXkbUseExtension(ClientPtr client)
 {
     REQUEST(xkbUseExtensionReq);
     xkbUseExtensionReply	rep;
-    register int n;
     int	supported;
 
     REQUEST_SIZE_MATCH(xkbUseExtensionReq);
@@ -189,9 +188,9 @@ ProcXkbUseExtension(ClientPtr client)
     rep.serverMajor = SERVER_XKB_MAJOR_VERSION;
     rep.serverMinor = SERVER_XKB_MINOR_VERSION;
     if ( client->swapped ) {
-	swaps(&rep.sequenceNumber, n);
-	swaps(&rep.serverMajor, n);
-	swaps(&rep.serverMinor, n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.serverMajor);
+	swaps(&rep.serverMinor);
     }
     WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep);
     return Success;
@@ -574,9 +573,8 @@ ProcXkbGetState(ClientPtr client)
     rep.compatState = xkb->compat_state;
     rep.ptrBtnState = xkb->ptr_buttons;
     if (client->swapped) {
-	register int n;
-	swaps(&rep.sequenceNumber,n);
-	swaps(&rep.ptrBtnState,n);
+	swaps(&rep.sequenceNumber);
+	swaps(&rep.ptrBtnState);
     }
     WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep);
     return Success;
@@ -658,7 +656,6 @@ ProcXkbGetControls(ClientPtr client)
     xkbGetControlsReply rep;
     XkbControlsPtr	xkb;
     DeviceIntPtr 	dev;
-    register int 	n;
 
     REQUEST(xkbGetControlsReq);
     REQUEST_SIZE_MATCH(xkbGetControlsReq);
@@ -701,26 +698,26 @@ ProcXkbGetControls(ClientPtr client)
     rep.axOptions = xkb->ax_options;
     memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize);
     if (client->swapped) {
-    	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.length,n);
-	swaps(&rep.internalVMods, n);
-	swaps(&rep.ignoreLockVMods, n);
-	swapl(&rep.enabledCtrls, n);
-	swaps(&rep.repeatDelay, n);
-	swaps(&rep.repeatInterval, n);
-	swaps(&rep.slowKeysDelay, n);
-	swaps(&rep.debounceDelay, n);
-	swaps(&rep.mkDelay, n);
-	swaps(&rep.mkInterval, n);
-	swaps(&rep.mkTimeToMax, n);
-	swaps(&rep.mkMaxSpeed, n);
-	swaps(&rep.mkCurve, n);
-	swaps(&rep.axTimeout, n);
-	swapl(&rep.axtCtrlsMask, n);
-	swapl(&rep.axtCtrlsValues, n);
-	swaps(&rep.axtOptsMask, n);
-	swaps(&rep.axtOptsValues, n);
-	swaps(&rep.axOptions, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.internalVMods);
+	swaps(&rep.ignoreLockVMods);
+	swapl(&rep.enabledCtrls);
+	swaps(&rep.repeatDelay);
+	swaps(&rep.repeatInterval);
+	swaps(&rep.slowKeysDelay);
+	swaps(&rep.debounceDelay);
+	swaps(&rep.mkDelay);
+	swaps(&rep.mkInterval);
+	swaps(&rep.mkTimeToMax);
+	swaps(&rep.mkMaxSpeed);
+	swaps(&rep.mkCurve);
+	swaps(&rep.axTimeout);
+	swapl(&rep.axtCtrlsMask);
+	swapl(&rep.axtCtrlsValues);
+	swaps(&rep.axtOptsMask);
+	swaps(&rep.axtOptsValues);
+	swaps(&rep.axOptions);
     }
     WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep);
     return Success;
@@ -999,8 +996,7 @@ XkbWriteKeyTypes(	XkbDescPtr		xkb,
 	wire->nMapEntries = type->map_count;
 	wire->preserve = (type->preserve!=NULL);
 	if (client->swapped) {
-	    register int n;
-	    swaps(&wire->virtualMods,n);
+	    swaps(&wire->virtualMods);
 	}	
 
 	buf= (char *)&wire[1];
@@ -1016,8 +1012,7 @@ XkbWriteKeyTypes(	XkbDescPtr		xkb,
 		wire->realMods= entry->mods.real_mods;
 		wire->virtualMods= entry->mods.vmods;
 		if (client->swapped) {
-		    register int n;
-		    swaps(&wire->virtualMods,n);
+		    swaps(&wire->virtualMods);
 		}
 	    }
 	    buf= (char *)wire;
@@ -1031,8 +1026,7 @@ XkbWriteKeyTypes(	XkbDescPtr		xkb,
 		    pwire->realMods= preserve->real_mods;
 		    pwire->virtualMods= preserve->vmods;
 		    if (client->swapped) {
-			register int n;
-			swaps(&pwire->virtualMods,n);
+			swaps(&pwire->virtualMods);
 		    }
 		}
 		buf= (char *)pwire;
@@ -1112,10 +1106,10 @@ register unsigned	i;
 	pSym = &xkb->map->syms[symMap->offset];
 	memcpy((char *)buf,(char *)pSym,outMap->nSyms*4);
 	if (client->swapped) {
-	    register int n,nSyms= outMap->nSyms;
-	    swaps(&outMap->nSyms,n);
+	    register int nSyms= outMap->nSyms;
+	    swaps(&outMap->nSyms);
 	    while (nSyms-->0) {
-		swapl(buf,n);
+		swapl(buf);
 		buf+= 4;
 	    }
 	}
@@ -1402,12 +1396,11 @@ char		*desc,*start;
 					len, (unsigned long)(desc-start));
     }
     if (client->swapped) {
-	register int n;
-	swaps(&rep->sequenceNumber,n);
-	swapl(&rep->length,n);
-	swaps(&rep->present,n);
-	swaps(&rep->totalSyms,n);
-	swaps(&rep->totalActs,n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swaps(&rep->present);
+	swaps(&rep->totalSyms);
+	swaps(&rep->totalActs);
     }
     WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep);
     WriteToClient(client, len, start);
@@ -1589,8 +1582,7 @@ register xkbKeyTypeWireDesc	*wire = *wireRtrn;
     for (i=0;i<req->nTypes;i++) {
 	unsigned	width;
 	if (client->swapped) {
-	    register int s;
-	    swaps(&wire->virtualMods,s);
+	    swaps(&wire->virtualMods);
 	}
 	n= i+req->firstType;
 	width= wire->numLevels;
@@ -1616,8 +1608,7 @@ register xkbKeyTypeWireDesc	*wire = *wireRtrn;
 	    preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries];
 	    for (n=0;n<wire->nMapEntries;n++) {
 		if (client->swapped) {
-		    register int s;
-		    swaps(&mapWire[n].virtualMods,s);
+		    swaps(&mapWire[n].virtualMods);
 		}
 		if (mapWire[n].realMods&(~wire->realMods)) {
 		    *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods,
@@ -1635,8 +1626,7 @@ register xkbKeyTypeWireDesc	*wire = *wireRtrn;
 		}
 		if (wire->preserve) {
 		    if (client->swapped) {
-			register int s;
-			swaps(&preWire[n].virtualMods,s);
+			swaps(&preWire[n].virtualMods);
 		    }
 		    if (preWire[n].realMods&(~mapWire[n].realMods)) {
 			*nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods,
@@ -1686,7 +1676,7 @@ xkbSymMapWireDesc*	wire = *wireRtrn;
 	KeySym *pSyms;
 	register unsigned nG;
 	if (client->swapped) {
-	    swaps(&wire->nSyms,nG);
+	    swaps(&wire->nSyms);
 	}
 	nG = XkbNumGroups(wire->groupInfo);
 	if (nG>XkbNumKbdGroups) {
@@ -2066,9 +2056,8 @@ unsigned		first,last;
 		newSyms[s]= pSyms[s];
 	    }
 	    if (client->swapped) {
-		int n;
 		for (s=0;s<wire->nSyms;s++) {
-		    swapl(&newSyms[s],n);
+		    swapl(&newSyms[s]);
 		}
 	    }
 	}
@@ -2654,8 +2643,7 @@ int		size;
 		wire->flags= sym->flags;
 		memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc);
 		if (client->swapped) {
-		    register int n;
-		    swapl(&wire->sym,n);
+		    swapl(&wire->sym);
 		}
 	    }
 	    if (rep->groups) {
@@ -2666,8 +2654,7 @@ int		size;
 			grp->realMods= compat->groups[i].real_mods;
 			grp->virtualMods= compat->groups[i].vmods;
 			if (client->swapped) {
-			    register int n;
-			    swaps(&grp->virtualMods,n);
+			    swaps(&grp->virtualMods);
 			}
 			grp++;
 		    }
@@ -2680,12 +2667,11 @@ int		size;
     else data= NULL;
 
     if (client->swapped) {
-	register int n;
-	swaps(&rep->sequenceNumber,n);
-	swapl(&rep->length,n);
-	swaps(&rep->firstSI,n);
-	swaps(&rep->nSI,n);
-	swaps(&rep->nTotalSI,n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swaps(&rep->firstSI);
+	swaps(&rep->nSI);
+	swaps(&rep->nTotalSI);
     }
 
     WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep);
@@ -2802,8 +2788,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
 	sym = &compat->sym_interpret[req->firstSI];
 	for (i=0;i<req->nSI;i++,wire++) {
 	    if (client->swapped) {
-		int n;
-		swapl(&wire->sym,n);
+		swapl(&wire->sym);
 	    }
 	    if (wire->sym == NoSymbol && wire->match == XkbSI_AnyOfOrNone &&
 		(wire->mods & 0xff) == 0xff &&
@@ -2841,8 +2826,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
 	for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) {
 	    if (req->groups & bit) {
 		if (client->swapped) {
-		    int n;
-		    swaps(&wire->virtualMods,n);
+		    swaps(&wire->virtualMods);
 		}
 		compat->groups[i].mask= wire->realMods;
 		compat->groups[i].real_mods= wire->realMods;
@@ -2962,7 +2946,6 @@ ProcXkbGetIndicatorState(ClientPtr client)
     xkbGetIndicatorStateReply 	rep;
     XkbSrvLedInfoPtr		sli;
     DeviceIntPtr 		dev;
-    register int 		i;
 
     REQUEST(xkbGetIndicatorStateReq);
     REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
@@ -2984,8 +2967,8 @@ ProcXkbGetIndicatorState(ClientPtr client)
     rep.state = sli->effectiveState;
 
     if (client->swapped) {
-	swaps(&rep.sequenceNumber,i);
-	swapl(&rep.state,i);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.state);
     }
     WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep);
     return Success;
@@ -3037,9 +3020,8 @@ register unsigned	bit;
 		    wire->virtualMods= indicators->maps[i].mods.vmods;
 		    wire->ctrls= indicators->maps[i].ctrls;
 		    if (client->swapped) {
-			register int n;
-			swaps(&wire->virtualMods,n);
-			swapl(&wire->ctrls,n);
+			swaps(&wire->virtualMods);
+			swapl(&wire->ctrls);
 		    }
 		    wire++;
 		}
@@ -3055,10 +3037,10 @@ register unsigned	bit;
     }
     else map = NULL;
     if (client->swapped) {
-	swaps(&rep->sequenceNumber,i);
-	swapl(&rep->length,i);
-	swapl(&rep->which,i);
-	swapl(&rep->realIndicators,i);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swapl(&rep->which);
+	swapl(&rep->realIndicators);
     }
     WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep);
     if (map) {
@@ -3174,9 +3156,8 @@ ProcXkbSetIndicatorMap(ClientPtr client)
     for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
 	if (stuff->which&bit) {
 	    if (client->swapped) {
-		int n;
-		swaps(&from->virtualMods,n);
-		swapl(&from->ctrls,n);
+		swaps(&from->virtualMods);
+		swapl(&from->ctrls);
 	    }
 	    CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup);
 	    CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods);
@@ -3277,12 +3258,11 @@ ProcXkbGetNamedIndicator(ClientPtr client)
 	rep.supported= 		TRUE;
     }
     if ( client->swapped ) {
-	register int n;
-	swapl(&rep.length,n);
-	swaps(&rep.sequenceNumber,n);
-	swapl(&rep.indicator,n);
-	swaps(&rep.virtualMods,n);
-	swapl(&rep.ctrls,n);
+	swapl(&rep.length);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.indicator);
+	swaps(&rep.virtualMods);
+	swapl(&rep.ctrls);
     }
 
     WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep);
@@ -3529,8 +3509,7 @@ Atom *atm;
 	if (atoms[i]!=None) {
 	    *atm= atoms[i];
 	    if (swap) {
-		register int n;
-		swapl(atm,n);
+		swapl(atm);
 	    }
 	    atm++;
 	}
@@ -3649,16 +3628,15 @@ XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep)
 register unsigned 	i,length,which;
 char *			start;
 char *			desc;
-register int            n;
 
     length= rep->length*4;
     which= rep->which;
     if (client->swapped) {
-	swaps(&rep->sequenceNumber,n);
-	swapl(&rep->length,n);
-	swapl(&rep->which,n);
-	swaps(&rep->virtualMods,n);
-	swapl(&rep->indicators,n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swapl(&rep->which);
+	swaps(&rep->virtualMods);
+	swapl(&rep->indicators);
     }
 
     start = desc = calloc(1, length);
@@ -3668,21 +3646,21 @@ register int            n;
         if (which&XkbKeycodesNameMask) {
             *((CARD32 *)desc)= xkb->names->keycodes;
             if (client->swapped) {
-                swapl(desc,n);
+                swapl(desc);
             }
             desc+= 4;
         }
         if (which&XkbGeometryNameMask)  {
             *((CARD32 *)desc)= xkb->names->geometry;
             if (client->swapped) {
-                swapl(desc,n);
+                swapl(desc);
             }
             desc+= 4;
         }
         if (which&XkbSymbolsNameMask) {
             *((CARD32 *)desc)= xkb->names->symbols;
             if (client->swapped) {
-                swapl(desc,n);
+                swapl(desc);
             }
             desc+= 4;
         }
@@ -3690,21 +3668,21 @@ register int            n;
             register CARD32 *atm= (CARD32 *)desc;
             atm[0]= (CARD32)xkb->names->phys_symbols;
             if (client->swapped) {
-                swapl(&atm[0],n);
+                swapl(&atm[0]);
             }
             desc+= 4;
         }
         if (which&XkbTypesNameMask) {
             *((CARD32 *)desc)= (CARD32)xkb->names->types;
             if (client->swapped) {
-                swapl(desc,n);
+                swapl(desc);
             }
             desc+= 4;
         }
         if (which&XkbCompatNameMask) {
             *((CARD32 *)desc)= (CARD32)xkb->names->compat;
             if (client->swapped) {
-                swapl(desc,n);
+                swapl(desc);
             }
             desc+= 4;
         }
@@ -3715,7 +3693,7 @@ register int            n;
             for (i=0;i<xkb->map->num_types;i++,atm++,type++) {
                 *atm= (CARD32)type->name;
                 if (client->swapped) {
-                    swapl(atm,n);
+                    swapl(atm);
                 }
             }
             desc= (char *)atm;
@@ -3736,7 +3714,7 @@ register int            n;
                     for (l=0;l<type->num_levels;l++,atm++) {
                         *atm= type->level_names[l];
                         if (client->swapped) {
-                            swapl(atm,n);
+                            swapl(atm);
                         }
                     }
                     desc+= type->num_levels*4;
@@ -3772,7 +3750,7 @@ register int            n;
             for (i=0;i<rep->nRadioGroups;i++,atm++) {
                 *atm= (CARD32)xkb->names->radio_groups[i];
                 if (client->swapped) {
-                    swapl(atm,n);
+                    swapl(atm);
                 }
             }
             desc+= rep->nRadioGroups*4;
@@ -3835,8 +3813,7 @@ register int i;
 
     for (i=0;i<nAtoms;i++,wire++) {
 	if (swapped) {
-	    register int n;
-	    swapl(wire,n);
+	    swapl(wire);
 	}
 	if ((((Atom)*wire)!=None)&&(!ValidAtom((Atom)*wire))) {
 	    *pError= ((Atom)*wire);
@@ -3856,8 +3833,7 @@ register unsigned i,bit;
 	if ((present&bit)==0)
 	    continue;
 	if (swapped) {
-	    register int n;
-	    swapl(wire,n);
+	    swapl(wire);
 	}
 	if ((((Atom)*wire)!=None)&&(!ValidAtom(((Atom)*wire)))) {
 	    *pError= (Atom)*wire;
@@ -4347,8 +4323,7 @@ XkbWriteCountedString(char *wire,char *str,Bool swap)
     pLen= (CARD16 *)wire;
     *pLen= len;
     if (swap) {
-	register int n;
-	swaps(pLen,n);
+	swaps(pLen);
     }
     paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len);
     strncpy(&wire[sizeof(len)],str,paddedLen);
@@ -4465,8 +4440,7 @@ xkbShapeWireDesc *	shapeWire;
 	else shapeWire->approxNdx= XkbNoShape;
 	shapeWire->pad= 0;
 	if (swap) {
-	    register int n;
-	    swapl(&shapeWire->name,n);
+	    swapl(&shapeWire->name);
 	}
 	wire= (char *)&shapeWire[1];
 	for (o=0,ol=shape->outlines;o<shape->num_outlines;o++,ol++) {
@@ -4483,9 +4457,8 @@ xkbShapeWireDesc *	shapeWire;
 		ptWire[p].x= pt->x;
 		ptWire[p].y= pt->y;
 		if (swap) {
-		    register int n;
-		    swaps(&ptWire[p].x,n);
-		    swaps(&ptWire[p].y,n);
+		    swaps(&ptWire[p].x);
+		    swaps(&ptWire[p].y);
 		}
 	    }
 	    wire= (char *)&ptWire[ol->num_points];
@@ -4528,10 +4501,9 @@ xkbDoodadWireDesc *	doodadWire;
 	doodadWire->any.top= doodad->any.top;
 	doodadWire->any.left= doodad->any.left;
 	if (swap) {
-	    register int n;
-	    swapl(&doodadWire->any.name,n);
-	    swaps(&doodadWire->any.top,n);
-	    swaps(&doodadWire->any.left,n);
+	    swapl(&doodadWire->any.name);
+	    swaps(&doodadWire->any.top);
+	    swaps(&doodadWire->any.left);
 	}
 	switch (doodad->any.type) {
 	    case XkbOutlineDoodad:
@@ -4540,8 +4512,7 @@ xkbDoodadWireDesc *	doodadWire;
 		doodadWire->shape.colorNdx= doodad->shape.color_ndx;
 		doodadWire->shape.shapeNdx= doodad->shape.shape_ndx;
 		if (swap) {
-		    register int n;
-		    swaps(&doodadWire->shape.angle,n);
+		    swaps(&doodadWire->shape.angle);
 		}
 		break;
 	    case XkbTextDoodad:
@@ -4550,10 +4521,9 @@ xkbDoodadWireDesc *	doodadWire;
 		doodadWire->text.height= doodad->text.height;
 		doodadWire->text.colorNdx= doodad->text.color_ndx;
 		if (swap) {
-		    register int n;
-		    swaps(&doodadWire->text.angle,n);
-		    swaps(&doodadWire->text.width,n);
-		    swaps(&doodadWire->text.height,n);
+		    swaps(&doodadWire->text.angle);
+		    swaps(&doodadWire->text.width);
+		    swaps(&doodadWire->text.height);
 		}
 		wire= XkbWriteCountedString(wire,doodad->text.text,swap);
 		wire= XkbWriteCountedString(wire,doodad->text.font,swap);
@@ -4593,8 +4563,7 @@ xkbOverlayWireDesc *	olWire;
    olWire->pad1= 0;
    olWire->pad2= 0;
    if (swap) {
-	register int n;
-	swapl(&olWire->name,n);
+	swapl(&olWire->name);
    }
    wire= (char *)&olWire[1];
    for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
@@ -4673,13 +4642,12 @@ xkbSectionWireDesc *	sectionWire;
 	sectionWire->nOverlays= section->num_overlays;
 	sectionWire->pad= 0;
 	if (swap) {
-	    register int n;
-	    swapl(&sectionWire->name,n);
-	    swaps(&sectionWire->top,n);
-	    swaps(&sectionWire->left,n);
-	    swaps(&sectionWire->width,n);
-	    swaps(&sectionWire->height,n);
-	    swaps(&sectionWire->angle,n);
+	    swapl(&sectionWire->name);
+	    swaps(&sectionWire->top);
+	    swaps(&sectionWire->left);
+	    swaps(&sectionWire->width);
+	    swaps(&sectionWire->height);
+	    swaps(&sectionWire->angle);
 	}
 	wire= (char *)&sectionWire[1];
 	if (section->rows) {
@@ -4694,9 +4662,8 @@ xkbSectionWireDesc *	sectionWire;
 		rowWire->vertical= row->vertical;
 		rowWire->pad= 0;
 		if (swap) {
-		    register int n;
-		    swaps(&rowWire->top,n);
-		    swaps(&rowWire->left,n);
+		    swaps(&rowWire->top);
+		    swaps(&rowWire->left);
 		}
 		wire= (char *)&rowWire[1];
 		if (row->keys) {
@@ -4710,8 +4677,7 @@ xkbSectionWireDesc *	sectionWire;
 			keyWire[k].shapeNdx= key->shape_ndx;
 			keyWire[k].colorNdx= key->color_ndx;
 			if (swap) {
-			    register int n;
-			    swaps(&keyWire[k].gap,n);
+			    swaps(&keyWire[k].gap);
 			}
 		    }
 		    wire= (char *)&keyWire[row->num_keys];
@@ -4813,18 +4779,17 @@ XkbSendGeometry(	ClientPtr		client,
 	start= NULL;
     }
     if (client->swapped) {
-	register int n;
-	swaps(&rep->sequenceNumber,n);
-	swapl(&rep->length,n);
-	swapl(&rep->name,n);
-	swaps(&rep->widthMM,n);
-	swaps(&rep->heightMM,n);
-	swaps(&rep->nProperties,n);
-	swaps(&rep->nColors,n);
-	swaps(&rep->nShapes,n);
-	swaps(&rep->nSections,n);
-	swaps(&rep->nDoodads,n);
-	swaps(&rep->nKeyAliases,n);
+	swaps(&rep->sequenceNumber);
+	swapl(&rep->length);
+	swapl(&rep->name);
+	swaps(&rep->widthMM);
+	swaps(&rep->heightMM);
+	swaps(&rep->nProperties);
+	swaps(&rep->nColors);
+	swaps(&rep->nShapes);
+	swaps(&rep->nSections);
+	swaps(&rep->nDoodads);
+	swaps(&rep->nKeyAliases);
     }
     WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep);
     if (len>0)
@@ -4876,8 +4841,7 @@ CARD16	len,*plen;
     wire= *wire_inout;
     plen= (CARD16 *)wire;
     if (swap) {
-	register int n;
-	swaps(plen,n);
+	swaps(plen);
     }
     len= *plen;
     str= malloc(len+1);
@@ -4903,11 +4867,10 @@ XkbDoodadPtr		doodad;
     dWire= (xkbDoodadWireDesc *)(*wire_inout);
     wire= (char *)&dWire[1];
     if (client->swapped) {
-	register int n;
-	swapl(&dWire->any.name,n);
-	swaps(&dWire->any.top,n);
-	swaps(&dWire->any.left,n);
-	swaps(&dWire->any.angle,n);
+	swapl(&dWire->any.name);
+	swaps(&dWire->any.top);
+	swaps(&dWire->any.left);
+	swaps(&dWire->any.angle);
     }
     CHK_ATOM_ONLY(dWire->any.name);
     doodad= XkbAddGeomDoodad(geom,section,dWire->any.name);
@@ -4941,9 +4904,8 @@ XkbDoodadPtr		doodad;
 		return BadMatch;
 	    }
 	    if (client->swapped) {
-		register int n;
-		swaps(&dWire->text.width,n);
-		swaps(&dWire->text.height,n);
+		swaps(&dWire->text.width);
+		swaps(&dWire->text.height);
 	    }
 	    doodad->text.width= dWire->text.width;
 	    doodad->text.height= dWire->text.height;
@@ -5009,8 +4971,7 @@ xkbOverlayRowWireDesc *	rWire;
     wire= *wire_inout;
     olWire= (xkbOverlayWireDesc *)wire;
     if (client->swapped) {
-	register int n;
-	swapl(&olWire->name,n);
+	swapl(&olWire->name);
     }
     CHK_ATOM_ONLY(olWire->name);
     ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows);
@@ -5062,13 +5023,12 @@ XkbSectionPtr		section;
 	register int		r;
 	xkbRowWireDesc *	rWire;
 	if (client->swapped) {
-	    register int n;
-	    swapl(&sWire->name,n);
-	    swaps(&sWire->top,n);
-	    swaps(&sWire->left,n);
-	    swaps(&sWire->width,n);
-	    swaps(&sWire->height,n);
-	    swaps(&sWire->angle,n);
+	    swapl(&sWire->name);
+	    swaps(&sWire->top);
+	    swaps(&sWire->left);
+	    swaps(&sWire->width);
+	    swaps(&sWire->height);
+	    swaps(&sWire->angle);
 	}
 	CHK_ATOM_ONLY(sWire->name);
 	section= XkbAddGeomSection(geom,sWire->name,sWire->nRows,
@@ -5087,9 +5047,8 @@ XkbSectionPtr		section;
 	    XkbRowPtr		row;
 	    xkbKeyWireDesc *	kWire;
 	    if (client->swapped) {
-		register int n;
-		swaps(&rWire->top,n);
-		swaps(&rWire->left,n);
+		swaps(&rWire->top);
+		swaps(&rWire->left);
 	    }
 	    row= XkbAddGeomRow(section,rWire->nKeys);
 	    if (!row)
@@ -5184,9 +5143,8 @@ char *		wire;
 		    pt->x= ptWire[p].x;
 		    pt->y= ptWire[p].y;
 		    if (client->swapped) {
-			register int n;
-			swaps(&pt->x,n);
-			swaps(&pt->y,n);
+			swaps(&pt->x);
+			swaps(&pt->y);
 		    }
 		}
 		ol->num_points= olWire->nPoints;
@@ -5453,12 +5411,11 @@ ProcXkbPerClientFlags(ClientPtr client)
 	rep.autoCtrls= rep.autoCtrlValues= 0;
     }
     if ( client->swapped ) {
-	register int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.supported,n);
-	swapl(&rep.value,n);
-	swapl(&rep.autoCtrls,n);
-	swapl(&rep.autoCtrlValues,n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.supported);
+	swapl(&rep.value);
+	swapl(&rep.autoCtrls);
+	swapl(&rep.autoCtrlValues);
     }
     WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep);
     return Success;
@@ -5576,16 +5533,15 @@ ProcXkbListComponents(ClientPtr client)
     if (list.nTotal>list.maxRtrn)
 	rep.extra = (list.nTotal-list.maxRtrn);
     if (client->swapped) {
-	register int n;
-	swaps(&rep.sequenceNumber,n);
-	swapl(&rep.length,n);
-	swaps(&rep.nKeymaps,n);
-	swaps(&rep.nKeycodes,n);
-	swaps(&rep.nTypes,n);
-	swaps(&rep.nCompatMaps,n);
-	swaps(&rep.nSymbols,n);
-	swaps(&rep.nGeometries,n);
-	swaps(&rep.extra,n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.nKeymaps);
+	swaps(&rep.nKeycodes);
+	swaps(&rep.nTypes);
+	swaps(&rep.nCompatMaps);
+	swaps(&rep.nSymbols);
+	swaps(&rep.nGeometries);
+	swaps(&rep.extra);
     }
     WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep);
     if (list.nPool && list.pool) {
@@ -5849,11 +5805,10 @@ ProcXkbGetKbdByName(ClientPtr client)
 
     reported= rep.reported;
     if ( client->swapped ) {
-	register int n;
-	swaps(&rep.sequenceNumber,n);
-	swapl(&rep.length,n);
-	swaps(&rep.found,n);
-	swaps(&rep.reported,n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.found);
+	swaps(&rep.reported);
     }
     WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep);
     if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask))
@@ -6038,13 +5993,12 @@ int			length;
     wire.physIndicators= 	sli->physIndicators;
     wire.state=			sli->effectiveState;
     if (client->swapped) {
-	register int n;
-	swaps(&wire.ledClass,n);
-	swaps(&wire.ledID,n);
-	swapl(&wire.namesPresent,n);
-	swapl(&wire.mapsPresent,n);
-	swapl(&wire.physIndicators,n);
-	swapl(&wire.state,n);
+	swaps(&wire.ledClass);
+	swaps(&wire.ledID);
+	swapl(&wire.namesPresent);
+	swapl(&wire.mapsPresent);
+	swapl(&wire.physIndicators);
+	swapl(&wire.state);
     }
     WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire);
     length+= SIZEOF(xkbDeviceLedsWireDesc);
@@ -6056,8 +6010,7 @@ int			length;
 		if (sli->namesPresent&bit) {
 		    awire= (CARD32)sli->names[i];
 		    if (client->swapped) {
-			register int n;
-			swapl(&awire,n);
+			swapl(&awire);
 		    }
 		    WriteToClient(client,4,(char *)&awire);
 		    length+= 4;
@@ -6077,9 +6030,8 @@ int			length;
 		    iwire.virtualMods=	sli->maps[i].mods.vmods;
 		    iwire.ctrls= 	sli->maps[i].ctrls;
 		    if (client->swapped) {
-			register int n;
-			swaps(&iwire.virtualMods,n);
-			swapl(&iwire.ctrls,n);
+			swaps(&iwire.virtualMods);
+			swapl(&iwire.ctrls);
 		    }
 		    WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc),
 								(char *)&iwire);
@@ -6232,14 +6184,13 @@ char *			str;
     length= rep.length*4;
     nDeviceLedFBs = rep.nDeviceLedFBs;
     if (client->swapped) {
-	register int n;
-	swaps(&rep.sequenceNumber,n);
-	swapl(&rep.length,n);
-	swaps(&rep.present,n);
-	swaps(&rep.supported,n);
-	swaps(&rep.unsupported,n);
-	swaps(&rep.nDeviceLedFBs,n);
-	swapl(&rep.type,n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.length);
+	swaps(&rep.present);
+	swaps(&rep.supported);
+	swaps(&rep.unsupported);
+	swaps(&rep.nDeviceLedFBs);
+	swapl(&rep.type);
     }
     WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
 
@@ -6286,12 +6237,11 @@ XkbSrvLedInfoPtr 	sli;
     ledWire= (xkbDeviceLedsWireDesc *)wire;
     for (i=0;i<num;i++) {
 	if (client->swapped) {
-	   register int n;
-	   swaps(&ledWire->ledClass,n);
-	   swaps(&ledWire->ledID,n);
-	   swapl(&ledWire->namesPresent,n);
-	   swapl(&ledWire->mapsPresent,n);
-	   swapl(&ledWire->physIndicators,n);
+	   swaps(&ledWire->ledClass);
+	   swaps(&ledWire->ledID);
+	   swapl(&ledWire->namesPresent);
+	   swapl(&ledWire->mapsPresent);
+	   swapl(&ledWire->physIndicators);
 	}
 
         sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID,
@@ -6314,8 +6264,7 @@ XkbSrvLedInfoPtr 	sli;
 	    if (nNames>0) {
 		for (n=0;n<nNames;n++) {
 		    if (client->swapped) {
-			register int t;
-			swapl(atomWire,t);
+			swapl(atomWire);
 		    }
 		    CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue,
 							*status_rtrn,NULL);
@@ -6326,9 +6275,8 @@ XkbSrvLedInfoPtr 	sli;
 	    if (nMaps>0) {
 		for (n=0;n<nMaps;n++) {
 		    if (client->swapped) {
-			register int t;
-			swaps(&mapWire->virtualMods,t);
-			swapl(&mapWire->ctrls,t);
+			swaps(&mapWire->virtualMods);
+			swapl(&mapWire->ctrls);
 		    }
 		    CHK_MASK_LEGAL3(0x21,mapWire->whichGroups,
 						XkbIM_UseAnyGroup,
@@ -6649,12 +6597,11 @@ int rc;
     rep.supportedFlags = ~0;
     rep.supportedCtrls = ~0;
     if ( client->swapped ) {
-	register int n;
-	swaps(&rep.sequenceNumber, n);
-	swapl(&rep.currentFlags, n);
-	swapl(&rep.currentCtrls, n);
-	swapl(&rep.supportedFlags, n);
-	swapl(&rep.supportedCtrls, n);
+	swaps(&rep.sequenceNumber);
+	swapl(&rep.currentFlags);
+	swapl(&rep.currentCtrls);
+	swapl(&rep.supportedFlags);
+	swapl(&rep.supportedCtrls);
     }
     WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep);
     return Success;
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index dfbf7f2..347f0f8 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -172,10 +172,9 @@ XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN)
         pNKN->time = time;
         pNKN->changed = changed;
         if (clients[i]->swapped) {
-            int n;
-            swaps(&pNKN->sequenceNumber,n);
-            swapl(&pNKN->time,n);
-            swaps(&pNKN->changed,n);
+            swaps(&pNKN->sequenceNumber);
+            swapl(&pNKN->time);
+            swaps(&pNKN->changed);
         }
         WriteToClient(clients[i], sizeof(xEvent), pNKN);
 
@@ -239,11 +238,10 @@ register CARD16	changed,bState;
 	    pSN->changed = changed;
 	    pSN->ptrBtnState = bState;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pSN->sequenceNumber,n);
-		swapl(&pSN->time,n);
-		swaps(&pSN->changed,n);
-		swaps(&pSN->ptrBtnState,n);
+		swaps(&pSN->sequenceNumber);
+		swapl(&pSN->time);
+		swaps(&pSN->changed);
+		swaps(&pSN->ptrBtnState);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pSN);
 	}
@@ -285,10 +283,9 @@ XkbSendMapNotify(DeviceIntPtr kbd, xkbMapNotify *pMN)
         pMN->changed = changed;
 
         if (clients[i]->swapped) {
-            int n;
-            swaps(&pMN->sequenceNumber, n);
-            swapl(&pMN->time, n);
-            swaps(&pMN->changed, n);
+            swaps(&pMN->sequenceNumber);
+            swapl(&pMN->time);
+            swaps(&pMN->changed);
         }
         WriteToClient(clients[i], sizeof(xEvent), pMN);
     }
@@ -413,12 +410,11 @@ Time 		 	time = 0;
 	    pCN->sequenceNumber = interest->client->sequence;
 	    pCN->time = time;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pCN->sequenceNumber,n);
-		swapl(&pCN->changedControls,n);
-		swapl(&pCN->enabledControls,n);
-		swapl(&pCN->enabledControlChanges,n);
-		swapl(&pCN->time,n);
+		swaps(&pCN->sequenceNumber);
+		swapl(&pCN->changedControls);
+		swapl(&pCN->enabledControls);
+		swapl(&pCN->enabledControlChanges);
+		swapl(&pCN->time);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pCN);
 	}
@@ -462,11 +458,10 @@ CARD32		state,changed;
 	    pEv->changed = changed;
 	    pEv->state = state;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
-		swapl(&pEv->changed,n);
-		swapl(&pEv->state,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
+		swapl(&pEv->changed);
+		swapl(&pEv->state);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
@@ -549,13 +544,12 @@ XID		winID = 0;
 	    bn.name = name;
 	    bn.window=  winID;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&bn.sequenceNumber,n);
-		swapl(&bn.time,n);
-		swaps(&bn.pitch,n);
-		swaps(&bn.duration,n);
-		swapl(&bn.name,n);
-		swapl(&bn.window,n);
+		swaps(&bn.sequenceNumber);
+		swapl(&bn.time);
+		swaps(&bn.pitch);
+		swaps(&bn.duration);
+		swapl(&bn.name);
+		swapl(&bn.window);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)&bn);
 	}
@@ -596,11 +590,10 @@ CARD16		sk_delay,db_delay;
 	    pEv->slowKeysDelay = sk_delay;
 	    pEv->debounceDelay = db_delay;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
-		swaps(&pEv->slowKeysDelay,n);
-		swaps(&pEv->debounceDelay,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
+		swaps(&pEv->slowKeysDelay);
+		swaps(&pEv->debounceDelay);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
@@ -644,12 +637,11 @@ CARD32		changedIndicators;
 	    pEv->changedIndicators = changedIndicators;
 	    pEv->changedVirtualMods= changedVirtualMods;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
-		swaps(&pEv->changed,n);
-		swapl(&pEv->changedIndicators,n);
-		swaps(&pEv->changedVirtualMods,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
+		swaps(&pEv->changed);
+		swapl(&pEv->changedIndicators);
+		swaps(&pEv->changedVirtualMods);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
@@ -692,12 +684,11 @@ CARD16		firstSI = 0, nSI = 0, nTotalSI = 0;
 	    pEv->nSI = nSI;
 	    pEv->nTotalSI = nTotalSI;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
-		swaps(&pEv->firstSI,n);
-		swaps(&pEv->nSI,n);
-		swaps(&pEv->nTotalSI,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
+		swaps(&pEv->firstSI);
+		swaps(&pEv->nSI);
+		swaps(&pEv->nTotalSI);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
@@ -739,9 +730,8 @@ Time 		 time = 0;
 	    pEv->sequenceNumber = interest->client->sequence;
 	    pEv->time = time;
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
@@ -791,13 +781,12 @@ CARD16		 reason;
 		pEv->supported= XkbXI_AllFeaturesMask;
 	    }
 	    if ( interest->client->swapped ) {
-		register int n;
-		swaps(&pEv->sequenceNumber,n);
-		swapl(&pEv->time,n);
-		swapl(&pEv->ledsDefined,n);
-		swapl(&pEv->ledState,n);
-		swaps(&pEv->reason,n);
-		swaps(&pEv->supported,n);
+		swaps(&pEv->sequenceNumber);
+		swapl(&pEv->time);
+		swapl(&pEv->ledsDefined);
+		swapl(&pEv->ledState);
+		swaps(&pEv->reason);
+		swaps(&pEv->supported);
 	    }
 	    WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
 	}
diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c
index ffd66b5..fcae918 100644
--- a/xkb/xkbSwap.c
+++ b/xkb/xkbSwap.c
@@ -44,32 +44,28 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 static int
 SProcXkbUseExtension(ClientPtr client)
 {
-register int n;
-
     REQUEST(xkbUseExtensionReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbUseExtensionReq);
-    swaps(&stuff->wantedMajor,n);
-    swaps(&stuff->wantedMinor,n);
+    swaps(&stuff->wantedMajor);
+    swaps(&stuff->wantedMinor);
     return ProcXkbUseExtension(client);
 }
 
 static int
 SProcXkbSelectEvents(ClientPtr client)
 {
-register int n;
-
     REQUEST(xkbSelectEventsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->affectWhich,n);
-    swaps(&stuff->clear,n);
-    swaps(&stuff->selectAll,n);
-    swaps(&stuff->affectMap,n);
-    swaps(&stuff->map,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->affectWhich);
+    swaps(&stuff->clear);
+    swaps(&stuff->selectAll);
+    swaps(&stuff->affectMap);
+    swaps(&stuff->map);
     if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0)  {
 	union {
 	    BOOL	*b;
@@ -113,12 +109,12 @@ register int n;
 	    if (dataLeft<(size*2))
 		return BadLength;
 	    if (size==2) {
-		swaps(&from.c16[0],n);
-		swaps(&from.c16[1],n);
+		swaps(&from.c16[0]);
+		swaps(&from.c16[1]);
 	    }
 	    else if (size==4) {
-		swapl(&from.c32[0],n);
-		swapl(&from.c32[1],n);
+		swapl(&from.c32[0]);
+		swapl(&from.c32[1]);
 	    }
 	    else {
 		size= 2;
@@ -137,128 +133,114 @@ register int n;
 static int
 SProcXkbBell(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbBellReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbBellReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->bellClass,n);
-    swaps(&stuff->bellID,n);
-    swapl(&stuff->name,n);
-    swapl(&stuff->window,n);
-    swaps(&stuff->pitch,n);
-    swaps(&stuff->duration,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->bellClass);
+    swaps(&stuff->bellID);
+    swapl(&stuff->name);
+    swapl(&stuff->window);
+    swaps(&stuff->pitch);
+    swaps(&stuff->duration);
     return ProcXkbBell(client);
 }
 
 static int
 SProcXkbGetState(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetStateReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetStateReq);
-    swaps(&stuff->deviceSpec,n);
+    swaps(&stuff->deviceSpec);
     return ProcXkbGetState(client);
 }
 
 static int
 SProcXkbLatchLockState(ClientPtr client)
 {
-register int 	n;
-
     REQUEST(xkbLatchLockStateReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->groupLatch,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->groupLatch);
     return ProcXkbLatchLockState(client);
 }
 
 static int
 SProcXkbGetControls(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetControlsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetControlsReq);
-    swaps(&stuff->deviceSpec,n);
+    swaps(&stuff->deviceSpec);
     return ProcXkbGetControls(client);
 }
 
 static int
 SProcXkbSetControls(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetControlsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbSetControlsReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->affectInternalVMods,n);
-    swaps(&stuff->internalVMods,n);
-    swaps(&stuff->affectIgnoreLockVMods,n);
-    swaps(&stuff->ignoreLockVMods,n);
-    swaps(&stuff->axOptions,n);
-    swapl(&stuff->affectEnabledCtrls,n);
-    swapl(&stuff->enabledCtrls,n);
-    swapl(&stuff->changeCtrls,n);
-    swaps(&stuff->repeatDelay,n);
-    swaps(&stuff->repeatInterval,n);
-    swaps(&stuff->slowKeysDelay,n);
-    swaps(&stuff->debounceDelay,n);
-    swaps(&stuff->mkDelay,n);
-    swaps(&stuff->mkInterval,n);
-    swaps(&stuff->mkTimeToMax,n);
-    swaps(&stuff->mkMaxSpeed,n);
-    swaps(&stuff->mkCurve,n);
-    swaps(&stuff->axTimeout,n);
-    swapl(&stuff->axtCtrlsMask,n);
-    swapl(&stuff->axtCtrlsValues,n);
-    swaps(&stuff->axtOptsMask,n);
-    swaps(&stuff->axtOptsValues,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->affectInternalVMods);
+    swaps(&stuff->internalVMods);
+    swaps(&stuff->affectIgnoreLockVMods);
+    swaps(&stuff->ignoreLockVMods);
+    swaps(&stuff->axOptions);
+    swapl(&stuff->affectEnabledCtrls);
+    swapl(&stuff->enabledCtrls);
+    swapl(&stuff->changeCtrls);
+    swaps(&stuff->repeatDelay);
+    swaps(&stuff->repeatInterval);
+    swaps(&stuff->slowKeysDelay);
+    swaps(&stuff->debounceDelay);
+    swaps(&stuff->mkDelay);
+    swaps(&stuff->mkInterval);
+    swaps(&stuff->mkTimeToMax);
+    swaps(&stuff->mkMaxSpeed);
+    swaps(&stuff->mkCurve);
+    swaps(&stuff->axTimeout);
+    swapl(&stuff->axtCtrlsMask);
+    swapl(&stuff->axtCtrlsValues);
+    swaps(&stuff->axtOptsMask);
+    swaps(&stuff->axtOptsValues);
     return ProcXkbSetControls(client);
 }
 
 static int
 SProcXkbGetMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->full,n);
-    swaps(&stuff->partial,n);
-    swaps(&stuff->virtualMods,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->full);
+    swaps(&stuff->partial);
+    swaps(&stuff->virtualMods);
     return ProcXkbGetMap(client);
 }
 
 static int
 SProcXkbSetMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->present,n);
-    swaps(&stuff->flags,n);
-    swaps(&stuff->totalSyms,n);
-    swaps(&stuff->totalActs,n);
-    swaps(&stuff->virtualMods,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->present);
+    swaps(&stuff->flags);
+    swaps(&stuff->totalSyms);
+    swaps(&stuff->totalActs);
+    swaps(&stuff->virtualMods);
     return ProcXkbSetMap(client);
 }
 
@@ -266,105 +248,91 @@ register int	n;
 static int
 SProcXkbGetCompatMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetCompatMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->firstSI,n);
-    swaps(&stuff->nSI,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->firstSI);
+    swaps(&stuff->nSI);
     return ProcXkbGetCompatMap(client);
 }
 
 static int
 SProcXkbSetCompatMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetCompatMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->firstSI,n);
-    swaps(&stuff->nSI,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->firstSI);
+    swaps(&stuff->nSI);
     return ProcXkbSetCompatMap(client);
 }
 
 static int
 SProcXkbGetIndicatorState(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetIndicatorStateReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
-    swaps(&stuff->deviceSpec,n);
+    swaps(&stuff->deviceSpec);
     return ProcXkbGetIndicatorState(client);
 }
 
 static int
 SProcXkbGetIndicatorMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetIndicatorMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->which,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->which);
     return ProcXkbGetIndicatorMap(client);
 }
 
 static int
 SProcXkbSetIndicatorMap(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetIndicatorMapReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->which,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->which);
     return ProcXkbSetIndicatorMap(client);
 }
 
 static int
 SProcXkbGetNamedIndicator(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetNamedIndicatorReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->ledClass,n);
-    swaps(&stuff->ledID,n);
-    swapl(&stuff->indicator,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->ledClass);
+    swaps(&stuff->ledID);
+    swapl(&stuff->indicator);
     return ProcXkbGetNamedIndicator(client);
 }
 
 static int
 SProcXkbSetNamedIndicator(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetNamedIndicatorReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->ledClass,n);
-    swaps(&stuff->ledID,n);
-    swapl(&stuff->indicator,n);
-    swaps(&stuff->virtualMods,n);
-    swapl(&stuff->ctrls,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->ledClass);
+    swaps(&stuff->ledID);
+    swapl(&stuff->indicator);
+    swaps(&stuff->virtualMods);
+    swapl(&stuff->ctrls);
     return ProcXkbSetNamedIndicator(client);
 }
 
@@ -372,160 +340,140 @@ register int	n;
 static int
 SProcXkbGetNames(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetNamesReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetNamesReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->which,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->which);
     return ProcXkbGetNames(client);
 }
 
 static int
 SProcXkbSetNames(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetNamesReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->virtualMods,n);
-    swapl(&stuff->which,n);
-    swapl(&stuff->indicators,n);
-    swaps(&stuff->totalKTLevelNames,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->virtualMods);
+    swapl(&stuff->which);
+    swapl(&stuff->indicators);
+    swaps(&stuff->totalKTLevelNames);
     return ProcXkbSetNames(client);
 }
 
 static int
 SProcXkbGetGeometry(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetGeometryReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetGeometryReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->name,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->name);
     return ProcXkbGetGeometry(client);
 }
 
 static int
 SProcXkbSetGeometry(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetGeometryReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->name,n);
-    swaps(&stuff->widthMM,n);
-    swaps(&stuff->heightMM,n);
-    swaps(&stuff->nProperties,n);
-    swaps(&stuff->nColors,n);
-    swaps(&stuff->nDoodads,n);
-    swaps(&stuff->nKeyAliases,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->name);
+    swaps(&stuff->widthMM);
+    swaps(&stuff->heightMM);
+    swaps(&stuff->nProperties);
+    swaps(&stuff->nColors);
+    swaps(&stuff->nDoodads);
+    swaps(&stuff->nKeyAliases);
     return ProcXkbSetGeometry(client);
 }
 
 static int
 SProcXkbPerClientFlags(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbPerClientFlagsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
-    swaps(&stuff->deviceSpec,n);
-    swapl(&stuff->change,n);
-    swapl(&stuff->value,n);
-    swapl(&stuff->ctrlsToChange,n);
-    swapl(&stuff->autoCtrls,n);
-    swapl(&stuff->autoCtrlValues,n);
+    swaps(&stuff->deviceSpec);
+    swapl(&stuff->change);
+    swapl(&stuff->value);
+    swapl(&stuff->ctrlsToChange);
+    swapl(&stuff->autoCtrls);
+    swapl(&stuff->autoCtrlValues);
     return ProcXkbPerClientFlags(client);
 }
 
 static int
 SProcXkbListComponents(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbListComponentsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->maxNames,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->maxNames);
     return ProcXkbListComponents(client);
 }
 
 static int
 SProcXkbGetKbdByName(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetKbdByNameReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->want,n);
-    swaps(&stuff->need,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->want);
+    swaps(&stuff->need);
     return ProcXkbGetKbdByName(client);
 }
 
 static int
 SProcXkbGetDeviceInfo(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbGetDeviceInfoReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->wanted,n);
-    swaps(&stuff->ledClass,n);
-    swaps(&stuff->ledID,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->wanted);
+    swaps(&stuff->ledClass);
+    swaps(&stuff->ledID);
     return ProcXkbGetDeviceInfo(client);
 }
 
 static int
 SProcXkbSetDeviceInfo(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetDeviceInfoReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
-    swaps(&stuff->deviceSpec,n);
-    swaps(&stuff->change,n);
-    swaps(&stuff->nDeviceLedFBs,n);
+    swaps(&stuff->deviceSpec);
+    swaps(&stuff->change);
+    swaps(&stuff->nDeviceLedFBs);
     return ProcXkbSetDeviceInfo(client);
 }
 
 static int
 SProcXkbSetDebuggingFlags(ClientPtr client)
 {
-register int	n;
-
     REQUEST(xkbSetDebuggingFlagsReq);
 
-    swaps(&stuff->length,n);
+    swaps(&stuff->length);
     REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
-    swapl(&stuff->affectFlags,n);
-    swapl(&stuff->flags,n);
-    swapl(&stuff->affectCtrls,n);
-    swapl(&stuff->ctrls,n);
-    swaps(&stuff->msgLength,n);
+    swapl(&stuff->affectFlags);
+    swapl(&stuff->flags);
+    swapl(&stuff->affectCtrls);
+    swapl(&stuff->ctrls);
+    swaps(&stuff->msgLength);
     return ProcXkbSetDebuggingFlags(client);
 }
 
commit c10bad3d3e8ff1b90014770fd470f9c67263e46f
Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Apr 27 19:29:06 2011 -0400

    Silence printf format warnings in helper_exec.c
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index ec84200..8cca28a 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -162,9 +162,9 @@ void
 dump_code(xf86Int10InfoPtr pInt)
 {
     int i;
-    unsigned long lina = SEG_ADR((CARD32), X86_CS, IP);
+    CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
 
-    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina);
+    xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina);
     for (i=0; i<0x10; i++)
 	xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
     xf86ErrorFVerb(3, "\n");
@@ -220,7 +220,7 @@ port_rep_inb(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -1 : 1;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_insb(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 		port, count, base, d_f ? "up" : "down");
     while (count--) {
 	MEM_WB(pInt, dst, x_inb(port));
@@ -236,7 +236,7 @@ port_rep_inw(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -2 : 2;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_insw(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 	     port, count, base, d_f ? "up" : "down");
     while (count--) {
 	MEM_WW(pInt, dst, x_inw(port));
@@ -252,7 +252,7 @@ port_rep_inl(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -4 : 4;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_insl(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 	     port, count, base, d_f ? "up" : "down");
     while (count--) {
 	MEM_WL(pInt, dst, x_inl(port));
@@ -268,7 +268,7 @@ port_rep_outb(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -1 : 1;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_outb(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 	     port, count, base, d_f ? "up" : "down");
     while (count--) {
 	x_outb(port, MEM_RB(pInt, dst));
@@ -284,7 +284,7 @@ port_rep_outw(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -2 : 2;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_outw(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 	     port, count, base, d_f ? "up" : "down");
     while (count--) {
 	x_outw(port, MEM_RW(pInt, dst));
@@ -300,7 +300,7 @@ port_rep_outl(xf86Int10InfoPtr pInt,
     register int inc = d_f ? -4 : 4;
     CARD32 dst = base;
     if (PRINT_PORT && DEBUG_IO_TRACE())
-	ErrorF(" rep_outl(%#x) %ld bytes at %8.8lx %s\n",
+	ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
 	     port, count, base, d_f ? "up" : "down");
     while (count--) {
 	x_outl(port, MEM_RL(pInt, dst));
@@ -410,7 +410,7 @@ x_inl(CARD16 port)
     if (!pciCfg1in(port, &val)) {
 	val = inl(Int10Current->ioBase + port);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" inl(%#x) = %8.8lx\n", port, val);
+	    ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val);
     }
     return val;
 }
@@ -420,7 +420,7 @@ x_outl(CARD16 port, CARD32 val)
 {
     if (!pciCfg1out(port, val)) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" outl(%#x, %8.8lx)\n", port, val);
+	    ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val);
 	outl(Int10Current->ioBase + port, val);
     }
 }
@@ -506,7 +506,7 @@ pciCfg1in(CARD16 addr, CARD32 *val)
 	pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
 			(uint32_t *)val, PCI_OFFSET(PciCfg1Addr));
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val);
+	    ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", PciCfg1Addr, *val);
 	return 1;
     }
     return 0;
@@ -521,7 +521,7 @@ pciCfg1out(CARD16 addr, CARD32 val)
     }
     if (addr == 0xCFC) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_outl(%#lx, %8.8lx)\n", PciCfg1Addr, val);
+	    ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", PciCfg1Addr, val);
 	pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr),
 			val, PCI_OFFSET(PciCfg1Addr));
 	return 1;
@@ -545,7 +545,7 @@ pciCfg1inw(CARD16 addr, CARD16 *val)
 	pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr),
 			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_inw(%#lx) = %4.4x\n", PciCfg1Addr + offset, *val);
+	    ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", PciCfg1Addr + offset, *val);
 	return 1;
     }
     return 0;
@@ -566,7 +566,7 @@ pciCfg1outw(CARD16 addr, CARD16 val)
 	const unsigned offset = addr - 0xCFC;
 
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_outw(%#lx, %4.4x)\n", PciCfg1Addr + offset, val);
+	    ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", PciCfg1Addr + offset, val);
 	pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr),
 			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	return 1;
@@ -590,7 +590,7 @@ pciCfg1inb(CARD16 addr, CARD8 *val)
 	pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr),
 			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_inb(%#lx) = %2.2x\n", PciCfg1Addr + offset, *val);
+	    ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", PciCfg1Addr + offset, *val);
 	return 1;
     }
     return 0;
@@ -611,7 +611,7 @@ pciCfg1outb(CARD16 addr, CARD8 val)
 	const unsigned offset = addr - 0xCFC;
 
 	if (PRINT_PORT && DEBUG_IO_TRACE())
-	    ErrorF(" cfg_outb(%#lx, %2.2x)\n", PciCfg1Addr + offset, val);
+	    ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", PciCfg1Addr + offset, val);
 	pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr),
 			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	return 1;
commit 9eab5b3443a1926a29385948acc6c5e0843465ea
Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Apr 27 18:25:27 2011 -0400

    Replace Fabs() macro with fabs() function
    
    gcc generates better code with fabs() anyway.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/include/misc.h b/include/misc.h
index bdcc8cc..4849257 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -139,9 +139,6 @@ typedef struct _xReq *xReqPtr;
  * it in case we haven't done that yet.
  */
 #include <stdlib.h>
-#ifndef Fabs
-#define Fabs(a) ((a) > 0.0 ? (a) : -(a))	/* floating absolute value */
-#endif
 #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
 /* this assumes b > 0 */
 #define modulus(a, b, d)    if (((d) = (a) % (b)) < 0) (d) += (b)
diff --git a/mi/miarc.c b/mi/miarc.c
index 881e0db..cd870fa 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1487,7 +1487,7 @@ miDatan2 (double dy, double dx)
 	if (dy > 0)
 	    return 90.0;
 	return -90.0;
-    } else if (Fabs (dy) == Fabs (dx)) {
+    } else if (fabs (dy) == fabs (dx)) {
 	if (dy > 0) {
 	    if (dx > 0)
 		return 45.0;
diff --git a/mi/mifpoly.h b/mi/mifpoly.h
index ffd19a3..cc779c9 100644
--- a/mi/mifpoly.h
+++ b/mi/mifpoly.h
@@ -51,12 +51,12 @@ SOFTWARE.
 #include <X11/Xfuncproto.h>
 
 #define EPSILON	0.000001
-#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON)
-#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON)
+#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON)
+#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON)
 #define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
 					     (b) - (a) <= 0.5)
 #define ROUNDTOINT(x)   ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
-#define ISZERO(x) 	(Fabs((x)) <= EPSILON)
+#define ISZERO(x) 	(fabs((x)) <= EPSILON)
 #define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
 #define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
 #define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
diff --git a/mi/miwideline.c b/mi/miwideline.c
index bc5ee74..057339d 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -322,7 +322,7 @@ miPolyBuildEdge (
     {
 	double	realk, kerror;
     	realk = x0 * dy - y0 * dx;
-    	kerror = Fabs (realk - k);
+	kerror = fabs (realk - k);
     	if (kerror > .1)
 	    printf ("realk: %g k: %g\n", realk, k);
     }
commit 40a47bd628f525d2d8bd3ca76554089a6e9d2a1d
Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Apr 27 14:19:41 2011 -0400

    Remove unnecessary #undefs of [f]abs and old comments
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/glx/glxserver.h b/glx/glxserver.h
index 891315b..6bcf7d3 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -46,12 +46,6 @@
 #include <resource.h>
 #include <scrnintstr.h>
 
-/*
-** The X header misc.h defines these math functions.
-*/
-#undef abs
-#undef fabs
-
 #define GL_GLEXT_PROTOTYPES /* we want prototypes */
 #include <GL/gl.h>
 #include <GL/glxproto.h>
diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
index cd833f8..03e95b8 100644
--- a/hw/dmx/glxProxy/glxserver.h
+++ b/hw/dmx/glxProxy/glxserver.h
@@ -42,12 +42,6 @@
 #include <scrnintstr.h>
 
 
-/*
-** The X header misc.h defines these math functions.
-*/
-#undef abs
-#undef fabs
-
 #define GL_GLEXT_PROTOTYPES /* we want prototypes */
 #include <GL/gl.h>
 #include <GL/glxproto.h>


More information about the Xquartz-changes mailing list