[PATCH] Clean up after removal of screen parameters from region macros.

Jamey Sharp jamey at minilop.net
Fri May 21 21:59:02 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
This patch depends on Keith's change-region-api series.

Jeremy, I'd be curious to see a clang run with this series applied,
since that was the immediate motivation for it.

After hand-inspecting about 1,500 references to the region functions,
I'm not going to be excited about bikeshedding. Please, just don't. :-)

 Xext/panoramiXprocs.c            |   13 ++++------
 Xext/shape.c                     |   14 ++---------
 Xext/xace.c                      |    3 --
 damageext/damageext.c            |    2 -
 dix/dispatch.c                   |   13 ++++------
 dix/events.c                     |   38 ++++++++++++-------------------
 dix/window.c                     |   46 ++++++++-----------------------------
 fb/fb.h                          |    3 +-
 fb/fbglyph.c                     |    2 -
 fb/fboverlay.c                   |   28 +++++++++--------------
 hw/dmx/dmxpixmap.c               |    3 +-
 hw/xfree86/common/xf86xv.c       |   21 -----------------
 hw/xfree86/shadowfb/shadow.c     |   26 ++++++++-------------
 hw/xnest/Window.c                |   18 +++++----------
 hw/xwin/winmultiwindowshape.c    |    5 +---
 hw/xwin/winwindow.c              |    1 -
 hw/xwin/winwindowswm.c           |    2 -
 mi/mi.h                          |    1 -
 mi/micopy.c                      |    3 +-
 mi/miexpose.c                    |    4 ---
 mi/migc.c                        |    8 +-----
 mi/mioverlay.c                   |   26 +++++++--------------
 mi/mivaltree.c                   |   14 +++++------
 mi/miwindow.c                    |   15 +-----------
 miext/damage/damage.c            |    3 +-
 miext/rootless/rootlessCommon.c  |    7 +++--
 miext/rootless/rootlessValTree.c |   19 +++++----------
 miext/rootless/rootlessWindow.c  |   15 +----------
 render/mirect.c                  |    3 +-
 render/picture.c                 |    8 ++----
 xfixes/region.c                  |    4 +--
 31 files changed, 105 insertions(+), 263 deletions(-)

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 9b39b1a..05c40fe 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -620,10 +620,9 @@ int PanoramiXTranslateCoords(ClientPtr client)
 		 * borderSize
 		 */
 		&& (!wBoundingShape(pWin) ||
-		    PointInRegion(
-					wBoundingShape(pWin), 
-					x - pWin->drawable.x, 
-					y - pWin->drawable.y, &box))
+		    PointInRegion(wBoundingShape(pWin),
+				  x - pWin->drawable.x,
+				  y - pWin->drawable.y, &box))
 		)
             {
 		rep.child = pWin->drawable.id;
@@ -1128,7 +1127,6 @@ int PanoramiXCopyArea(ClientPtr client)
 	}
 
 	if(pGC->graphicsExposures) {
-	    ScreenPtr pScreen = pDst->pScreen;
 	    RegionRec totalReg;
 	    Bool overlap;
 
@@ -1144,7 +1142,7 @@ int PanoramiXCopyArea(ClientPtr client)
 		}
 	    }
 	    RegionValidate(&totalReg, &overlap);
-	    (*pScreen->SendGraphicsExpose)(
+	    (*pDst->pScreen->SendGraphicsExpose)(
 		client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
 	    RegionUninit(&totalReg);
 	}
@@ -1243,7 +1241,6 @@ int PanoramiXCopyPlane(ClientPtr client)
     }
 
     if(pGC->graphicsExposures) {
-	ScreenPtr pScreen = pdstDraw->pScreen;
 	RegionRec totalReg;
 	Bool overlap;
 
@@ -1255,7 +1252,7 @@ int PanoramiXCopyPlane(ClientPtr client)
 	    }
 	}
 	RegionValidate(&totalReg, &overlap);
-	(*pScreen->SendGraphicsExpose)(
+	(*pdstDraw->pScreen->SendGraphicsExpose)(
 		client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
 	RegionUninit(&totalReg);
     }
diff --git a/Xext/shape.c b/Xext/shape.c
index afa1d8f..f7b20b2 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -150,8 +150,6 @@ RegionOperate (
 	int xoff, int yoff,
 	CreateDftPtr create)
 {
-    ScreenPtr	pScreen = pWin->drawable.pScreen;
-
     if (srcRgn && (xoff || yoff))
 	RegionTranslate(srcRgn, xoff, yoff);
     if (!pWin->parent)
@@ -220,7 +218,7 @@ RegionOperate (
     }
     if (srcRgn)
 	RegionDestroy(srcRgn);
-    (*pScreen->SetShape) (pWin);
+    (*pWin->drawable.pScreen->SetShape) (pWin);
     SendShapeNotify (pWin, kind);
     return Success;
 }
@@ -281,7 +279,6 @@ static int
 ProcShapeRectangles (ClientPtr client)
 {
     WindowPtr		pWin;
-    ScreenPtr		pScreen;
     REQUEST(xShapeRectanglesReq);
     xRectangle		*prects;
     int		        nrects, ctype, rc;
@@ -314,7 +311,6 @@ ProcShapeRectangles (ClientPtr client)
 	client->errorValue = stuff->ordering;
         return BadValue;
     }
-    pScreen = pWin->drawable.pScreen;
     nrects = ((stuff->length  << 2) - sizeof(xShapeRectanglesReq));
     if (nrects & 4)
 	return BadLength;
@@ -489,7 +485,6 @@ static int
 ProcShapeCombine (ClientPtr client)
 {
     WindowPtr		pSrcWin, pDestWin;
-    ScreenPtr		pScreen;
     REQUEST(xShapeCombineReq);
     RegionPtr		srcRgn;
     RegionPtr		*destRgn;
@@ -519,7 +514,6 @@ ProcShapeCombine (ClientPtr client)
 	client->errorValue = stuff->destKind;
 	return BadValue;
     }
-    pScreen = pDestWin->drawable.pScreen;
 
     rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
     if (rc != Success)
@@ -541,7 +535,7 @@ ProcShapeCombine (ClientPtr client)
 	client->errorValue = stuff->srcKind;
 	return BadValue;
     }
