diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-11-04 21:38:31 +0200 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-11-08 15:29:16 +0200 |
commit | c3ea1f7db494365032526dc06a7283384bd0ecd1 (patch) | |
tree | ee7ba11e600d9eea9965b24ae3a6c4410ec4b0bd | |
parent | 3a9b96425851b495503bd2eb0fd0d01c08f6a097 (diff) |
dix/mi: still more warning fixes
Fix up prototypes for PrintChildren and PrintWindowTree in the dix.
Make miPrintRegion be unconditionally defined, and move the prototype into
regionstr.h.
Change a bunch of ScreenPtr pScreen = foo; to
ScreenPtr pScreen; pScreen = foo; in window.c, so we avoid unused variable
references (as inline REGION_* doesn't reference pScreen).
-rw-r--r-- | dix/window.c | 23 | ||||
-rw-r--r-- | include/regionstr.h | 3 | ||||
-rw-r--r-- | mi/miregion.c | 5 |
3 files changed, 19 insertions, 12 deletions
diff --git a/dix/window.c b/dix/window.c index 3dfeda36e..f0079e09d 100644 --- a/dix/window.c +++ b/dix/window.c @@ -187,7 +187,7 @@ _X_EXPORT int deltaSaveUndersViewable = 0; * For debugging only ******/ -int +static void PrintChildren(WindowPtr p1, int indent) { WindowPtr p2; @@ -197,14 +197,15 @@ PrintChildren(WindowPtr p1, int indent) { p2 = p1->firstChild; for (i=0; i<indent; i++) ErrorF( " "); - ErrorF( "%x\n", p1->drawable.id); + ErrorF( "%lx\n", p1->drawable.id); miPrintRegion(&p1->clipList); PrintChildren(p2, indent+4); p1 = p1->nextSib; } } -PrintWindowTree() +static void +PrintWindowTree(void) { int i; WindowPtr pWin, p1; @@ -547,9 +548,11 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, register int x, register int y, register int w, register int h) { - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen; BoxRec box; + pScreen = pWin->drawable.pScreen; + box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); /* we do these calculations to avoid overflows */ if (x > box.x1) @@ -1663,7 +1666,8 @@ CreateUnclippedWinSize (register WindowPtr pWin) pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen; + pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - pWin->drawable.y); @@ -1699,7 +1703,8 @@ SetWinSize (register WindowPtr pWin) (int)pWin->drawable.height); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen; + pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - pWin->drawable.y); @@ -1741,7 +1746,8 @@ SetBorderSize (register WindowPtr pWin) (int)(pWin->drawable.height + (bw<<1))); #ifdef SHAPE if (wBoundingShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen; + pScreen = pWin->drawable.pScreen; REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - pWin->drawable.y); @@ -1952,7 +1958,8 @@ MakeBoundingRegion ( BoxPtr pBox) { RegionPtr pRgn; - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen; + pScreen = pWin->drawable.pScreen; pRgn = REGION_CREATE(pScreen, pBox, 1); if (wBoundingShape (pWin)) { diff --git a/include/regionstr.h b/include/regionstr.h index 6c39324d1..e6882e77a 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -321,4 +321,7 @@ extern void miRegionEmpty( extern BoxPtr miRegionExtents( RegionPtr /*pReg*/); +extern void miPrintRegion( + RegionPtr /*pReg*/); + #endif /* REGIONSTRUCT_H */ diff --git a/mi/miregion.c b/mi/miregion.c index fdb538c68..0db46dcf5 100644 --- a/mi/miregion.c +++ b/mi/miregion.c @@ -223,8 +223,7 @@ _X_EXPORT RegDataRec miEmptyData = {0, 0}; RegDataRec miBrokenData = {0, 0}; RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData }; -#ifdef DEBUG -int +_X_EXPORT void miPrintRegion(rgn) RegionPtr rgn; { @@ -242,9 +241,7 @@ miPrintRegion(rgn) ErrorF("%d %d %d %d \n", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2); ErrorF("\n"); - return(num); } -#endif /* DEBUG */ _X_EXPORT Bool miRegionEqual(reg1, reg2) |