diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 07:22:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 07:22:01 +0300 |
commit | 3612ce55796427a67ba070df165b46698b2d9ace (patch) | |
tree | c76aeafe5739e010048f9b43886d83dc27457cdc /source/blender/blenloader | |
parent | 8c85f1316cdebc636f0210478a8a36b9475269fd (diff) |
Cleanup: name macros w/ matching BEGIN/END
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 20 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_260.c | 64 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 24 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 10 |
5 files changed, 60 insertions, 63 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d689b871a64..ead3b324644 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2925,16 +2925,16 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) #endif /* set node->typeinfo pointers */ - FOREACH_NODETREE (main, ntree, id) { + FOREACH_NODETREE_BEGIN (main, ntree, id) { ntreeSetTypes(NULL, ntree); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; /* verify static socket templates */ - FOREACH_NODETREE (main, ntree, id) { + FOREACH_NODETREE_BEGIN (main, ntree, id) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) node_verify_socket_templates(ntree, node); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; { bool has_old_groups = false; @@ -2950,7 +2950,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) } if (has_old_groups) { - FOREACH_NODETREE (main, ntree, id) { + FOREACH_NODETREE_BEGIN (main, ntree, id) { /* updates external links for all group nodes in a tree */ bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2960,7 +2960,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) lib_node_do_versions_group_indices(node); } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { @@ -2981,7 +2981,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) * so have to clean up all of them ... */ - FOREACH_NODETREE(main, ntree, id) { + FOREACH_NODETREE_BEGIN(main, ntree, id) { if (ntree->flag & NTREE_DO_VERSIONS_CUSTOMNODES_GROUP) { bNode *input_node = NULL, *output_node = NULL; int num_inputs = 0, num_outputs = 0; @@ -3067,7 +3067,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) ntree->flag &= ~(NTREE_DO_VERSIONS_CUSTOMNODES_GROUP | NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE); } } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } /* verify all group user nodes */ @@ -3077,10 +3077,10 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) /* make update calls where necessary */ { - FOREACH_NODETREE(main, ntree, id) { + FOREACH_NODETREE_BEGIN(main, ntree, id) { /* make an update call for the tree */ ntreeUpdateTree(main, ntree); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } } diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 28ab7b2842e..835acbc853d 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -2700,7 +2700,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 2)) { { /* Convert default socket values from bNodeStack */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { bNode *node; bNodeSocket *sock; @@ -2717,8 +2717,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) do_versions_socket_default_value_259(sock); ntree->update |= NTREE_UPDATE; - } - FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } { diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 35fcb11e5a5..f630dbe1aaf 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -688,7 +688,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 2)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -702,7 +702,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 4)) { @@ -1330,7 +1330,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 9)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1344,7 +1344,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 10)) { @@ -1359,7 +1359,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1371,7 +1371,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } { @@ -1429,7 +1429,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 13)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1442,13 +1442,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 14)) { ParticleSettings *part; - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1461,7 +1461,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; /* keep compatibility for dupliobject particle size */ for (part = bmain->particle.first; part; part = part->id.next) @@ -1471,7 +1471,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1487,7 +1487,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) { @@ -1614,14 +1614,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 1)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) if (node->type == SH_NODE_TEX_COORD) node->flag |= NODE_OPTIONS; } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) { @@ -1723,7 +1723,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Fix for bug #32982, internal_links list could get corrupted from r51630 onward. * Simply remove bad internal_links lists to avoid NULL pointers. */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { bNode *node; bNodeLink *link, *nextlink; @@ -1735,7 +1735,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) { @@ -1923,7 +1923,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -1937,7 +1937,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } else if (bmain->versionfile < 266 || (bmain->versionfile == 266 && bmain->subversionfile < 1)) { /* texture use alpha was removed for 2.66 but added back again for 2.66a, @@ -2002,7 +2002,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) // add storage for compositor translate nodes when not existing if (MAIN_VERSION_OLDER(bmain, 265, 11)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2011,13 +2011,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (MAIN_VERSION_OLDER(bmain, 266, 2)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { do_versions_nodetree_customnodes(ntree, ((ID *)ntree == id)); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (MAIN_VERSION_OLDER(bmain, 266, 2)) { @@ -2056,7 +2056,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Set flag for delayed do_versions in lib_verify_nodetree. It needs valid typeinfo pointers ... */ { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { /* XXX This should be kept without version check for now! * As long as USE_NODE_COMPAT_CUSTOMNODES is active, files will write links * to tree interface sockets for forward compatibility. These links need to be removed again @@ -2071,7 +2071,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (MAIN_VERSION_OLDER(bmain, 266, 2)) ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE; } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } if (MAIN_VERSION_OLDER(bmain, 266, 3)) { @@ -2083,14 +2083,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * so do this now to ensure old files don't break. */ bNode *node; - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (id == &ntree->id) continue; /* already fixed for node groups */ for (node = ntree->nodes.first; node; node = node->next) nodeUniqueName(ntree, node); } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } } @@ -2399,7 +2399,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 269, 1)) { /* Removal of Cycles SSS Compatible falloff */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2410,12 +2410,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 269, 2)) { /* Initialize CDL settings for Color Balance nodes */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2437,7 +2437,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) { @@ -2590,7 +2590,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) SEQ_END } - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2608,7 +2608,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) { diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 61aa1fc1a02..64c6cc9a052 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -379,7 +379,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* nodes don't use fixed node->id any more, clean up */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -388,7 +388,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; { bScreen *screen; @@ -779,7 +779,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "NodePlaneTrackDeformData", "char", "flag")) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -792,7 +792,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } if (!DNA_struct_elem_find(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) { @@ -879,7 +879,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 274, 2)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { bNode *node; bNodeSocket *sock; @@ -902,7 +902,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 274, 4)) { @@ -1694,7 +1694,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Fix for T50736, Glare comp node using same var for two different things. */ if (!DNA_struct_elem_find(fd->filesdna, "NodeGlare", "char", "star_45")) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { ntreeSetTypes(NULL, ntree); for (bNode *node = ntree->nodes.first; node; node = node->next) { @@ -1713,7 +1713,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "mat[4][4]")) { @@ -1727,11 +1727,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { do_versions_compositor_render_passes(ntree); } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) { @@ -1852,7 +1852,7 @@ void do_versions_after_linking_270(Main *bmain) { /* To be added to next subversion bump! */ if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) { - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { ntreeSetTypes(NULL, ntree); for (bNode *node = ntree->nodes.first; node; node = node->next) { @@ -1861,7 +1861,7 @@ void do_versions_after_linking_270(Main *bmain) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (!MAIN_VERSION_ATLEAST(bmain, 279, 2)) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 71a98efd25b..2283928b1a8 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -3113,7 +3113,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) #ifdef USE_NODE_COMPAT_CUSTOMNODES static void customnodes_add_deprecated_data(Main *mainvar) { - FOREACH_NODETREE(mainvar, ntree, id) { + FOREACH_NODETREE_BEGIN(mainvar, ntree, id) { bNodeLink *link, *last_link = ntree->links.last; /* only do this for node groups */ @@ -3160,13 +3160,12 @@ static void customnodes_add_deprecated_data(Main *mainvar) break; } } - } - FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } static void customnodes_free_deprecated_data(Main *mainvar) { - FOREACH_NODETREE(mainvar, ntree, id) { + FOREACH_NODETREE_BEGIN(mainvar, ntree, id) { bNodeLink *link, *next_link; for (link = ntree->links.first; link; link = next_link) { @@ -3175,8 +3174,7 @@ static void customnodes_free_deprecated_data(Main *mainvar) nodeRemLink(ntree, link); } } - } - FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } #endif |