treewide: macros lambda-esque screen iteration

iterating over screen list via lambda-esque macros calls like this

    DIX_FOR_EACH_SCREEN({
        do_something
    });

withing the body, the iterator variables `walkScreenIdx` and `walkScreen`
are defined and can be directly used (read-only). the code inside the body
is running in a separate scope.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-11 09:53:01 +02:00
committed by Enrico Weigelt
parent eaff5ba96c
commit 962580a15a
49 changed files with 304 additions and 411 deletions

View File

@@ -342,12 +342,14 @@ SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params,
/* For source pictures, the picture isn't tied to a screen. So, ensure
* that all screens can handle a filter we set for the picture.
*/
for (unsigned int walkScreenIdx = 1; walkScreenIdx < screenInfo.numScreens; walkScreenIdx++) {
ScreenPtr walkScreen = screenInfo.screens[walkScreenIdx];
DIX_FOR_EACH_SCREEN({
if (!walkScreenIdx)
continue; // skip the first screen
PictFilterPtr pScreenFilter = PictureFindFilter(walkScreen, name, len);
if (!pScreenFilter || pScreenFilter->id != pFilter->id)
return BadMatch;
}
});
}
return SetPicturePictFilter(pPicture, pFilter, params, nparams);
}