-    if (pSrcWin->drawable.pScreen != pScreen)
+    if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen)
     {
 	return BadMatch;
     }
@@ -614,7 +608,6 @@ static int
 ProcShapeOffset (ClientPtr client)
 {
     WindowPtr		pWin;
-    ScreenPtr		pScreen;
     REQUEST(xShapeOffsetReq);
     RegionPtr		srcRgn;
     int			rc;
@@ -638,11 +631,10 @@ ProcShapeOffset (ClientPtr client)
 	client->errorValue = stuff->destKind;
 	return BadValue;
     }
-    pScreen = pWin->drawable.pScreen;
     if (srcRgn)
     {
         RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
-        (*pScreen->SetShape) (pWin);
+        (*pWin->drawable.pScreen->SetShape) (pWin);
     }
     SendShapeNotify (pWin, (int)stuff->destKind);
     return Success;
diff --git a/Xext/xace.c b/Xext/xace.c
index 07e3da5..94b5b37 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -243,14 +243,11 @@ XaceCensorImage(
 	unsigned int format,
 	char *pBuf)
 {
-    ScreenPtr pScreen;
     RegionRec imageRegion;  /* region representing x,y,w,h */
     RegionRec censorRegion; /* region to obliterate */
     BoxRec imageBox;
     int nRects;
 
-    pScreen = pDraw->pScreen;
-
     imageBox.x1 = x;
     imageBox.y1 = y;
     imageBox.x2 = x + w;
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 7717a40..83fdd80 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -35,8 +35,6 @@ static RESTYPE		DamageExtWinType;
 static int DamageClientPrivateKeyIndex;
 static DevPrivateKey DamageClientPrivateKey = &DamageClientPrivateKeyIndex;
 
-#define prScreen	screenInfo.screens[0]
-
 static void
 DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
 {
diff --git a/dix/dispatch.c b/dix/dispatch.c
index d47e434..f538090 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1179,14 +1179,12 @@ ProcTranslateCoords(ClientPtr client)
 		 * borderSize
 		 */
 		&& (!wBoundingShape(pWin) ||
-		    PointInRegion(
-					&pWin->borderSize, x, y, &box))
+		    PointInRegion(&pWin->borderSize, x, y, &box))
 		
 		&& (!wInputShape(pWin) ||
-		    PointInRegion(
-				    wInputShape(pWin),
-				    x - pWin->drawable.x,
-				    y - pWin->drawable.y, &box))
+		    PointInRegion(wInputShape(pWin),
+				  x - pWin->drawable.x,
+				  y - pWin->drawable.y, &box))
 		)
             {
 		rep.child = pWin->drawable.id;
@@ -2151,8 +2149,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
 	pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
 	if (pVisibleRegion)
 	{
-	    RegionTranslate(pVisibleRegion,
-			     -pDraw->x, -pDraw->y);
+	    RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y);
 	}
     }
 
diff --git a/dix/events.c b/dix/events.c
index 5f6e196..3847ba0 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -505,8 +505,7 @@ XineramaSetCursorPosition(
     x += panoramiXdataPtr[0].x;
     y += panoramiXdataPtr[0].y;
 
-    if(!PointInRegion(&XineramaScreenRegions[pScreen->myNum],
-								x, y, &box))
+    if(!PointInRegion(&XineramaScreenRegions[pScreen->myNum], x, y, &box))
     {
 	FOR_NSCREENS(i)
 	{
@@ -881,7 +880,6 @@ CheckVirtualMotion(
 static void
 ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
 {
-    ScreenPtr pScreen = pWin->drawable.pScreen;
     SpritePtr pSprite = pDev->spriteInfo->sprite;
 
     if (syncEvents.playingEvents)
@@ -901,7 +899,7 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bo
 	pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
 					       : NullRegion;
         CheckPhysLimits(pDev, pSprite->current, generateEvents,
-                        confineToScreen, pScreen);
+                        confineToScreen, pWin->drawable.pScreen);
     }
 }
 
@@ -2558,11 +2556,10 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
 	int i;
 
 	for(i = 1; i < PanoramiXNumScreens; i++) {
-	   if(PointInRegion(
-			&pSprite->windows[i]->borderSize,
-			x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
-			y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
-			&box))
+	   if(PointInRegion(&pSprite->windows[i]->borderSize,
+			    x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
+			    y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
+			    &box))
 		return TRUE;
 	}
     }
@@ -2606,10 +2603,9 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
 	     */
 	    && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
 	    && (!wInputShape(pWin) ||
-		PointInRegion(
-				wInputShape(pWin),
-				x - pWin->drawable.x,
-				y - pWin->drawable.y, &box))
+		PointInRegion(wInputShape(pWin),
+			      x - pWin->drawable.x,
+			      y - pWin->drawable.y, &box))
 #ifdef ROOTLESS
     /* In rootless mode windows may be offscreen, even when
      * they're in X's stack. (E.g. if the native window system
@@ -2879,9 +2875,9 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
             pSprite->hotLimits.y2 -= yoff;
 
             if (RegionNotEmpty(&pSprite->Reg1))
-                RegionTranslate(&pSprite->Reg1,    xoff, yoff);
+                RegionTranslate(&pSprite->Reg1, xoff, yoff);
             if (RegionNotEmpty(&pSprite->Reg2))
-                RegionTranslate(&pSprite->Reg2,    xoff, yoff);
+                RegionTranslate(&pSprite->Reg2, xoff, yoff);
 
             /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */
             if ((grab = pDev->deviceGrab.grab) && grab->confineTo) {
@@ -3152,7 +3148,6 @@ XineramaPointInWindowIsVisible(
     int y
 )
 {
-    ScreenPtr pScreen = pWin->drawable.pScreen;
     BoxRec box;
     int i, xoff, yoff;
 
@@ -3168,16 +3163,14 @@ XineramaPointInWindowIsVisible(
 
     for(i = 1; i < PanoramiXNumScreens; i++) {
 	pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
-	pScreen = pWin->drawable.pScreen;
 	x = xoff - panoramiXdataPtr[i].x;
 	y = yoff - panoramiXdataPtr[i].y;
 
 	if(PointInRegion(&pWin->borderClip, x, y, &box)
 	   && (!wInputShape(pWin) ||
-	       PointInRegion(
-			       wInputShape(pWin),
-			       x - pWin->drawable.x,
-			       y - pWin->drawable.y, &box)))
+	       PointInRegion(wInputShape(pWin),
+			     x - pWin->drawable.x,
+			     y - pWin->drawable.y, &box)))
             return TRUE;
 
     }
@@ -3376,8 +3369,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
 	int i;
 
 	for(i = 1; i < PanoramiXNumScreens; i++) {
-	    if(RegionNotEmpty(
-                        &pDev->spriteInfo->sprite->windows[i]->borderSize))
+	    if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize))
 		return TRUE;
 	}
      }
