mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
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:
committed by
Enrico Weigelt
parent
eaff5ba96c
commit
962580a15a
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user