From 3612ce55796427a67ba070df165b46698b2d9ace Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Nov 2018 15:22:01 +1100 Subject: Cleanup: name macros w/ matching BEGIN/END --- source/blender/blenkernel/BKE_node.h | 14 ++--- source/blender/blenkernel/intern/depsgraph.c | 4 +- source/blender/blenkernel/intern/library_remap.c | 4 +- source/blender/blenkernel/intern/node.c | 10 ++-- source/blender/blenkernel/intern/scene.c | 4 +- source/blender/blenloader/intern/readfile.c | 20 +++---- source/blender/blenloader/intern/versioning_250.c | 5 +- source/blender/blenloader/intern/versioning_260.c | 64 +++++++++++------------ source/blender/blenloader/intern/versioning_270.c | 24 ++++----- source/blender/blenloader/intern/writefile.c | 10 ++-- source/blender/editors/object/object_relations.c | 4 +- source/blender/editors/space_node/node_draw.c | 4 +- source/blender/editors/space_node/node_edit.c | 12 ++--- 13 files changed, 88 insertions(+), 91 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 09860972802..852285492d2 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -37,7 +37,7 @@ #include "DNA_listBase.h" -/* for FOREACH_NODETREE */ +/* for FOREACH_NODETREE_BEGIN */ #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_node_types.h" @@ -643,17 +643,17 @@ void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree); * Examples: * * \code{.c} - * FOREACH_NODETREE(bmain, nodetree, id) { + * FOREACH_NODETREE_BEGIN(bmain, nodetree, id) { * if (id == nodetree) * printf("This is a linkable node tree"); - * } FOREACH_NODETREE_END + * } FOREACH_NODETREE_END; * - * FOREACH_NODETREE(bmain, nodetree, id) { + * FOREACH_NODETREE_BEGIN(bmain, nodetree, id) { * if (nodetree->idname == "ShaderNodeTree") * printf("This is a shader node tree); * if (GS(id) == ID_MA) * printf(" and it's owned by a material"); - * } FOREACH_NODETREE_END + * } FOREACH_NODETREE_END; * \endcode * * \{ @@ -674,7 +674,7 @@ void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *b bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter, struct bNodeTree **r_nodetree, struct ID **r_id); -#define FOREACH_NODETREE(bmain, _nodetree, _id) \ +#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id) \ { \ struct NodeTreeIterStore _nstore; \ bNodeTree *_nodetree; \ @@ -687,7 +687,7 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter, #define FOREACH_NODETREE_END \ } \ } \ -} +} ((void)0) /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 15d08f5a230..621cd6cf5c8 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2792,7 +2792,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id) * could be with the current depsgraph design/ */ if (idtype == ID_IM) { - FOREACH_NODETREE(bmain, ntree, parent_id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, parent_id) { if (ntree->type == NTREE_SHADER) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) { @@ -2802,7 +2802,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id) } } } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (idtype == ID_MSK) { diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index f791d9a6591..604e7754352 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -406,10 +406,10 @@ static void libblock_remap_data_postprocess_nodetree_update(Main *bmain, ID *new ntreeVerifyNodes(bmain, new_id); /* Update node trees as necessary. */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { /* make an update call for the tree */ ntreeUpdateTree(bmain, ntree); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } /** diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index b3f210dfba5..82f619da9c6 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -226,7 +226,7 @@ static void update_typeinfo(Main *bmain, const struct bContext *C, bNodeTreeType if (!bmain) return; - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { bNode *node; bNodeSocket *sock; @@ -257,7 +257,7 @@ static void update_typeinfo(Main *bmain, const struct bContext *C, bNodeTreeType if (socktype && STREQ(sock->idname, socktype->idname)) node_socket_set_typeinfo(ntree, sock, unregister ? NULL : socktype); } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } /* Try to initialize all typeinfo in a node tree. @@ -2998,13 +2998,13 @@ static void ntree_validate_links(bNodeTree *ntree) void ntreeVerifyNodes(struct Main *main, struct ID *id) { - FOREACH_NODETREE(main, ntree, owner_id) { + FOREACH_NODETREE_BEGIN(main, ntree, owner_id) { bNode *node; for (node = ntree->nodes.first; node; node = node->next) if (node->typeinfo->verifyfunc) node->typeinfo->verifyfunc(ntree, node, id); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } void ntreeUpdateTree(Main *bmain, bNodeTree *ntree) @@ -3770,7 +3770,7 @@ void free_nodesystem(void) /* -------------------------------------------------------------------- */ -/* NodeTree Iterator Helpers (FOREACH_NODETREE) */ +/* NodeTree Iterator Helpers (FOREACH_NODETREE_BEGIN) */ void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 9689ab173a8..3947ca157c0 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1940,13 +1940,13 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc if (!use_new_eval && DAG_id_type_tagged(bmain, ID_NT)) { float ctime = BKE_scene_frame_get(scene); - FOREACH_NODETREE(bmain, ntree, id) + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { AnimData *adt = BKE_animdata_from_id(&ntree->id); if (adt && (adt->recalc & ADT_RECALC_ANIM)) BKE_animsys_evaluate_animdata(scene, &ntree->id, adt, ctime, 0); } - FOREACH_NODETREE_END + FOREACH_NODETREE_END; } #endif 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 diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 151df5993ed..d27edb5a9e4 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2095,7 +2095,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo } /* Relink nodetrees' pointers that have been duplicated. */ - FOREACH_NODETREE(bmain, ntree, id) + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { /* This is a bit convoluted, we want to root ntree of copied IDs and only those, * so we first check that old ID has been copied and that ntree is root tree of old ID, @@ -2104,7 +2104,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo ntree = ntreeFromID(id->newid); BKE_libblock_relink_to_newid(&ntree->id); } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; /* Relink datablock pointer properties */ { diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 3b6a227d124..9a7d913f24e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -167,11 +167,11 @@ void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree, bNode *node) /* look through all datablocks, to support groups */ if (do_tag_update) { - FOREACH_NODETREE(bmain, tntree, id) { + FOREACH_NODETREE_BEGIN(bmain, tntree, id) { /* check if nodetree uses the group */ if (ntreeHasTree(tntree, ntree)) ED_node_tag_update_id(id); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } if (ntree->type == NTREE_TEXTURE) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 97c5157486d..c1fd7aa120f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -329,10 +329,10 @@ void snode_dag_update(bContext *C, SpaceNode *snode) /* for groups, update all ID's using this */ if (snode->edittree != snode->nodetree) { - FOREACH_NODETREE(bmain, tntree, id) { + FOREACH_NODETREE_BEGIN(bmain, tntree, id) { if (ntreeHasTree(tntree, snode->edittree)) DAG_id_tag_update(id, 0); - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; } DAG_id_tag_update(snode->id, 0); @@ -2452,17 +2452,17 @@ static int node_shader_script_update_exec(bContext *C, wmOperator *op) if (text) { /* clear flags for recursion check */ - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) ntree->done = false; - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; - FOREACH_NODETREE(bmain, ntree, id) { + FOREACH_NODETREE_BEGIN(bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { if (!ntree->done) found |= node_shader_script_update_text_recursive(engine, type, ntree, text); } - } FOREACH_NODETREE_END + } FOREACH_NODETREE_END; if (!found) BKE_report(op->reports, RPT_INFO, "Text not used by any node, no update done"); -- cgit v1.2.3 From 6429e6c91ef4422083ed56b068dea636a322fe12 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Nov 2018 15:35:15 +1100 Subject: Cleanup: ensure '_END' macros end with a semicolon Missing these breaks auto-indent for editors that don't expand macros. --- source/blender/blenkernel/BKE_node.h | 2 +- source/blender/blenkernel/BKE_sequencer.h | 2 +- source/blender/blenkernel/intern/bpath.c | 4 +-- source/blender/blenkernel/intern/ipo.c | 3 +- source/blender/blenkernel/intern/library_query.c | 3 +- source/blender/blenkernel/intern/node.c | 12 ++++---- source/blender/blenkernel/intern/sequencer.c | 3 +- source/blender/blenloader/intern/readfile.c | 9 ++---- source/blender/blenloader/intern/versioning_250.c | 12 +++----- source/blender/blenloader/intern/versioning_260.c | 9 ++---- source/blender/blenloader/intern/versioning_270.c | 6 ++-- .../blender/blenloader/intern/versioning_legacy.c | 9 ++---- source/blender/blenloader/intern/writefile.c | 6 ++-- source/blender/editors/sound/sound_ops.c | 3 +- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_node/drawnode.c | 4 +-- source/blender/editors/space_node/node_templates.c | 3 +- .../editors/space_sequencer/sequencer_edit.c | 24 ++++++---------- .../editors/space_sequencer/sequencer_modifier.c | 3 +- .../editors/space_sequencer/sequencer_select.c | 4 +-- source/blender/imbuf/intern/colormanagement.c | 3 +- source/blender/makesrna/RNA_access.h | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 33 +++++++++++----------- 23 files changed, 64 insertions(+), 97 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 852285492d2..3d78b95001d 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -413,7 +413,7 @@ struct GHashIterator *nodeTypeGetIterator(void); #define NODE_TYPES_END \ } \ BLI_ghashIterator_free(__node_type_iter__); \ -} +} ((void)0) struct bNodeSocketType *nodeSocketTypeFind(const char *idname); void nodeRegisterSocketType(struct bNodeSocketType *stype); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index c408597de32..705143480d2 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -89,7 +89,7 @@ void BKE_sequence_iterator_end(SeqIterator *iter); #define SEQ_END \ } \ BKE_sequence_iterator_end(&iter_macro); \ - } + } ((void)0) typedef struct SeqRenderData { struct EvaluationContext *eval_ctx; diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index 0b191e1f69b..f80a13343d5 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -631,9 +631,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int rewrite_path_fixed(seq->strip->dir, visit_cb, absbase, bpath_user_data); } } - - } - SEQ_END + } SEQ_END; } break; } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c11f2368197..effbff37c33 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1976,8 +1976,7 @@ void do_versions_ipos_to_animato(Main *bmain) id_us_min(&seq->ipo->id); seq->ipo = NULL; - } - SEQ_END + } SEQ_END; } } diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 3292f0d6640..f5367f6f8b3 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -455,8 +455,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call for (SequenceModifierData *smd = seq->modifiers.first; smd; smd = smd->next) { CALLBACK_INVOKE(smd->mask_id, IDWALK_CB_USER); } - } - SEQ_END + } SEQ_END; } CALLBACK_INVOKE(scene->gpd, IDWALK_CB_USER); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 82f619da9c6..2946fb29863 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -918,7 +918,7 @@ bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type) { const char *idname = NULL; - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { /* do an extra poll here, because some int types are used * for multiple node types, this helps find the desired type */ @@ -926,7 +926,7 @@ bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type) idname = ntype->idname; break; } - NODE_TYPES_END + } NODE_TYPES_END; if (!idname) { printf("Error: static node type %d undefined\n", type); return NULL; @@ -3732,23 +3732,23 @@ void init_nodesystem(void) void free_nodesystem(void) { if (nodetypes_hash) { - NODE_TYPES_BEGIN(nt) + NODE_TYPES_BEGIN(nt) { if (nt->ext.free) { nt->ext.free(nt->ext.data); } - NODE_TYPES_END + } NODE_TYPES_END; BLI_ghash_free(nodetypes_hash, NULL, node_free_type); nodetypes_hash = NULL; } if (nodesockettypes_hash) { - NODE_SOCKET_TYPES_BEGIN(st) + NODE_SOCKET_TYPES_BEGIN(st) { if (st->ext_socket.free) st->ext_socket.free(st->ext_socket.data); if (st->ext_interface.free) st->ext_interface.free(st->ext_interface.data); - NODE_SOCKET_TYPES_END + } NODE_SOCKET_TYPES_END; BLI_ghash_free(nodesockettypes_hash, NULL, node_free_socket_type); nodesockettypes_hash = NULL; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index c2a96d4f1ff..57b3cd41047 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -469,8 +469,7 @@ void BKE_sequencer_editing_free(Scene *scene, const bool do_id_user) { /* handle cache freeing above */ BKE_sequence_free_ex(scene, seq, false, do_id_user); - } - SEQ_END + } SEQ_END; BLI_freelistN(&ed->metastack); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ead3b324644..57d4978c776 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5867,8 +5867,7 @@ static void lib_link_scene(FileData *fd, Main *main) BLI_listbase_clear(&seq->anims); lib_link_sequence_modifiers(fd, sce, &seq->modifiers); - } - SEQ_END + } SEQ_END; for (TimeMarker *marker = sce->markers.first; marker; marker = marker->next) { if (marker->camera) { @@ -6162,8 +6161,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) } direct_link_sequence_modifiers(fd, &seq->modifiers); - } - SEQ_END + } SEQ_END; /* link metastack, slight abuse of structs here, have to restore pointer to internal part in struct */ { @@ -9744,8 +9742,7 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) if (seq->clip) expand_doit(fd, mainvar, seq->clip); if (seq->mask) expand_doit(fd, mainvar, seq->mask); if (seq->sound) expand_doit(fd, mainvar, seq->sound); - } - SEQ_END + } SEQ_END; } if (sce->rigidbody_world) { diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 835acbc853d..a6d8b6de606 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -793,8 +793,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } #undef SEQ_USE_PROXY_CUSTOM_DIR #undef SEQ_USE_PROXY_CUSTOM_FILE - } - SEQ_END + } SEQ_END; } } @@ -1758,8 +1757,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) SEQ_BEGIN (sce->ed, seq) { seq->volume = 1.0f; - } - SEQ_END + } SEQ_END; } /* particle brush strength factor was changed from int to float */ @@ -2034,8 +2032,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (seq->sat == 0.0f) { seq->sat = 1.0f; } - } - SEQ_END + } SEQ_END; } } @@ -2580,8 +2577,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) SEQ_BEGIN(scene->ed, seq) { seq->pitch = 1.0f; - } - SEQ_END + } SEQ_END; } } diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index f630dbe1aaf..af291981e7f 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -1520,8 +1520,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) MEM_freeN(strip->color_balance); strip->color_balance = NULL; } - } - SEQ_END + } SEQ_END; } } } @@ -1880,8 +1879,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) else { BKE_sequence_alpha_mode_from_extension(seq); } - } - SEQ_END + } SEQ_END; if (scene->r.bake_samples == 0) scene->r.bake_samples = 256; @@ -2586,8 +2584,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) WipeVars *wv = seq->effectdata; wv->angle = DEG2RADF(wv->angle); } - } - SEQ_END + } SEQ_END; } FOREACH_NODETREE_BEGIN(bmain, ntree, id) { diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 64c6cc9a052..7884a628147 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -940,8 +940,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) #undef SEQ_USE_PROXY_CUSTOM_DIR #undef SEQ_USE_PROXY_CUSTOM_FILE - } - SEQ_END + } SEQ_END; } for (screen = bmain->screen.first; screen; screen = screen->id.next) { @@ -1325,8 +1324,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) copy_v4_fl(data->color, 1.0f); data->shadow_color[3] = 1.0f; } - } - SEQ_END + } SEQ_END; } /* Adding "Properties" region to DopeSheet */ diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 48d90787b51..9708e24b351 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1816,8 +1816,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) { if (seq->type == SEQ_TYPE_IMAGE || seq->type == SEQ_TYPE_MOVIE) seq->alpha_mode = SEQ_ALPHA_STRAIGHT; - } - SEQ_END + } SEQ_END; } sce = sce->id.next; @@ -3184,8 +3183,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) { if (seq->blend_mode == 0) seq->blend_opacity = 100.0f; - } - SEQ_END + } SEQ_END; } } @@ -3540,8 +3538,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (seq->strip && seq->strip->proxy) { seq->strip->proxy->quality = 90; } - } - SEQ_END + } SEQ_END; } sce = sce->id.next; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 2283928b1a8..4f48318582a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2565,8 +2565,7 @@ static void write_scene(WriteData *wd, Scene *sce) seq->strip->done = false; } writestruct(wd, DATA, Sequence, 1, seq); - } - SEQ_END + } SEQ_END; SEQ_BEGIN(ed, seq) { @@ -2632,8 +2631,7 @@ static void write_scene(WriteData *wd, Scene *sce) } write_sequence_modifiers(wd, &seq->modifiers); - } - SEQ_END + } SEQ_END; /* new; meta stack too, even when its nasty restore code */ for (MetaStack *ms = ed->metastack.first; ms; ms = ms->next) { diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index b605bd6e1a7..832505c2281 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -267,8 +267,7 @@ static void sound_update_animation_flags(Scene *scene) SEQ_BEGIN(scene->ed, seq) { BKE_sequencer_recursive_apply(seq, sound_update_animation_flags_cb, scene); - } - SEQ_END + } SEQ_END; fcu = id_data_find_fcurve(&scene->id, scene, &RNA_Scene, "audio_volume", 0, &driven); if (fcu || driven) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 561b7b99d59..df303a7bf11 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1134,7 +1134,7 @@ static void image_sequence_get_frame_ranges(PointerRNA *ptr, ListBase *frames_al BLI_addtail(&frame_range->frames, frame); MEM_freeN(filename); } - RNA_END + RNA_END; } static int image_cmp_frame(const void *a, const void *b) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 46172da6b04..0dc057e754b 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3057,7 +3057,7 @@ void ED_node_init_butfuncs(void) NodeSocketTypeUndefined.interface_draw_color = node_socket_undefined_interface_draw_color; /* node type ui functions */ - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { /* default ui functions */ ntype->draw_nodetype = node_draw_default; ntype->draw_nodetype_prepare = node_update_default; @@ -3075,7 +3075,7 @@ void ED_node_init_butfuncs(void) /* define update callbacks for socket properties */ node_template_properties_update(ntype); - NODE_TYPES_END + } NODE_TYPES_END; /* tree type icons */ ntreeType_Composite->ui_icon = ICON_RENDERLAYERS; diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index c45a5c650ee..6995744f235 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -473,8 +473,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) } BLI_array_append(sorted_ntypes, ntype); - } - NODE_TYPES_END + } NODE_TYPES_END; qsort(sorted_ntypes, BLI_array_len(sorted_ntypes), sizeof(bNodeType *), ui_node_item_name_compare); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 04cb5c7a37c..d9cc7cb2c36 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -217,8 +217,7 @@ static void seq_proxy_build_job(const bContext *C) if ((seq->flag & SELECT)) { BKE_sequencer_proxy_rebuild_context(pj->main, pj->scene, seq, file_list, &pj->queue); } - } - SEQ_END + } SEQ_END; BLI_gset_free(file_list, MEM_freeN); @@ -455,8 +454,7 @@ void ED_sequencer_deselect_all(Scene *scene) SEQP_BEGIN (ed, seq) { seq->flag &= ~SEQ_ALLSEL; - } - SEQ_END + } SEQ_END; } @@ -645,8 +643,7 @@ static void del_seq_clear_modifiers_recurs(Scene *scene, Sequence *deleting_sequ } } } - } - SEQ_END + } SEQ_END; } static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short deleteall) @@ -993,8 +990,7 @@ static void set_filter_seq(Scene *scene) } } - } - SEQ_END + } SEQ_END; } #endif @@ -1034,8 +1030,7 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene) printf("new %s\n", seq->strip->dir); } } - } - SEQ_END + } SEQ_END; } @@ -3518,8 +3513,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) } BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); } - } - SEQ_END + } SEQ_END; BLI_gset_free(file_list, MEM_freeN); @@ -3597,8 +3591,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) seq->strip->proxy->build_flags &= ~SEQ_PROXY_SKIP_EXISTING; } } - } - SEQ_END + } SEQ_END; WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -3946,8 +3939,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) if (seq->type == SEQ_TYPE_TEXT) { BLI_addtail(&text_seq, MEM_dupallocN(seq)); } - } - SEQ_END + } SEQ_END; if (BLI_listbase_is_empty(&text_seq)) { BKE_report(op->reports, RPT_ERROR, "No subtitles (text strips) to export"); diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.c b/source/blender/editors/space_sequencer/sequencer_modifier.c index 3c4481b32cb..1b2357ef6a5 100644 --- a/source/blender/editors/space_sequencer/sequencer_modifier.c +++ b/source/blender/editors/space_sequencer/sequencer_modifier.c @@ -247,8 +247,7 @@ static int strip_modifier_copy_exec(bContext *C, wmOperator *op) BKE_sequence_modifier_list_copy(seq_iter, seq); } - } - SEQ_END + } SEQ_END; BKE_sequence_invalidate_cache(scene, seq); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index e01c7994329..1a9ef7970a4 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -381,8 +381,8 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e seq->flag |= SELECT; recurs_sel_seq(seq); } - } - SEQ_END + } SEQ_END; + { SpaceSeq *sseq = CTX_wm_space_seq(C); if (sseq && sseq->flag & SEQ_MARKER_TRANS) { diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 1d287025a4e..86c4156ad8b 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1133,8 +1133,7 @@ void IMB_colormanagement_check_file_config(Main *bmain) if (seq->strip) { colormanage_check_colorspace_settings(&seq->strip->colorspace_settings, "sequencer strip"); } - } - SEQ_END + } SEQ_END; } /* ** check input color space settings ** */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index a026d8e875e..de46605bc40 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1091,7 +1091,7 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); #define RNA_END \ } \ RNA_property_collection_end(&rna_macro_iter); \ - } + } ((void)0) #define RNA_PROP_BEGIN(sptr, itemptr, prop) \ { \ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 68f0272c035..abb88a44b4c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -287,26 +287,26 @@ const EnumPropertyItem *rna_node_tree_type_itemf(void *data, bool (*poll)(void * int rna_node_type_to_enum(bNodeType *typeinfo) { int i = 0, result = -1; - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { if (ntype == typeinfo) { result = i; break; } ++i; - NODE_TYPES_END + } NODE_TYPES_END; return result; } int rna_node_idname_to_enum(const char *idname) { int i = 0, result = -1; - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { if (STREQ(ntype->idname, idname)) { result = i; break; } ++i; - NODE_TYPES_END + } NODE_TYPES_END; return result; } @@ -314,13 +314,13 @@ bNodeType *rna_node_type_from_enum(int value) { int i = 0; bNodeType *result = NULL; - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { if (i == value) { result = ntype; break; } ++i; - NODE_TYPES_END + } NODE_TYPES_END; return result; } @@ -330,7 +330,7 @@ const EnumPropertyItem *rna_node_type_itemf(void *data, bool (*poll)(void *data, EnumPropertyItem tmp = {0}; int totitem = 0, i = 0; - NODE_TYPES_BEGIN(ntype) + NODE_TYPES_BEGIN(ntype) { if (poll && !poll(data, ntype)) { ++i; continue; @@ -345,7 +345,7 @@ const EnumPropertyItem *rna_node_type_itemf(void *data, bool (*poll)(void *data, RNA_enum_item_add(&item, &totitem, &tmp); ++i; - NODE_TYPES_END + } NODE_TYPES_END; if (totitem == 0) { *r_free = false; @@ -361,26 +361,26 @@ const EnumPropertyItem *rna_node_type_itemf(void *data, bool (*poll)(void *data, int rna_node_socket_type_to_enum(bNodeSocketType *typeinfo) { int i = 0, result = -1; - NODE_SOCKET_TYPES_BEGIN(stype) + NODE_SOCKET_TYPES_BEGIN(stype) { if (stype == typeinfo) { result = i; break; } ++i; - NODE_SOCKET_TYPES_END + } NODE_SOCKET_TYPES_END; return result; } int rna_node_socket_idname_to_enum(const char *idname) { int i = 0, result = -1; - NODE_SOCKET_TYPES_BEGIN(stype) + NODE_SOCKET_TYPES_BEGIN(stype) { if (STREQ(stype->idname, idname)) { result = i; break; } ++i; - NODE_SOCKET_TYPES_END + } NODE_SOCKET_TYPES_END; return result; } @@ -388,13 +388,13 @@ bNodeSocketType *rna_node_socket_type_from_enum(int value) { int i = 0; bNodeSocketType *result = NULL; - NODE_SOCKET_TYPES_BEGIN(stype) + NODE_SOCKET_TYPES_BEGIN(stype) { if (i == value) { result = stype; break; } ++i; - NODE_SOCKET_TYPES_END + } NODE_SOCKET_TYPES_END; return result; } @@ -406,7 +406,7 @@ const EnumPropertyItem *rna_node_socket_type_itemf( int totitem = 0, i = 0; StructRNA *srna; - NODE_SOCKET_TYPES_BEGIN(stype) + NODE_SOCKET_TYPES_BEGIN(stype) { if (poll && !poll(data, stype)) { ++i; continue; @@ -422,7 +422,8 @@ const EnumPropertyItem *rna_node_socket_type_itemf( RNA_enum_item_add(&item, &totitem, &tmp); ++i; - NODE_SOCKET_TYPES_END + } + NODE_SOCKET_TYPES_END; if (totitem == 0) { *r_free = false; -- cgit v1.2.3