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

@@ -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;
}
}
});
}
/*