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/editors/object/object_relations.c | 4 ++-- source/blender/editors/space_node/node_draw.c | 4 ++-- source/blender/editors/space_node/node_edit.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors') 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/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 ++-- 7 files changed, 16 insertions(+), 27 deletions(-) (limited to 'source/blender/editors') 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) { -- cgit v1.2.3