diff --git a/dix/window.c b/dix/window.c
index c53079d..f5b0ef3 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -496,12 +496,8 @@ ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
                      int x, int y,
                      int w, int h)
 {
-    ScreenPtr pScreen;
-    BoxRec box;
-
-    pScreen = pWin->drawable.pScreen;
+    BoxRec box = *RegionExtents(&pWin->winSize);
 
-    box = *(RegionExtents(&pWin->winSize));
     /* we do these calculations to avoid overflows */
     if (x > box.x1)
 	box.x1 = x;
@@ -1592,9 +1588,6 @@ SetWinSize (WindowPtr pWin)
 			 (int)pWin->drawable.width,
 			 (int)pWin->drawable.height);
     if (wBoundingShape (pWin) || wClipShape (pWin)) {
-	ScreenPtr pScreen;
-        pScreen = pWin->drawable.pScreen;
-
 	RegionTranslate(&pWin->winSize, - pWin->drawable.x,
 			 - pWin->drawable.y);
 	if (wBoundingShape (pWin))
@@ -1637,9 +1630,6 @@ SetBorderSize (WindowPtr pWin)
 		(int)(pWin->drawable.width + (bw<<1)),
 		(int)(pWin->drawable.height + (bw<<1)));
 	if (wBoundingShape (pWin)) {
-	    ScreenPtr pScreen;
-            pScreen = pWin->drawable.pScreen;
-
 	    RegionTranslate(&pWin->borderSize, - pWin->drawable.x,
 			     - pWin->drawable.y);
 	    RegionIntersect(&pWin->borderSize, &pWin->borderSize,
@@ -1650,8 +1640,7 @@ SetBorderSize (WindowPtr pWin)
 			 &pWin->winSize);
 	}
     } else {
-	RegionCopy(&pWin->borderSize,
-					       &pWin->winSize);
+	RegionCopy(&pWin->borderSize, &pWin->winSize);
     }
 }
 
@@ -1846,17 +1835,11 @@ MakeBoundingRegion (
     WindowPtr	pWin,
     BoxPtr	pBox)
 {
-    RegionPtr	pRgn;
-    ScreenPtr   pScreen;
-    pScreen = pWin->drawable.pScreen;
-
-    pRgn = RegionCreate(pBox, 1);
+    RegionPtr	pRgn = RegionCreate(pBox, 1);
     if (wBoundingShape (pWin)) {
-	    RegionTranslate(pRgn, -pWin->origin.x,
-						  -pWin->origin.y);
-	    RegionIntersect(pRgn, pRgn, wBoundingShape (pWin));
-	    RegionTranslate(pRgn, pWin->origin.x,
-						  pWin->origin.y);
+	RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y);
+	RegionIntersect(pRgn, pRgn, wBoundingShape (pWin));
+	RegionTranslate(pRgn, pWin->origin.x, pWin->origin.y);
     }
     return pRgn;
 }
@@ -1869,12 +1852,10 @@ ShapeOverlap (
     BoxPtr	pSibBox)
 {
     RegionPtr	pWinRgn, pSibRgn;
-    ScreenPtr	pScreen;
     Bool	ret;
 
     if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib))
 	return TRUE;
-    pScreen = pWin->drawable.pScreen;
     pWinRgn = MakeBoundingRegion (pWin, pWinBox);
     pSibRgn = MakeBoundingRegion (pSib, pSibBox);
     RegionIntersect(pWinRgn, pWinRgn, pSibRgn);
@@ -1970,7 +1951,6 @@ WhereDoIGoInTheStack(
     int smode)
 {
     BoxRec box;
-    ScreenPtr pScreen;
     WindowPtr pHead, pFirst;
 
     if ((pWin == pWin->parent->firstChild) &&
@@ -1978,7 +1958,6 @@ WhereDoIGoInTheStack(
 	return((WindowPtr ) NULL);
     pHead = RealChildHead(pWin->parent);
     pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild;
-    pScreen = pWin->drawable.pScreen;
     box.x1 = x;
     box.y1 = y;
     box.x2 = x + (int)w;
@@ -3015,10 +2994,9 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y)
     if (PointInRegion(&pWin->borderClip,
 						  x, y, &box)
 	&& (!wInputShape(pWin) ||
-	    PointInRegion(
-			    wInputShape(pWin),
-			    x - pWin->drawable.x, 
-			    y - pWin->drawable.y, &box)))
+	    PointInRegion(wInputShape(pWin),
+			  x - pWin->drawable.x,
+			  y - pWin->drawable.y, &box)))
 	return(TRUE);
     return(FALSE);
 }
