Skip to content

Commit

Permalink
panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2)
Browse files Browse the repository at this point in the history
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.

v2: move some from the other patch.

Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Alan Coopersmith <[email protected]>
  • Loading branch information
airlied committed Mar 10, 2011
1 parent 0bccfcc commit 5fb329a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Xext/panoramiX.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -740,7 +740,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
int j, k;
Bool found = FALSE;

for (j = 1; j < PanoramiXNumScreens; j++) {
FOR_NSCREENS_FORWARD_SKIP(j) {
pScreen = screenInfo.screens[j];
for (k = 0; k < pScreen->numDepths; k++) {
if (pScreen->allowedDepths[k].depth == pDepth->depth) {
Expand Down Expand Up @@ -773,7 +773,7 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
int j, k;
Bool found = FALSE;

for (j = 1; j < PanoramiXNumScreens; j++) {
FOR_NSCREENS_FORWARD_SKIP(j) {
pScreen = screenInfo.screens[j];
found = FALSE;

Expand Down
2 changes: 1 addition & 1 deletion Xext/panoramiXprocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Xext/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return BadAlloc;

drawables[0] = pDraw;
for(i = 1; i < PanoramiXNumScreens; i++) {
FOR_NSCREENS_FORWARD_SKIP(i) {
rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
DixReadAccess);
if (rc != Success)
Expand Down
2 changes: 1 addition & 1 deletion Xext/xvdisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions dix/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion hw/dmx/dmxgcops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5fb329a

Please sign in to comment.