mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +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
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "dix/screenint_priv.h"
|
||||
#include "present/present_priv.h"
|
||||
#include "randr/randrstr_priv.h"
|
||||
|
||||
@@ -408,8 +409,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned walkScreenIdx = 0; walkScreenIdx < screenInfo.numScreens; walkScreenIdx++) {
|
||||
ScreenPtr walkScreen = screenInfo.screens[walkScreenIdx];
|
||||
DIX_FOR_EACH_SCREEN({
|
||||
present_screen_priv_ptr screen_priv = present_screen_priv(walkScreen);
|
||||
|
||||
if (event_id == screen_priv->unflip_event_id) {
|
||||
@@ -419,7 +419,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
|
||||
present_flip_try_ready(walkScreen);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user