diff options
author | Hans Goudey <h.goudey@me.com> | 2020-10-18 00:36:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-18 00:36:02 +0300 |
commit | f425f40c4e17e889c720647b26c07ae3f6d3ba64 (patch) | |
tree | b8b42d0862def239c0a05d2b3cae452aba68464d /source/blender/windowmanager/intern/wm_init_exit.c | |
parent | 85e78fa17cd54676b5aa9a15a0b885b4a7187086 (diff) |
Cleanup: More miscellaneous code quality changes in wm directory
- Declare variables where initialized.
- Use LISTBASE_FOREACH macro.
- Reduce variable scope.
- Return early or reduce indentation in some cases.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_init_exit.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index de47234695e..ac9d3848f3a 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -203,7 +203,7 @@ static void sound_jack_sync_callback(Main *bmain, int mode, double time) wmWindowManager *wm = bmain->wm.first; - for (wmWindow *window = wm->windows.first; window != NULL; window = window->next) { + LISTBASE_FOREACH (wmWindow *, window, &wm->windows) { Scene *scene = WM_window_get_active_scene(window); if ((scene->audio.flag & AUDIO_SYNC) == 0) { continue; @@ -479,8 +479,6 @@ void WM_exit_ex(bContext *C, const bool do_python) /* modal handlers are on window level freed, others too? */ /* note; same code copied in wm_files.c */ if (C && wm) { - wmWindow *win; - if (!G.background) { struct MemFile *undo_memfile = wm->undo_stack ? ED_undosys_stack_memfile_get_active(wm->undo_stack) : @@ -507,8 +505,7 @@ void WM_exit_ex(bContext *C, const bool do_python) WM_jobs_kill_all(wm); - for (win = wm->windows.first; win; win = win->next) { - + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { CTX_wm_window_set(C, win); /* needed by operator close callbacks */ WM_event_remove_handlers(C, &win->handlers); WM_event_remove_handlers(C, &win->modalhandlers); |