Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-03-01 15:35:15 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-03-01 15:35:27 +0300
commite06f5f64aeac914c17cfc267b1335869d0f24309 (patch)
treee50e9b8b42e732bfa973bbc0d0a4e2fdfa02e764 /source/blender/windowmanager
parent4b3dcd80698a01de6cbf2d7f0d9abeac52cf6523 (diff)
Cleanup: Use LISTBASE_FOREACH and LISTBASE_FOREACH_MUTABLE macro
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f96c45f8a05..d829b812882 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2046,7 +2046,7 @@ wmPaintCursor *WM_paint_cursor_activate(short space_type,
bool WM_paint_cursor_end(wmPaintCursor *handle)
{
wmWindowManager *wm = G_MAIN->wm.first;
- for (wmPaintCursor *pc = wm->paintcursors.first; pc; pc = pc->next) {
+ LISTBASE_FOREACH (wmPaintCursor *, pc, &wm->paintcursors) {
if (pc == (wmPaintCursor *)handle) {
BLI_remlink(&wm->paintcursors, pc);
MEM_freeN(pc);
@@ -2058,9 +2058,7 @@ bool WM_paint_cursor_end(wmPaintCursor *handle)
void WM_paint_cursor_remove_by_type(wmWindowManager *wm, void *draw_fn, void (*free)(void *))
{
- wmPaintCursor *pc = wm->paintcursors.first;
- while (pc) {
- wmPaintCursor *pc_next = pc->next;
+ LISTBASE_FOREACH_MUTABLE (wmPaintCursor *, pc, &wm->paintcursors) {
if (pc->draw == draw_fn) {
if (free) {
free(pc->customdata);
@@ -2068,7 +2066,6 @@ void WM_paint_cursor_remove_by_type(wmWindowManager *wm, void *draw_fn, void (*f
BLI_remlink(&wm->paintcursors, pc);
MEM_freeN(pc);
}
- pc = pc_next;
}
}