From 918941483f7ec5fc6320d345c755e953b963c710 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Feb 2019 11:14:41 +1100 Subject: Cleanup: Main struct member names Rename latt to lattice and don't use plural names. --- source/blender/blenkernel/BKE_main.h | 10 +++++----- source/blender/blenkernel/intern/anim_sys.c | 16 ++++++++-------- source/blender/blenkernel/intern/blendfile.c | 6 +++--- source/blender/blenkernel/intern/cachefile.c | 2 +- source/blender/blenkernel/intern/main.c | 22 +++++++++++----------- source/blender/blenkernel/intern/workspace.c | 10 +++++----- 6 files changed, 33 insertions(+), 33 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 49755f6ec5e..48f9ac1a0da 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -93,7 +93,7 @@ typedef struct Main { ListBase mat; ListBase tex; ListBase image; - ListBase latt; + ListBase lattice; ListBase light; ListBase camera; ListBase ipo; // XXX deprecated @@ -111,15 +111,15 @@ typedef struct Main { ListBase nodetree; ListBase brush; ListBase particle; - ListBase palettes; - ListBase paintcurves; + ListBase palette; + ListBase paintcurve; ListBase wm; ListBase gpencil; ListBase movieclip; ListBase mask; ListBase linestyle; - ListBase cachefiles; - ListBase workspaces; + ListBase cachefile; + ListBase workspace; /* Must be generated, used and freed by same code - never assume this is valid data unless you know * when, who and how it was created. diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 872129e351d..446eb329910 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1153,7 +1153,7 @@ void BKE_animdata_main_cb(Main *bmain, ID_AnimData_Edit_Callback func, void *use ANIMDATA_IDS_CB(bmain->armature.first); /* lattices */ - ANIMDATA_IDS_CB(bmain->latt.first); + ANIMDATA_IDS_CB(bmain->lattice.first); /* meshes */ ANIMDATA_IDS_CB(bmain->mesh.first); @@ -1186,10 +1186,10 @@ void BKE_animdata_main_cb(Main *bmain, ID_AnimData_Edit_Callback func, void *use ANIMDATA_IDS_CB(bmain->gpencil.first); /* palettes */ - ANIMDATA_IDS_CB(bmain->palettes.first); + ANIMDATA_IDS_CB(bmain->palette.first); /* cache files */ - ANIMDATA_IDS_CB(bmain->cachefiles.first); + ANIMDATA_IDS_CB(bmain->cachefile.first); } /* Fix all RNA-Paths throughout the database (directly access the Global.main version) @@ -1252,7 +1252,7 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha RENAMEFIX_ANIM_IDS(bmain->armature.first); /* lattices */ - RENAMEFIX_ANIM_IDS(bmain->latt.first); + RENAMEFIX_ANIM_IDS(bmain->lattice.first); /* meshes */ RENAMEFIX_ANIM_IDS(bmain->mesh.first); @@ -1282,7 +1282,7 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha RENAMEFIX_ANIM_IDS(bmain->gpencil.first); /* cache files */ - RENAMEFIX_ANIM_IDS(bmain->cachefiles.first); + RENAMEFIX_ANIM_IDS(bmain->cachefile.first); /* scenes */ RENAMEFIX_ANIM_NODETREE_IDS(bmain->scene.first, Scene); @@ -3634,7 +3634,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene EVAL_ANIM_IDS(main->armature.first, ADT_RECALC_ANIM); /* lattices */ - EVAL_ANIM_IDS(main->latt.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->lattice.first, ADT_RECALC_ANIM); /* meshes */ EVAL_ANIM_IDS(main->mesh.first, ADT_RECALC_ANIM); @@ -3655,10 +3655,10 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene EVAL_ANIM_IDS(main->gpencil.first, ADT_RECALC_ANIM); /* palettes */ - EVAL_ANIM_IDS(main->palettes.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->palette.first, ADT_RECALC_ANIM); /* cache files */ - EVAL_ANIM_IDS(main->cachefiles.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->cachefile.first, ADT_RECALC_ANIM); /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index e7ea38d845b..e93788f18f1 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -170,7 +170,7 @@ static void setup_app_data( /* comes from readfile.c */ SWAP(ListBase, bmain->wm, bfd->main->wm); - SWAP(ListBase, bmain->workspaces, bfd->main->workspaces); + SWAP(ListBase, bmain->workspace, bfd->main->workspace); SWAP(ListBase, bmain->screen, bfd->main->screen); /* we re-use current window and screen */ @@ -573,7 +573,7 @@ WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepat if (bfd) { workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__); workspace_config->main = bfd->main; - workspace_config->workspaces = bfd->main->workspaces; + workspace_config->workspaces = bfd->main->workspace; MEM_freeN(bfd); } @@ -588,7 +588,7 @@ bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, Rep BKE_blendfile_write_partial_begin(bmain); - for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { BKE_blendfile_write_partial_tag_ID(&workspace->id, true); } diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index 8b973269192..4741984b07c 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -177,7 +177,7 @@ void BKE_cachefile_update_frame( CacheFile *cache_file; char filename[FILE_MAX]; - for (cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) { + for (cache_file = bmain->cachefile.first; cache_file; cache_file = cache_file->id.next) { /* TODO: dependency graph should be updated to do drivers on cachefile. * Execute drivers only, as animation has already been done. */ BKE_animsys_evaluate_animdata(depsgraph, scene, &cache_file->id, cache_file->adt, ctime, ADT_RECALC_DRIVERS); diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index c5be951ee23..a6a302b58bd 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -340,7 +340,7 @@ ListBase *which_libbase(Main *bmain, short type) case ID_IM: return &(bmain->image); case ID_LT: - return &(bmain->latt); + return &(bmain->lattice); case ID_LA: return &(bmain->light); case ID_CA: @@ -386,13 +386,13 @@ ListBase *which_libbase(Main *bmain, short type) case ID_LS: return &(bmain->linestyle); case ID_PAL: - return &(bmain->palettes); + return &(bmain->palette); case ID_PC: - return &(bmain->paintcurves); + return &(bmain->paintcurve); case ID_CF: - return &(bmain->cachefiles); + return &(bmain->cachefile); case ID_WS: - return &(bmain->workspaces); + return &(bmain->workspace); } return NULL; } @@ -413,7 +413,7 @@ int set_listbasepointers(Main *bmain, ListBase **lb) lb[INDEX_ID_IP] = &(bmain->ipo); lb[INDEX_ID_AC] = &(bmain->action); /* moved here to avoid problems when freeing with animato (aligorith) */ lb[INDEX_ID_KE] = &(bmain->key); - lb[INDEX_ID_PAL] = &(bmain->palettes); /* referenced by gpencil, so needs to be before that to avoid crashes */ + lb[INDEX_ID_PAL] = &(bmain->palette); /* referenced by gpencil, so needs to be before that to avoid crashes */ lb[INDEX_ID_GD] = &(bmain->gpencil); /* referenced by nodes, objects, view, scene etc, before to free after. */ lb[INDEX_ID_NT] = &(bmain->nodetree); lb[INDEX_ID_IM] = &(bmain->image); @@ -427,20 +427,20 @@ int set_listbasepointers(Main *bmain, ListBase **lb) lb[INDEX_ID_AR] = &(bmain->armature); - lb[INDEX_ID_CF] = &(bmain->cachefiles); + lb[INDEX_ID_CF] = &(bmain->cachefile); lb[INDEX_ID_ME] = &(bmain->mesh); lb[INDEX_ID_CU] = &(bmain->curve); lb[INDEX_ID_MB] = &(bmain->mball); - lb[INDEX_ID_LT] = &(bmain->latt); + lb[INDEX_ID_LT] = &(bmain->lattice); lb[INDEX_ID_LA] = &(bmain->light); lb[INDEX_ID_CA] = &(bmain->camera); lb[INDEX_ID_TXT] = &(bmain->text); lb[INDEX_ID_SO] = &(bmain->sound); lb[INDEX_ID_GR] = &(bmain->collection); - lb[INDEX_ID_PAL] = &(bmain->palettes); - lb[INDEX_ID_PC] = &(bmain->paintcurves); + lb[INDEX_ID_PAL] = &(bmain->palette); + lb[INDEX_ID_PC] = &(bmain->paintcurve); lb[INDEX_ID_BR] = &(bmain->brush); lb[INDEX_ID_PA] = &(bmain->particle); lb[INDEX_ID_SPK] = &(bmain->speaker); @@ -452,7 +452,7 @@ int set_listbasepointers(Main *bmain, ListBase **lb) lb[INDEX_ID_OB] = &(bmain->object); lb[INDEX_ID_LS] = &(bmain->linestyle); /* referenced by scenes */ lb[INDEX_ID_SCE] = &(bmain->scene); - lb[INDEX_ID_WS] = &(bmain->workspaces); /* before wm, so it's freed after it! */ + lb[INDEX_ID_WS] = &(bmain->workspace); /* before wm, so it's freed after it! */ lb[INDEX_ID_WM] = &(bmain->wm); lb[INDEX_ID_MSK] = &(bmain->mask); diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index c2bded42bc1..c0591680742 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -123,7 +123,7 @@ static bool UNUSED_FUNCTION(workspaces_is_screen_used) #endif (const Main *bmain, bScreen *screen) { - for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { if (workspace_layout_find_exec(workspace, screen)) { return true; } @@ -185,7 +185,7 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain) WorkSpaceInstanceHook *hook = MEM_callocN(sizeof(WorkSpaceInstanceHook), __func__); /* set an active screen-layout for each possible window/workspace combination */ - for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { BKE_workspace_hook_layout_for_workspace_set(hook, workspace, workspace->layouts.first); } @@ -194,10 +194,10 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain) void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook *hook) { /* workspaces should never be freed before wm (during which we call this function) */ - BLI_assert(!BLI_listbase_is_empty(&bmain->workspaces)); + BLI_assert(!BLI_listbase_is_empty(&bmain->workspace)); /* Free relations for this hook */ - for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { for (WorkSpaceDataRelation *relation = workspace->hook_layout_relations.first, *relation_next; relation; relation = relation_next) @@ -287,7 +287,7 @@ WorkSpaceLayout *BKE_workspace_layout_find_global( *r_workspace = NULL; } - for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { if ((layout = workspace_layout_find_exec(workspace, screen))) { if (r_workspace) { *r_workspace = workspace; -- cgit v1.2.3