@@ -3027,11 +3005,7 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y)
 RegionPtr
 NotClippedByChildren(WindowPtr pWin)
 {
-    ScreenPtr pScreen;
-    RegionPtr pReg;
-
-    pScreen = pWin->drawable.pScreen;
-    pReg = RegionCreate(NullBox, 1);
+    RegionPtr pReg = RegionCreate(NullBox, 1);
     if (pWin->parent ||
 	screenIsSaved != SCREEN_SAVER_ON ||
 	!HasSaverWindow (pWin->drawable.pScreen->myNum))
diff --git a/fb/fb.h b/fb/fb.h
index 9327800..82e8119 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -739,8 +739,7 @@ typedef struct {
  */
 
 #define fbWindowEnabled(pWin) \
-    RegionNotEmpty(\
-		    &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
+    RegionNotEmpty(&WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
 
 #define fbDrawableEnabled(pDrawable) \
     ((pDrawable)->type == DRAWABLE_PIXMAP ? \
diff --git a/fb/fbglyph.c b/fb/fbglyph.c
index 0d67a9b..53a80c3 100644
--- a/fb/fbglyph.c
+++ b/fb/fbglyph.c
@@ -29,8 +29,6 @@
 #include	<X11/fonts/fontstruct.h>
 #include	"dixfontstr.h"
 
-#define dummyScreen screenInfo.screens[0]
-      
 Bool
 fbGlyphIn (RegionPtr	pRegion,
 	   int		x,
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 392e27f..cb52dc7 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -75,8 +75,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
 	     */
 	    if (!pWin->parent)
 	    {
-		RegionEmpty(
-			      &pScrPriv->layer[i].u.run.region);
+		RegionEmpty(&pScrPriv->layer[i].u.run.region);
 	    }
 	    return TRUE;
 	}
@@ -182,30 +181,25 @@ fbOverlayUpdateLayerRegion (ScreenPtr	pScreen,
 	if (i == layer)
 	{
 	    /* add new piece to this fb */
-	    RegionUnion(
-			  &pScrPriv->layer[i].u.run.region,
-			  &pScrPriv->layer[i].u.run.region,
-			  prgn);
+	    RegionUnion(&pScrPriv->layer[i].u.run.region,
+			&pScrPriv->layer[i].u.run.region,
+			prgn);
 	}
-	else if (RegionNotEmpty(
-				  &pScrPriv->layer[i].u.run.region))
+	else if (RegionNotEmpty(&pScrPriv->layer[i].u.run.region))
 	{
 	    /* paint new piece with chroma key */
 	    RegionNull(&rgnNew);
-	    RegionIntersect(
-			      &rgnNew, 
-			      prgn, 
-			      &pScrPriv->layer[i].u.run.region);
+	    RegionIntersect(&rgnNew, prgn,
+			    &pScrPriv->layer[i].u.run.region);
 	    (*pScrPriv->PaintKey) (&pScrPriv->layer[i].u.run.pixmap->drawable,
 				   &rgnNew,
 				   pScrPriv->layer[i].key,
 				   i);
 	    RegionUninit(&rgnNew);
 	    /* remove piece from other fbs */
-	    RegionSubtract(
-			     &pScrPriv->layer[i].u.run.region,
-			     &pScrPriv->layer[i].u.run.region,
-			     prgn);
+	    RegionSubtract(&pScrPriv->layer[i].u.run.region,
+			   &pScrPriv->layer[i].u.run.region,
+			   prgn);
 	}
     }
 }
@@ -219,7 +213,7 @@ fbOverlayCopyWindow(WindowPtr	pWin,
 		    RegionPtr	prgnSrc)
 {
     ScreenPtr		pScreen = pWin->drawable.pScreen;
-    FbOverlayScrPrivPtr	pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen);
+    FbOverlayScrPrivPtr	pScrPriv = fbOverlayGetScrPriv(pScreen);
     RegionRec		rgnDst;
     int			dx, dy;
     int			i;
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index a64cbd0..580c31a 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -190,8 +190,7 @@ Bool dmxDestroyPixmap(PixmapPtr pPixmap)
  *  pPixmap. */
 RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
 {
-    ScreenPtr      pScreen = pPixmap->drawable.pScreen;
-    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+    DMXScreenInfo *dmxScreen = &dmxScreens[pPixmap->drawable.pScreen->myNum];
     dmxPixPrivPtr  pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
     XImage        *ximage;
     RegionPtr      pReg, pTmpReg;
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index b6642a3..edad328 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -636,14 +636,12 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
 {
    RegionPtr	pregWin, pCompositeClip;
    WindowPtr	pWin;
-   ScreenPtr	pScreen;
    Bool		freeCompClip = FALSE;
 
    if(portPriv->pCompositeClip)
 	return;
 
    pWin = (WindowPtr)portPriv->pDraw;
-   pScreen = pWin->drawable.pScreen;
 
    /* get window clip list */
    if(portPriv->subWindowMode == IncludeInferiors) {
@@ -709,11 +707,9 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
-  ScreenPtr pScreen;
   int ret = Success;
   Bool clippedAway = FALSE;
 
-  pScreen = portPriv->pDraw->pScreen;
   xf86XVUpdateCompositeClip(portPriv);
 
   /* translate the video region to the screen */
@@ -773,12 +769,9 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
-  ScreenPtr pScreen;
   int ret = Success;
   Bool clippedAway = FALSE;
 
-  pScreen = portPriv->pDraw->pScreen;
-
   xf86XVUpdateCompositeClip(portPriv);
 
   /* translate the video region to the screen */
@@ -863,12 +856,9 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
-  ScreenPtr pScreen;
   int ret = Success;
   Bool clippedAway = FALSE;
 
-  pScreen = portPriv->pDraw->pScreen;
-
   xf86XVUpdateCompositeClip(portPriv);
 
   /* translate the video region to the screen */
@@ -1413,7 +1403,6 @@ xf86XVPutStill(
    CARD16 drw_w, CARD16 drw_h
 ){
   XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-  ScreenPtr pScreen;
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
@@ -1425,8 +1414,6 @@ xf86XVPutStill(
 
   if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
 
-  pScreen = pDraw->pScreen;
-
   WinBox.x1 = pDraw->x + drw_x;
   WinBox.y1 = pDraw->y + drw_y;
   WinBox.x2 = WinBox.x1 + drw_w;
@@ -1565,7 +1552,6 @@ xf86XVGetStill(
    CARD16 drw_w, CARD16 drw_h
 ){
   XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-  ScreenPtr pScreen;
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
@@ -1577,8 +1563,6 @@ xf86XVGetStill(
 
   if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
 
-  pScreen = pDraw->pScreen;
-
   WinBox.x1 = pDraw->x + drw_x;
   WinBox.y1 = pDraw->y + drw_y;
   WinBox.x2 = WinBox.x1 + drw_w;
@@ -1713,7 +1697,6 @@ xf86XVPutImage(
    CARD16 width, CARD16 height
 ){
   XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-  ScreenPtr pScreen;
   RegionRec WinRegion;
   RegionRec ClipRegion;
   BoxRec WinBox;
@@ -1725,8 +1708,6 @@ xf86XVPutImage(
 
   if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
 
-  pScreen = pDraw->pScreen;
-
   WinBox.x1 = pDraw->x + drw_x;
   WinBox.y1 = pDraw->y + drw_y;
   WinBox.x2 = WinBox.x1 + drw_w;
@@ -1921,8 +1902,6 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
    boundaries in 16.16 fixed point.
 */
 
-#define DummyScreen screenInfo.screens[0]
-
 Bool
 xf86XVClipVideoHelper(
     BoxPtr dst,
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
index a0e4b9e..1703c70 100644
--- a/hw/xfree86/shadowfb/shadow.c
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -1353,38 +1353,32 @@ ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y,
 	}
 	right += pFont->info.maxbounds.rightSideBearing;
 	BB->x1 =
-	    max(pDrawable->x + x - left, (RegionExtents(
-		&((WindowPtr) pDrawable)->winSize))->x1);
+	    max(pDrawable->x + x - left,
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->x1);
 	BB->y1 =
 	    max(pDrawable->y + y - ascent,
-	    (RegionExtents(
-             &((WindowPtr) pDrawable)->winSize))->y1);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->y1);
 	BB->x2 =
 	    min(pDrawable->x + x + right,
-	    (RegionExtents(
-             &((WindowPtr) pDrawable)->winSize))->x2);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->x2);
 	BB->y2 =
 	    min(pDrawable->y + y + descent,
-	    (RegionExtents(
-             &((WindowPtr) pDrawable)->winSize))->y2);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->y2);
     } else {
     	ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
                          ? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
 	BB->x1 =
-	    max(pDrawable->x + x + BB->x1, (RegionExtents(
-		&((WindowPtr) pDrawable)->winSize))->x1);
+	    max(pDrawable->x + x + BB->x1,
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->x1);
 	BB->y1 =
 	    max(pDrawable->y + y + BB->y1,
-	    (RegionExtents(
-             &((WindowPtr) pDrawable)->winSize))->y1);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->y1);
 	BB->x2 =
 	    min(pDrawable->x + x + BB->x2,
-	    (RegionExtents(
-	     &((WindowPtr) pDrawable)->winSize))->x2);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->x2);
 	BB->y2 =
 	    min(pDrawable->y + y + BB->y2,
-	    (RegionExtents(
-	     &((WindowPtr) pDrawable)->winSize))->y2);
+		RegionExtents(&((WindowPtr) pDrawable)->winSize)->y2);
     }
 }
 
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index 5006605..fe970aa 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -151,10 +151,8 @@ xnestDestroyWindow(WindowPtr pWin)
   if (pWin->nextSib)
     xnestWindowPriv(pWin->nextSib)->sibling_above = 
       xnestWindowPriv(pWin)->sibling_above;
-  RegionDestroy(
-				xnestWindowPriv(pWin)->bounding_shape);
-  RegionDestroy(
-				xnestWindowPriv(pWin)->clip_shape);
+  RegionDestroy(xnestWindowPriv(pWin)->bounding_shape);
+  RegionDestroy(xnestWindowPriv(pWin)->clip_shape);
   XDestroyWindow(xnestDisplay, xnestWindow(pWin));
   xnestWindowPriv(pWin)->window = None;
 
@@ -466,8 +464,7 @@ xnestShapeWindow(WindowPtr pWin)
 			wBoundingShape(pWin))) {
     
     if (wBoundingShape(pWin)) {
-      RegionCopy(
-		xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin));
+      RegionCopy(xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin));
       
       reg = XCreateRegion();
       pBox = RegionRects(xnestWindowPriv(pWin)->bounding_shape);
@@ -485,8 +482,7 @@ xnestShapeWindow(WindowPtr pWin)
       XDestroyRegion(reg);
     }
     else {
-      RegionEmpty(
-				xnestWindowPriv(pWin)->bounding_shape);
+      RegionEmpty(xnestWindowPriv(pWin)->bounding_shape);
       
       XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
 			ShapeBounding, 0, 0, None, ShapeSet);
@@ -497,8 +493,7 @@ xnestShapeWindow(WindowPtr pWin)
 			wClipShape(pWin))) {
     
     if (wClipShape(pWin)) {
-      RegionCopy(
-			xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin));
+      RegionCopy(xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin));
       
       reg = XCreateRegion();
       pBox = RegionRects(xnestWindowPriv(pWin)->clip_shape);
