From e305560f13c3c67b048dc3889c7797eae2e345c4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Jan 2019 00:06:58 +1100 Subject: Cleanup: add trailing commas to structs Needed for clang formatting to workaround bug/limit, see: T53211 --- source/blender/editors/armature/armature_select.c | 3 ++- .../editors/gizmo_library/gizmo_types/cage2d_gizmo.c | 8 ++++---- source/blender/editors/interface/interface_draw.c | 14 +++++++------- source/blender/editors/interface/interface_templates.c | 2 +- source/blender/editors/screen/screen_draw.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 2 +- .../blender/editors/space_outliner/outliner_collections.c | 10 +++++----- source/blender/editors/space_sequencer/sequencer_scopes.c | 4 ++-- source/blender/editors/space_view3d/view3d_draw_legacy.c | 2 +- source/blender/editors/transform/transform_snap_object.c | 4 ++-- 10 files changed, 26 insertions(+), 25 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 830798fa737..da82bc4bbce 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -269,7 +269,8 @@ void *get_nearest_bone( if (vc.obedit != NULL) { bases = BKE_view_layer_array_from_bases_in_mode( vc.view_layer, vc.v3d, &bases_len, { - .object_mode = OB_MODE_EDIT}); + .object_mode = OB_MODE_EDIT, + }); } else { bases = BKE_object_pose_base_array_get(vc.view_layer, vc.v3d, &bases_len); diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c index 04015ee9f1e..df0c9f084fd 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c @@ -761,10 +761,10 @@ static int gizmo_cage2d_test_select( /* if gizmo does not have a scale intersection, don't do it */ if (transform_flag & (ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE | ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM)) { - const rctf r_xmin = {.xmin = -size[0], .ymin = -size[1], .xmax = -size[0] + margin[0], .ymax = size[1]}; - const rctf r_xmax = {.xmin = size[0] - margin[0], .ymin = -size[1], .xmax = size[0], .ymax = size[1]}; - const rctf r_ymin = {.xmin = -size[0], .ymin = -size[1], .xmax = size[0], .ymax = -size[1] + margin[1]}; - const rctf r_ymax = {.xmin = -size[0], .ymin = size[1] - margin[1], .xmax = size[0], .ymax = size[1]}; + const rctf r_xmin = { .xmin = -size[0], .ymin = -size[1], .xmax = -size[0] + margin[0], .ymax = size[1], }; + const rctf r_xmax = { .xmin = size[0] - margin[0], .ymin = -size[1], .xmax = size[0], .ymax = size[1], }; + const rctf r_ymin = { .xmin = -size[0], .ymin = -size[1], .xmax = size[0], .ymax = -size[1] + margin[1], }; + const rctf r_ymax = { .xmin = -size[0], .ymin = size[1] - margin[1], .xmax = size[0], .ymax = size[1], }; if (BLI_rctf_isect_pt_v(&r_xmin, point_local)) { if (BLI_rctf_isect_pt_v(&r_ymin, point_local)) { diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 777df75cbf9..ac1578d885d 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -795,7 +795,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(ar), uiBut *but, const uiWidgetColors .xmin = (float)recti->xmin + 1, .xmax = (float)recti->xmax - 1, .ymin = (float)recti->ymin + 1, - .ymax = (float)recti->ymax - 1 + .ymax = (float)recti->ymax - 1, }; float w = BLI_rctf_size_x(&rect); @@ -901,7 +901,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(ar), uiBut *but, const uiWidgetColors .xmin = (float)recti->xmin + 1, .xmax = (float)recti->xmax - 1, .ymin = (float)recti->ymin + 1, - .ymax = (float)recti->ymax - 1 + .ymax = (float)recti->ymax - 1, }; if (scopes->wavefrm_yfac < 0.5f) @@ -1187,7 +1187,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(ar), uiBut *but, const uiWidgetColo .xmin = (float)recti->xmin + 1, .xmax = (float)recti->xmax - 1, .ymin = (float)recti->ymin + 1, - .ymax = (float)recti->ymax - 1 + .ymax = (float)recti->ymax - 1, }; float w = BLI_rctf_size_x(&rect); @@ -1639,7 +1639,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons .xmin = rect->xmin, .ymin = rect->ymin, .xmax = rect->xmax, - .ymax = rect->ymax + .ymax = rect->ymax, }; rcti scissor_region = {0, ar->winx, 0, ar->winy}; BLI_rcti_isect(&scissor_new, &scissor_region, &scissor_new); @@ -1664,7 +1664,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons .xmin = rect->xmin + zoomx * (-offsx), .xmax = grid.xmin + zoomx, .ymin = rect->ymin + zoomy * (-offsy), - .ymax = grid.ymin + zoomy + .ymax = grid.ymin + zoomy, }; ui_draw_gradient(&grid, col, UI_GRAD_H, 1.0f); @@ -1876,7 +1876,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(ar), uiBut *but, const uiWidgetCol .xmin = (float)recti->xmin + 1, .xmax = (float)recti->xmax - 1, .ymin = (float)recti->ymin + 1, - .ymax = (float)recti->ymax - 1 + .ymax = (float)recti->ymax - 1, }; int width = BLI_rctf_size_x(&rect) + 1; @@ -2028,7 +2028,7 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, const uiWidgetColors *UNUSE .xmin = recti->xmin, .ymin = recti->ymin, .xmax = recti->xmax, - .ymax = recti->ymax + .ymax = recti->ymax, }; rcti scissor_region = {0, ar->winx, 0, ar->winy}; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d7e3dbf6e32..f77a7dcdeb2 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -4433,7 +4433,7 @@ eAutoPropButsReturn uiTemplateOperatorPropertyButs( else { wmWindowManager *wm = CTX_wm_manager(C); PointerRNA ptr; - struct uiTemplateOperatorPropertyPollParam user_data = {.C = C, .op = op, .flag = flag}; + struct uiTemplateOperatorPropertyPollParam user_data = { .C = C, .op = op, .flag = flag, }; RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index ca3707786dd..90fd86c5a96 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -564,7 +564,7 @@ static void screen_preview_draw_areas(const bScreen *screen, const float scale[2 .xmin = sa->totrct.xmin * scale[0] + ofs_h, .xmax = sa->totrct.xmax * scale[0] - ofs_h, .ymin = sa->totrct.ymin * scale[1] + ofs_h, - .ymax = sa->totrct.ymax * scale[1] - ofs_h + .ymax = sa->totrct.ymax * scale[1] - ofs_h, }; immBegin(GPU_PRIM_TRI_FAN, 4); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 2cba6cf2fb2..e71aee42a1e 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -603,7 +603,7 @@ static void nla_draw_strip_text( .xmin = xminc, .ymin = yminc, .xmax = xmaxc, - .ymax = ymaxc + .ymax = ymaxc, }; /* add this string to the cache of texts to draw */ diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index d219457aeac..4ff818f793a 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -267,7 +267,7 @@ static int collection_delete_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); SpaceOops *soops = CTX_wm_space_outliner(C); - struct CollectionEditData data = {.scene = scene, .soops = soops}; + struct CollectionEditData data = {.scene = scene, .soops = soops,}; bool hierarchy = RNA_boolean_get(op->ptr, "hierarchy"); data.collections_to_edit = BLI_gset_ptr_new(__func__); @@ -488,7 +488,7 @@ static int collection_link_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); Collection *active_collection = CTX_data_layer_collection(C)->collection; SpaceOops *soops = CTX_wm_space_outliner(C); - struct CollectionEditData data = {.scene = scene, .soops = soops}; + struct CollectionEditData data = {.scene = scene, .soops = soops,}; data.collections_to_edit = BLI_gset_ptr_new(__func__); @@ -536,7 +536,7 @@ static int collection_instance_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); SpaceOops *soops = CTX_wm_space_outliner(C); - struct CollectionEditData data = {.scene = scene, .soops = soops}; + struct CollectionEditData data = {.scene = scene, .soops = soops,}; data.collections_to_edit = BLI_gset_ptr_new(__func__); @@ -623,7 +623,7 @@ static bool collections_view_layer_poll(bContext *C, bool clear, int flag) } Scene *scene = CTX_data_scene(C); - struct CollectionEditData data = {.scene = scene, .soops = soops}; + struct CollectionEditData data = {.scene = scene, .soops = soops,}; data.collections_to_edit = BLI_gset_ptr_new(__func__); bool result = false; @@ -695,7 +695,7 @@ static int collection_view_layer_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); SpaceOops *soops = CTX_wm_space_outliner(C); - struct CollectionEditData data = {.scene = scene, .soops = soops}; + struct CollectionEditData data = {.scene = scene, .soops = soops,}; bool clear = strstr(op->idname, "clear") != NULL; int flag = strstr(op->idname, "holdout") ? LAYER_COLLECTION_HOLDOUT : strstr(op->idname, "indirect_only") ? LAYER_COLLECTION_INDIRECT_ONLY : diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 00811d68251..1d317c2da44 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -503,7 +503,7 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf) memset(bins, 0, sizeof(bins)); - MakeHistogramViewData data = {.ibuf = ibuf, .bins = bins}; + MakeHistogramViewData data = { .ibuf = ibuf, .bins = bins, }; ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.use_threading = (ibuf->y >= 256); @@ -588,7 +588,7 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf) memset(bins, 0, sizeof(bins)); - MakeHistogramViewData data = {.ibuf = ibuf, .bins = bins}; + MakeHistogramViewData data = { .ibuf = ibuf, .bins = bins, }; ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.use_threading = (ibuf->y >= 256); diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index c9a6a9d608b..1dce9cecc27 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -767,7 +767,7 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect) .xmin = 0, .xmax = ar->winx - 1, .ymin = 0, - .ymax = ar->winy - 1 + .ymax = ar->winy - 1, }; /* Constrain rect to depth bounds */ diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index feca8f3f47a..b409e6059b4 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -454,7 +454,7 @@ static bool raycastMesh( retval = data.retval; } else { - BVHTreeRayHit hit = {.index = -1, .dist = local_depth}; + BVHTreeRayHit hit = { .index = -1, .dist = local_depth, }; if (BLI_bvhtree_ray_cast( treedata->tree, ray_start_local, ray_normal_local, 0.0f, @@ -622,7 +622,7 @@ static bool raycastEditMesh( retval = data.retval; } else { - BVHTreeRayHit hit = {.index = -1, .dist = local_depth}; + BVHTreeRayHit hit = { .index = -1, .dist = local_depth, }; if (BLI_bvhtree_ray_cast( treedata->tree, ray_start_local, ray_normal_local, 0.0f, -- cgit v1.2.3