diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/blenloader/intern/versioning_userdef.c | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/blenloader/intern/versioning_userdef.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index b566cf446ad..28118d6e87a 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -534,7 +534,7 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) userdef->gpu_viewport_quality = 0.6f; /* Reset theme, old themes will not be compatible with minor version updates from now on. */ - for (bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) { + LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) { memcpy(btheme, &U_theme_default, sizeof(*btheme)); } @@ -552,8 +552,8 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) if (!USER_VERSION_ATLEAST(280, 31)) { /* Remove select/action mouse from user defined keymaps. */ - for (wmKeyMap *keymap = userdef->user_keymaps.first; keymap; keymap = keymap->next) { - for (wmKeyMapDiffItem *kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next) { + LISTBASE_FOREACH (wmKeyMap *, keymap, &userdef->user_keymaps) { + LISTBASE_FOREACH (wmKeyMapDiffItem *, kmdi, &keymap->diff_items) { if (kmdi->remove_item) { do_version_select_mouse(userdef, kmdi->remove_item); } @@ -562,7 +562,7 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) } } - for (wmKeyMapItem *kmi = keymap->items.first; kmi; kmi = kmi->next) { + LISTBASE_FOREACH (wmKeyMapItem *, kmi, &keymap->items) { do_version_select_mouse(userdef, kmi); } } @@ -757,7 +757,7 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) userdef->pixelsize = 1.0f; } - for (bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) { + LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) { do_versions_theme(userdef, btheme); } #undef USER_VERSION_ATLEAST |