@@ -516,8 +511,7 @@ xnestShapeWindow(WindowPtr pWin)
       XDestroyRegion(reg);
     }
     else {
-      RegionEmpty(
-				     xnestWindowPriv(pWin)->clip_shape);
+      RegionEmpty(xnestWindowPriv(pWin)->clip_shape);
       
       XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
 			ShapeClip, 0, 0, None, ShapeSet);
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
index fb43ba0..5b68e9c 100644
--- a/hw/xwin/winmultiwindowshape.c
+++ b/hw/xwin/winmultiwindowshape.c
@@ -119,10 +119,7 @@ winReshapeMultiWindow (WindowPtr pWin)
 
   RegionNull(&rrNewShape);
   RegionCopy(&rrNewShape, wBoundingShape(pWin));
-  RegionTranslate(
-		   &rrNewShape,
-		   pWin->borderWidth,
-                   pWin->borderWidth);
+  RegionTranslate(&rrNewShape, pWin->borderWidth, pWin->borderWidth);
   
   nRects = RegionNumRects(&rrNewShape);
   pShape = RegionRects(&rrNewShape);
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index facdd53..6ef861b 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -564,7 +564,6 @@ void
 winReshapeRootless (WindowPtr pWin)
 {
   int		nRects;
-  /* ScreenPtr	pScreen = pWin->drawable.pScreen;*/
   RegionRec	rrNewShape;
   BoxPtr	pShape, pRects, pEnd;
   HRGN		hRgn, hRgnRect;
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 5935ac4..34d7f4b 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -425,7 +425,6 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
   RECT rcNew;
   int nCmdShow, rc;
   RegionRec newShape;
-  ScreenPtr pScreen;
 
   REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
 
@@ -491,7 +490,6 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
 
   if (wBoundingShape(pWin) != NULL)
     {
-      pScreen = pWin->drawable.pScreen;
       /* wBoundingShape is relative to *inner* origin of window.
 	 Translate by borderWidth to get the outside-relative position. */
       
diff --git a/mi/mi.h b/mi/mi.h
index 94ad5fa..32f0fbd 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -463,7 +463,6 @@ extern _X_EXPORT DevPrivateKey miAllocateGCPrivateIndex(
 /* mivaltree.c */
 
 extern _X_EXPORT int miShapedWindowIn(
-    ScreenPtr /*pScreen*/,
     RegionPtr /*universe*/,
     RegionPtr /*bounding*/,
     BoxPtr /*rect*/,
diff --git a/mi/micopy.c b/mi/micopy.c
index 157e324..b1a7a08 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -209,8 +209,7 @@ miDoCopy (DrawablePtr	pSrcDrawable,
 	     * VT is inactive, make sure the region isn't empty
 	     */
 	    if (!((WindowPtr) pSrcDrawable)->parent &&
-		RegionNotEmpty(
-				 &((WindowPtr) pSrcDrawable)->borderClip))
+		RegionNotEmpty(&((WindowPtr) pSrcDrawable)->borderClip))
 	    {
 		/*
 		 * special case bitblt from root window in
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 3eff56c..1455ead 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -131,7 +131,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 		  GCPtr pGC, int srcx, int srcy, int width, int height,
 		  int dstx, int dsty, unsigned long plane)
 {
-    ScreenPtr pscr;
     RegionPtr prgnSrcClip;	/* drawable-relative source clip */
     RegionRec rgnSrcRec;
     RegionPtr prgnDstClip;	/* drawable-relative dest clip */
@@ -148,9 +147,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
     BoxRec expBox;
     Bool extents;
 
-    /* This prevents warning about pscr not being used. */
-    pGC->pScreen = pscr = pGC->pScreen;
-
     /* avoid work if we can */
     if (!pGC->graphicsExposures &&
 	(pDstDrawable->type == DRAWABLE_PIXMAP) &&
diff --git a/mi/migc.c b/mi/migc.c
index 7f25ae3..434f3a7 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -117,8 +117,7 @@ miCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
 	break;
       case CT_REGION:
 	prgnNew = RegionCreate(NULL, 1);
-	RegionCopy(prgnNew,
-					(RegionPtr) (pgcSrc->clientClip));
+	RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip));
 	(*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0);
 	break;
     }
@@ -134,11 +133,6 @@ miCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst)
 void
 miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable)
 {
-    ScreenPtr       pScreen;
-
-    /* This prevents warnings about pScreen not being used. */
-    pGC->pScreen = pScreen = pGC->pScreen;
-
     if (pDrawable->type == DRAWABLE_WINDOW)
     {
 	WindowPtr       pWin = (WindowPtr) pDrawable;
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 83ad0fe..9e0c74c 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -325,7 +325,6 @@ miOverlayMarkOverlappedWindows(
     WindowPtr pFirst,
     WindowPtr *pLayerWin
 ){
-    ScreenPtr pScreen = pWin->drawable.pScreen;
     WindowPtr pChild, pLast;
     Bool overMarked, underMarked, doUnderlay, markAll;
     miOverlayTreePtr pTree = NULL, tLast, tChild;
@@ -436,6 +435,7 @@ miOverlayMarkOverlappedWindows(
     }
 
     if(underMarked) {
+	ScreenPtr pScreen = pWin->drawable.pScreen;
 	MARK_UNDERLAY(pTree->parent->pWin);
 	MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->underlayMarked = TRUE;	
     }
@@ -482,7 +482,7 @@ miOverlayComputeClips(
 		RegionPtr   pBounding;
 
 		if ((pBounding = wBoundingShape (pParent))) {
-		    switch (miShapedWindowIn (pScreen, universe, pBounding,
+		    switch (miShapedWindowIn (universe, pBounding,
 					      &borderSize,
 					      pParent->drawable.x,
  					      pParent->drawable.y))
@@ -531,10 +531,9 @@ miOverlayComputeClips(
 		    if (tChild->valdata) {
 			RegionNull(&tChild->valdata->borderExposed);
 			if (HasParentRelativeBorder(tChild->pWin)){
-			    RegionSubtract(
-					 &tChild->valdata->borderExposed,
-					 &tChild->borderClip,
-					 &tChild->pWin->winSize);
+			    RegionSubtract(&tChild->valdata->borderExposed,
+					   &tChild->borderClip,
+					   &tChild->pWin->winSize);
 			}
 			RegionNull(&tChild->valdata->exposed);
 		    }
@@ -1000,7 +999,6 @@ miOverlayWindowExposures(
     RegionPtr other_exposed
 ){
     RegionPtr   exposures = prgn;
-    ScreenPtr pScreen = pWin->drawable.pScreen;
 
     if ((prgn && !RegionNil(prgn)) ||
 	(exposures && !RegionNil(exposures)) || other_exposed)
@@ -1021,6 +1019,7 @@ miOverlayWindowExposures(
 	if (clientInterested && exposures && 
 	   (RegionNumRects(exposures) > RECTLIMIT))
 	{
+	    ScreenPtr pScreen = pWin->drawable.pScreen;
             miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
 	    BoxRec box;
 
@@ -1070,13 +1069,9 @@ miOverlayRecomputeExposures (
     WindowPtr	pWin,
     pointer	value 
 ){
-    ScreenPtr pScreen;
     miOverlayTwoRegions	*pValid = (miOverlayTwoRegions*)value;
     miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
 
-    /* This prevents warning about pScreen not being used. */
-    pWin->drawable.pScreen = pScreen = pWin->drawable.pScreen;
-
     if (pWin->valdata) {
 	/*
 	 * compute exposed regions of this window
@@ -1415,13 +1410,11 @@ miOverlayResizeWindow(
 	    if (oldpt.x != x || oldpt.y != y) {
 		if(gravitate2[g]) {
 		    pPriv->copyUnderlay = TRUE;
-		    (*pWin->drawable.pScreen->CopyWindow)(
-						pWin, oldpt, gravitate2[g]);
+		    (*pScreen->CopyWindow)(pWin, oldpt, gravitate2[g]);
 		}
 		if(gravitate[g]) {
 		    pPriv->copyUnderlay = FALSE;
-		    (*pWin->drawable.pScreen->CopyWindow)(
-						pWin, oldpt, gravitate[g]);
+		    (*pScreen->CopyWindow)(pWin, oldpt, gravitate[g]);
 		}
 	    }
 
@@ -1724,7 +1717,6 @@ miOverlayCopyUnderlay(ScreenPtr pScreen)
 void
 miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
 {
-    ScreenPtr       pScreen = pGC->pScreen;
     miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
     RegionPtr       pregWin;
     Bool            freeTmpClip, freeCompClip;
@@ -1738,7 +1730,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
 	pregWin = RegionCreate(NullBox, 1);
 	freeTmpClip = TRUE;
 	if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) ||
-		!HasSaverWindow (pScreen->myNum))
+		!HasSaverWindow (pGC->pScreen->myNum))
 	{
             RegionIntersect(pregWin,&pTree->borderClip,&pWin->winSize);
 	}
diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index b94c7dd..b9674ce 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -107,7 +107,7 @@ Equipment Corporation.
  * Compute the visibility of a shaped window
  */
 int
-miShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, RegionPtr bounding,
+miShapedWindowIn (RegionPtr universe, RegionPtr bounding,
                   BoxPtr rect, int x, int y)
 {
     BoxRec  	box;
@@ -272,7 +272,7 @@ miComputeClips (
 
 		if ((pBounding = wBoundingShape (pParent)))
 		{
-		    switch (miShapedWindowIn (pScreen, universe, pBounding,
+		    switch (miShapedWindowIn (universe, pBounding,
 					      &borderSize,
 					      pParent->drawable.x,
  					      pParent->drawable.y))
@@ -331,14 +331,12 @@ miComputeClips (
 		    }
 		    if (pChild->valdata)
 		    {
-			RegionNull(
-				    &pChild->valdata->after.borderExposed);
+			RegionNull(&pChild->valdata->after.borderExposed);
 			if (HasParentRelativeBorder(pChild))
 			{
-			    RegionSubtract(
-					 &pChild->valdata->after.borderExposed,
-					 &pChild->borderClip,
-					 &pChild->winSize);
+			    RegionSubtract(&pChild->valdata->after.borderExposed,
+					   &pChild->borderClip,
+					   &pChild->winSize);
 			}
 			RegionNull(&pChild->valdata->after.exposed);
 		    }
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 23dfc55..177379b 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -66,7 +66,6 @@ miClearToBackground(WindowPtr pWin,
     BoxRec box;
     RegionRec	reg;
     RegionPtr pBSReg = NullRegion;
-    ScreenPtr	pScreen;
     BoxPtr  extents;
     int	    x1, y1, x2, y2;
 
@@ -110,12 +109,11 @@ miClearToBackground(WindowPtr pWin,
     box.y1 = y1;
     box.y2 = y2;
 
-    pScreen = pWin->drawable.pScreen;
     RegionInit(&reg, &box, 1);
 
     RegionIntersect(&reg, &reg, &pWin->clipList);
     if (generateExposures)
-	(*pScreen->WindowExposures)(pWin, &reg, pBSReg);
+	(*pWin->drawable.pScreen->WindowExposures)(pWin, &reg, pBSReg);
     else if (pWin->backgroundState != None)
 	miPaintWindow(pWin, &reg, PW_BACKGROUND);
     RegionUninit(&reg);
@@ -145,9 +143,6 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin)
     WindowPtr pChild, pLast;
     Bool anyMarked = FALSE;
     MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow;
-    ScreenPtr pScreen;
-
-    pScreen = pWin->drawable.pScreen;
 
     /* single layered systems are easy */
     if (ppLayerWin) *ppLayerWin = pWin;
@@ -229,11 +224,8 @@ miHandleValidateExposures(WindowPtr pWin)
 {
     WindowPtr pChild;
     ValidatePtr val;
-    ScreenPtr pScreen;
     WindowExposuresProcPtr WindowExposures;
 
-    pScreen = pWin->drawable.pScreen;
-
     pChild = pWin;
     WindowExposures = pChild->drawable.pScreen->WindowExposures;
     while (1)
@@ -338,7 +330,6 @@ miRecomputeExposures (
     WindowPtr	pWin,
     pointer		value) /* must conform to VisitWindowProcPtr */
 {
-    ScreenPtr	pScreen;
     RegionPtr	pValid = (RegionPtr)value;
 
     if (pWin->valdata)
@@ -352,7 +343,6 @@ miRecomputeExposures (
 	if (pWin->redirectDraw != RedirectDrawNone)
 	    return WT_DONTWALKCHILDREN;
 #endif
-	pScreen = pWin->drawable.pScreen;
 	/*
 	 * compute exposed regions of this window
 	 */
@@ -820,11 +810,8 @@ miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure)
 void
 miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth)
 {
-    ScreenPtr pScreen;
     WindowPtr pChild;
 
-    pScreen = pWin->drawable.pScreen;
-
     for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
     {
 	if (pChild->drawable.depth == depth)
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 935b1c0..8903b2f 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -593,8 +593,7 @@ damageDestroyClip(GCPtr pGC)
 
 #define checkGCDamage(d,g)	(getDrawableDamage(d) && \
 				 (!g->pCompositeClip ||\
-				  RegionNotEmpty(\
-						  g->pCompositeClip)))
+				  RegionNotEmpty(g->pCompositeClip)))
 
 #define TRIM_PICTURE_BOX(box, pDst) { \
     BoxPtr extents = &pDst->pCompositeClip->extents;\
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 32694a6..e79093b 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -262,7 +262,6 @@ void RootlessStopDrawing(WindowPtr pWindow, Bool flush)
 void
 RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
 {
-    ScreenPtr pScreen = pWindow->drawable.pScreen;
     RootlessWindowRec *winRec;
     RegionRec clipped;
     WindowPtr pTop;
@@ -307,7 +306,8 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
                 RegionUnion(&winRec->damage,
                                  &winRec->damage, (pRegion));
 #else
-                SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
+                SCREENREC(pWindow->drawable.pScreen)->imp->
+                    DamageRects(winRec->wid,
                                 RegionNumRects(pRegion),
                                 RegionRects(pRegion),
                                 -winRec->x, -winRec->y);
@@ -332,7 +332,8 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
         RegionUnion(&winRec->damage,
                      &winRec->damage, (pRegion));
 #else
-        SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
+        SCREENREC(pWindow->drawable.pScreen)->imp->
+            DamageRects(winRec->wid,
                         RegionNumRects(&clipped),
                         RegionRects(&clipped),
                         -winRec->x, -winRec->y);
diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c
index ccdb43d..fe6eccf 100644
--- a/miext/rootless/rootlessValTree.c
+++ b/miext/rootless/rootlessValTree.c
@@ -104,16 +104,13 @@ Equipment Corporation.
 
 #include    "globals.h"
 
-int RootlessShapedWindowIn (ScreenPtr pScreen, RegionPtr universe,
-			RegionPtr bounding, BoxPtr rect, int x, int y);
-
 int RootlessMiValidateTree (WindowPtr pRoot, WindowPtr pChild, VTKind kind);
 
 /*
  * Compute the visibility of a shaped window
  */
-int
-RootlessShapedWindowIn (ScreenPtr pScreen, RegionPtr universe,
+static int
+RootlessShapedWindowIn (RegionPtr universe,
 			RegionPtr bounding, BoxPtr rect, int x, int y)
 {
     BoxRec  box;
@@ -236,7 +233,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen,
 
 		if ((pBounding = wBoundingShape (pParent)))
 		{
-		    switch (RootlessShapedWindowIn (pScreen, universe, 
+		    switch (RootlessShapedWindowIn (universe,
 						    pBounding, &borderSize,
 						    pParent->drawable.x,
 						    pParent->drawable.y))
@@ -296,14 +293,12 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen,
 		    }
 		    if (pChild->valdata)
 		    {
-			RegionNull(
-				    &pChild->valdata->after.borderExposed);
+			RegionNull(&pChild->valdata->after.borderExposed);
 			if (HasParentRelativeBorder(pChild))
 			  {
-			    RegionSubtract(
-					 &pChild->valdata->after.borderExposed,
-					 &pChild->borderClip,
-					 &pChild->winSize);
+			    RegionSubtract(&pChild->valdata->after.borderExposed,
+					   &pChild->borderClip,
+					   &pChild->winSize);
 			}
 			RegionNull(&pChild->valdata->after.exposed);
 		    }
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 3c81c5f..8443505 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -179,9 +179,7 @@ RootlessCreateWindow(WindowPtr pWin)
 static void
 RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
 {
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-
-    SCREENREC(pScreen)->imp->DestroyFrame(winRec->wid);
+    SCREENREC(pWin->drawable.pScreen)->imp->DestroyFrame(winRec->wid);
 
 #ifdef ROOTLESS_TRACK_DAMAGE
     RegionUninit(&winRec->damage);
@@ -218,14 +216,6 @@ RootlessDestroyWindow(WindowPtr pWin)
 static Bool
 RootlessGetShape(WindowPtr pWin, RegionPtr pShape)
 {
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-
-    /* 
-     * Avoid a warning.  
-     * REGION_NULL and the other macros don't actually seem to use pScreen.
-     */
-    (void)pScreen; 
-
     if (wBoundingShape(pWin) == NULL)
         return FALSE;
 
@@ -247,7 +237,6 @@ RootlessGetShape(WindowPtr pWin, RegionPtr pShape)
 static void RootlessReshapeFrame(WindowPtr pWin)
 {
     RootlessWindowRec *winRec = WINREC(pWin);
-    ScreenPtr pScreen = pWin->drawable.pScreen;
     RegionRec newShape;
     RegionPtr pShape;
 
@@ -274,7 +263,7 @@ static void RootlessReshapeFrame(WindowPtr pWin)
     }
 #endif
 
-    SCREENREC(pScreen)->imp->ReshapeFrame(winRec->wid, pShape);
+    SCREENREC(pWin->drawable.pScreen)->imp->ReshapeFrame(winRec->wid, pShape);
 
     if (pShape != NULL)
         RegionUninit(&newShape);
diff --git a/render/mirect.c b/render/mirect.c
index 6a3112a..4fb347a 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -42,7 +42,6 @@ miColorRects (PicturePtr    pDst,
 	      int	    xoff,
 	      int	    yoff)
 {
-    ScreenPtr		pScreen = pDst->pDrawable->pScreen;
     CARD32		pixel;
     GCPtr		pGC;
     ChangeGCVal		tmpval[5];
@@ -51,7 +50,7 @@ miColorRects (PicturePtr    pDst,
 
     miRenderColorToPixel (pDst->pFormat, color, &pixel);
 
-    pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
+    pGC = GetScratchGC (pDst->pDrawable->depth, pDst->pDrawable->pScreen);
     if (!pGC)
 	return;
     tmpval[0].val = GXcopy;
diff --git a/render/picture.c b/render/picture.c
index adf600a..f38d305 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1298,8 +1298,7 @@ SetPictureClipRects (PicturePtr	pPicture,
     RegionPtr		clientClip;
     int			result;
 
-    clientClip = RectsToRegion(
-				 nRect, rects, CT_UNSORTED);
+    clientClip = RectsToRegion(nRect, rects, CT_UNSORTED);
     if (!clientClip)
 	return BadAlloc;
     result =(*ps->ChangePictureClip) (pPicture, CT_REGION, 
@@ -1329,9 +1328,8 @@ SetPictureClipRegion (PicturePtr    pPicture,
     if (pRegion)
     {
         type = CT_REGION;
-        clientClip = RegionCreate(
-                                    RegionExtents(pRegion),
-                                    RegionNumRects(pRegion));
+        clientClip = RegionCreate(RegionExtents(pRegion),
+                                  RegionNumRects(pRegion));
         if (!clientClip)
             return BadAlloc;
         if (!RegionCopy(clientClip, pRegion))
diff --git a/xfixes/region.c b/xfixes/region.c
index 3f06d7f..25a30e6 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -663,7 +663,6 @@ int
 ProcXFixesSetWindowShapeRegion (ClientPtr client)
 {
     WindowPtr	    pWin;
-    ScreenPtr	    pScreen;
     RegionPtr	    pRegion;
     RegionPtr	    *pDestRegion;
     int rc;
@@ -678,7 +677,6 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
 	return rc;
     }
     VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
-    pScreen = pWin->drawable.pScreen;
     switch (stuff->destKind) {
     case ShapeBounding:
     case ShapeClip:
@@ -733,7 +731,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
     if (*pDestRegion)
 	RegionDestroy(*pDestRegion);
     *pDestRegion = pRegion;
-    (*pScreen->SetShape) (pWin);
+    (*pWin->drawable.pScreen->SetShape) (pWin);
     SendShapeNotify (pWin, stuff->destKind);
     return Success;
 }
-- 
1.7.0



More information about the xorg-devel mailing list