[PATCH 3/5] panoramiX: convert 1->panoramiXNumScreens loops to use macro
Dave Airlie
airlied at gmail.com
Tue Mar 8 21:29:51 PST 2011
From: Dave Airlie <airlied at redhat.com>
This converts all the remaining 1->num loops to the macro,
this removes nearly all the panoramiXNumScreens usage in
loops, and is a step to replacing it.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
Xext/panoramiX.c | 2 +-
Xext/panoramiXprocs.c | 2 +-
Xext/xvdisp.c | 2 +-
dix/events.c | 6 +++---
hw/dmx/dmxgcops.c | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index da0266f..74241d8 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -413,7 +413,7 @@ static void XineramaInitData(ScreenPtr pScreen)
PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height;
- for (i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
pScreen = screenInfo.screens[i];
w = pScreen->x + pScreen->width;
h = pScreen->y + pScreen->height;
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 6a6c6a0..b6ca807 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1840,7 +1840,7 @@ int PanoramiXGetImage(ClientPtr client)
}
drawables[0] = pDraw;
- for(i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
DixGetAttrAccess);
if (rc != Success)
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index beb26a9..b968431 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1918,7 +1918,7 @@ void XineramifyXv(void)
MatchingAdaptors[0] = refAdapt;
isOverlay = hasOverlay(refAdapt);
- for(j = 1; j < PanoramiXNumScreens; j++)
+ FOR_NSCREENS_FORWARD_SKIP(j)
MatchingAdaptors[j] = matchAdaptor(screenInfo.screens[j], refAdapt, isOverlay);
/* now create a resource for each port */
diff --git a/dix/events.c b/dix/events.c
index 5151f74..8835c5e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2554,7 +2554,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite;
int i;
- for(i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
if(RegionContainsPoint(&pSprite->windows[i]->borderSize,
x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
@@ -3153,7 +3153,7 @@ XineramaPointInWindowIsVisible(
xoff = x + screenInfo.screens[0]->x;
yoff = y + screenInfo.screens[0]->y;
- for(i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
x = xoff - screenInfo.screens[i]->x;
y = yoff - screenInfo.screens[i]->y;
@@ -3360,7 +3360,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
if(!noPanoramiXExtension && XineramaSetWindowPntrs(pDev, pWin)) {
int i;
- for(i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize))
return TRUE;
}
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index bc8cd9e..500e2cd 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -529,7 +529,7 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
NullClient, DixUnknownAccess))
return NULL;
- for (i = 1; i < PanoramiXNumScreens; i++) {
+ FOR_NSCREENS_FORWARD_SKIP(i) {
dmxScreen = &dmxScreens[i];
if (dmxScreen->beDisplay) {
PixmapPtr pSrc;
--
1.7.3.4
More information about the xorg-devel
mailing list