diff options
author | Julian Eisel <julian@blender.org> | 2020-04-03 13:51:03 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-03 13:54:28 +0300 |
commit | 10c2254d412d7cbee0b0d9f8b7c74a9d3ce69b69 (patch) | |
tree | c430e46e04ed888bcbf44af39b780a2986f513ea /source/blender/blenloader/intern/versioning_280.c | |
parent | 7ec59cc7b700952fdbddfbb44a55977e0bf3bcb6 (diff) |
Cleanup: Continue renaming ARegion variables from ar to region
Continuation of b2ee1770d4c3, now non-single word variables are also
renamed.
Part of T74432.
Also ran clang-format on affected files.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index b3c0473e173..ac0c0c3da39 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -609,9 +609,9 @@ static void do_versions_remove_region(ListBase *regionbase, ARegion *region) static void do_versions_remove_regions_by_type(ListBase *regionbase, int regiontype) { - ARegion *region, *ar_next; - for (region = regionbase->first; region; region = ar_next) { - ar_next = region->next; + ARegion *region, *region_next; + for (region = regionbase->first; region; region = region_next) { + region_next = region->next; if (region->regiontype == regiontype) { do_versions_remove_region(regionbase, region); } @@ -2934,9 +2934,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_header = do_versions_find_region_or_null(regionbase, RGN_TYPE_HEADER); + ARegion *region_header = do_versions_find_region_or_null(regionbase, RGN_TYPE_HEADER); - if (!ar_header) { + if (!region_header) { /* Headers should always be first in the region list, except if there's also a * tool-header. These were only introduced in later versions though, so should be * fine to always insert headers first. */ @@ -2959,16 +2959,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_PROPERTIES) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; ARegion *region = MEM_callocN(sizeof(ARegion), "navigation bar for properties"); - ARegion *ar_header = NULL; + ARegion *region_header = NULL; - for (ar_header = regionbase->first; ar_header; ar_header = ar_header->next) { - if (ar_header->regiontype == RGN_TYPE_HEADER) { + for (region_header = regionbase->first; region_header; + region_header = region_header->next) { + if (region_header->regiontype == RGN_TYPE_HEADER) { break; } } - BLI_assert(ar_header); + BLI_assert(region_header); - BLI_insertlinkafter(regionbase, ar_header, region); + BLI_insertlinkafter(regionbase, region_header, region); region->regiontype = RGN_TYPE_NAV_BAR; region->alignment = RGN_ALIGN_LEFT; @@ -3468,13 +3469,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!execute_region) { ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase; - ARegion *ar_navbar = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_NAV_BAR); + ARegion *region_navbar = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_NAV_BAR); execute_region = MEM_callocN(sizeof(ARegion), "execute region for properties"); - BLI_assert(ar_navbar); + BLI_assert(region_navbar); - BLI_insertlinkafter(regionbase, ar_navbar, execute_region); + BLI_insertlinkafter(regionbase, region_navbar, execute_region); execute_region->regiontype = RGN_TYPE_EXECUTE; execute_region->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; @@ -3711,8 +3712,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *region = do_versions_add_region(RGN_TYPE_FOOTER, "footer for text"); region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP : RGN_ALIGN_BOTTOM; - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - BLI_insertlinkafter(regionbase, ar_header, region); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + BLI_insertlinkafter(regionbase, region_header, region); } } } @@ -3804,8 +3805,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) region = do_versions_add_region(RGN_TYPE_TOOL_HEADER, "tool header"); region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - BLI_insertlinkbefore(regionbase, ar_header, region); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + BLI_insertlinkbefore(regionbase, region_header, region); /* Hide by default, enable for painting workspaces (startup only). */ region->flag |= RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; } @@ -4136,24 +4137,25 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_FILE) { SpaceFile *sfile = (SpaceFile *)sl; ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_ui = do_versions_find_region(regionbase, RGN_TYPE_UI); - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - ARegion *ar_toolprops = do_versions_find_region_or_null(regionbase, - RGN_TYPE_TOOL_PROPS); + ARegion *region_ui = do_versions_find_region(regionbase, RGN_TYPE_UI); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + ARegion *region_toolprops = do_versions_find_region_or_null(regionbase, + RGN_TYPE_TOOL_PROPS); /* Reinsert UI region so that it spawns entire area width */ - BLI_remlink(regionbase, ar_ui); - BLI_insertlinkafter(regionbase, ar_header, ar_ui); + BLI_remlink(regionbase, region_ui); + BLI_insertlinkafter(regionbase, region_header, region_ui); - ar_ui->flag |= RGN_FLAG_DYNAMIC_SIZE; + region_ui->flag |= RGN_FLAG_DYNAMIC_SIZE; - if (ar_toolprops && (ar_toolprops->alignment == (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) { + if (region_toolprops && + (region_toolprops->alignment == (RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV))) { SpaceType *stype = BKE_spacetype_from_id(sl->spacetype); /* Remove empty region at old location. */ BLI_assert(sfile->op == NULL); - BKE_area_region_free(stype, ar_toolprops); - BLI_freelinkN(regionbase, ar_toolprops); + BKE_area_region_free(stype, region_toolprops); + BLI_freelinkN(regionbase, region_toolprops); } if (sfile->params) { @@ -4244,24 +4246,25 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } else if (sl->spacetype == SPACE_FILE) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; - ARegion *ar_tools = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOLS); - ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); + ARegion *region_tools = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOLS); + ARegion *region_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); - if (ar_tools) { - ARegion *ar_next = ar_tools->next; + if (region_tools) { + ARegion *region_next = region_tools->next; /* We temporarily had two tools regions, get rid of the second one. */ - if (ar_next && ar_next->regiontype == RGN_TYPE_TOOLS) { - do_versions_remove_region(regionbase, ar_next); + if (region_next && region_next->regiontype == RGN_TYPE_TOOLS) { + do_versions_remove_region(regionbase, region_next); } - BLI_remlink(regionbase, ar_tools); - BLI_insertlinkafter(regionbase, ar_header, ar_tools); + BLI_remlink(regionbase, region_tools); + BLI_insertlinkafter(regionbase, region_header, region_tools); } else { - ar_tools = do_versions_add_region(RGN_TYPE_TOOLS, "versioning file tools region"); - BLI_insertlinkafter(regionbase, ar_header, ar_tools); - ar_tools->alignment = RGN_ALIGN_LEFT; + region_tools = do_versions_add_region(RGN_TYPE_TOOLS, + "versioning file tools region"); + BLI_insertlinkafter(regionbase, region_header, region_tools); + region_tools->alignment = RGN_ALIGN_LEFT; } } } |