From 1f5d51e44ecf99f34d8e733559a9312e5ae3ef33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Apr 2018 07:47:03 +0200 Subject: Cleanup: style --- source/blender/editors/interface/interface_icons.c | 2 +- .../blender/editors/interface/interface_widgets.c | 5 ++--- source/blender/editors/mesh/editmesh_extrude.c | 11 +++-------- source/blender/editors/mesh/editmesh_tools.c | 22 +++++++++------------- source/blender/editors/object/object_edit.c | 15 +++++++-------- source/blender/editors/space_node/drawnode.c | 4 ++-- .../blender/editors/space_outliner/outliner_ops.c | 3 ++- .../blender/editors/space_outliner/outliner_tree.c | 2 +- .../blender/editors/space_view3d/view3d_project.c | 2 +- .../editors/transform/transform_conversions.c | 21 +++++++++++---------- 10 files changed, 39 insertions(+), 48 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 04de8f6c94c..b945965ce6a 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1028,7 +1028,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), * efficient than simple glUniform calls. */ #define ICON_DRAW_CACHE_SIZE 16 -typedef struct IconDrawCall{ +typedef struct IconDrawCall { rctf pos; rctf tex; float color[4]; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 71eb764918d..5cfee9d0e72 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1131,8 +1131,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) } } - if (wtb->tria1.type != ROUNDBOX_TRIA_NONE) - { + if (wtb->tria1.type != ROUNDBOX_TRIA_NONE) { tria_col[0] = wcol->item[0]; tria_col[1] = wcol->item[1]; tria_col[2] = wcol->item[2]; @@ -1162,7 +1161,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) /* for each AA step */ immBegin(GWN_PRIM_TRIS, (wtb->tria1.tot + wtb->tria2.tot) * 3 * WIDGET_AA_JITTER); - if (wtb->tria1.tot){ + if (wtb->tria1.tot) { shape_preset_draw_trias_aa(&wtb->tria1, pos); } if (wtb->tria2.tot) { diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index bedb3b614d1..3031d2e09b3 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -450,9 +450,7 @@ static int edbm_extrude_verts_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); if (em->bm->totvertsel == 0) { @@ -498,9 +496,7 @@ static int edbm_extrude_edges_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); if (em->bm->totedgesel == 0) { @@ -546,8 +542,7 @@ static int edbm_extrude_faces_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); if (em->bm->totfacesel == 0) { diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index e6311b60a39..e4581253286 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1566,8 +1566,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); if (em->bm->totvertsel == 0) { @@ -1578,9 +1577,9 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op) BMesh *bm = em->bm; EDBM_op_init( - em, &bmop, op, - "duplicate geom=%hvef use_select_history=%b", - BM_ELEM_SELECT, true); + em, &bmop, op, + "duplicate geom=%hvef use_select_history=%b", + BM_ELEM_SELECT, true); BMO_op_exec(bm, &bmop); @@ -4099,8 +4098,7 @@ static int edbm_poke_face_exec(bContext *C, wmOperator *op) ViewLayer *view_layer = CTX_data_view_layer(C); uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); @@ -4173,11 +4171,10 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; - BMEditMesh *em = BKE_editmesh_from_object(obedit); + BMOperator bmop; BMOIter oiter; BMFace *f; @@ -4196,11 +4193,11 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) EDBM_selectmode_flush(em); // XXX, TODO - #if 0 +#if 0 if (!EDBM_op_finish(em, &bmop, op, true)) { return OPERATOR_CANCELLED; } - #endif +#endif EDBM_update_generic(em, true, true); } @@ -4371,8 +4368,7 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) - { + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 5565565c679..248501a7baf 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -84,7 +84,6 @@ #include "BKE_editlattice.h" #include "BKE_editmesh.h" #include "BKE_report.h" -#include "BKE_object.h" #include "BKE_workspace.h" #include "BKE_layer.h" @@ -1704,16 +1703,16 @@ static void move_to_collection_menu_create(bContext *UNUSED(C), uiLayout *layout MoveToCollectionData *menu = menu_v; uiItemIntO(layout, - menu->collection->name, - ICON_NONE, - "OBJECT_OT_move_to_collection", - "collection_index", - menu->index); + menu->collection->name, + ICON_NONE, + "OBJECT_OT_move_to_collection", + "collection_index", + menu->index); uiItemS(layout); for (MoveToCollectionData *submenu = menu->submenus.first; - submenu != NULL; - submenu = submenu->next) + submenu != NULL; + submenu = submenu->next) { move_to_collection_menus_items(layout, submenu); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 1cb9c57404a..448286c7c3d 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3441,7 +3441,7 @@ static void nodelink_batch_init(void) Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STATIC); int vcount = LINK_RESOL * 2; /* curve */ vcount += 2; /* restart strip */ - vcount += 3*2; /* arrow */ + vcount += 3 * 2; /* arrow */ vcount *= 2; /* shadow */ vcount += 2; /* restart strip */ GWN_vertbuf_data_alloc(vbo, vcount); @@ -3458,7 +3458,7 @@ static void nodelink_batch_init(void) /* curve strip */ for (int i = 0; i < LINK_RESOL; ++i) { - uv[0] = 255 * (i / (float)(LINK_RESOL-1)); + uv[0] = 255 * (i / (float)(LINK_RESOL - 1)); uv[1] = 0; set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp); uv[1] = 255; diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index ba501ac7db5..543a0b0f8d7 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -288,7 +288,8 @@ static int outliner_item_drag_drop_modal(bContext *C, wmOperator *op, const wmEv * It will fail when there is no next/prev TreeElement, or when the * element is an Override or something else in the future. */ -static bool tree_element_is_collection_get(const TreeElement *te) { +static bool tree_element_is_collection_get(const TreeElement *te) +{ if (te == NULL) { return false; } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index eff726868c7..d418c571a8d 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -2066,7 +2066,7 @@ static bool outliner_element_visible_get(ViewLayer *view_layer, TreeElement *te, } } else if (te->parent != NULL && - TREESTORE(te->parent)->type == 0 && te->parent->idcode == ID_OB) + TREESTORE(te->parent)->type == 0 && te->parent->idcode == ID_OB) { if (exclude_filter & SO_FILTER_NO_OB_CONTENT) { return false; diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 8a52542b2fb..eb86800f4a9 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -400,7 +400,7 @@ bool ED_view3d_win_to_ray( const ARegion *ar, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], const bool do_clip) { - return ED_view3d_win_to_ray_ex(depsgraph,ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip); + return ED_view3d_win_to_ray_ex(depsgraph, ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip); } /** diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 91b5be2f81c..14dd147c309 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1612,6 +1612,11 @@ static int bezt_select_to_transform_triple_flag( static void createTransCurveVerts(TransInfo *t) { + +#define SEL_F1 (1 << 0) +#define SEL_F2 (1 << 1) +#define SEL_F3 (1 << 2) + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Curve *cu = tc->obedit->data; @@ -1629,10 +1634,6 @@ static void createTransCurveVerts(TransInfo *t) /* to be sure */ if (cu->editnurb == NULL) return; - #define SEL_F1 (1 << 0) - #define SEL_F2 (1 << 1) - #define SEL_F3 (1 << 2) - /* count total of vertices, check identical as in 2nd loop for making transdata! */ nurbs = BKE_curve_editNurbs_get(cu); for (nu = nurbs->first; nu; nu = nu->next) { @@ -2644,11 +2645,11 @@ static void createTransEditVerts(TransInfo *t) * correction with quats, relative to the coordinates after * the modifiers that support deform matrices (defcos) */ - #if 0 /* TODO, fix crazyspace+extrude so it can be enabled for general use - campbell */ +#if 0 /* TODO, fix crazyspace+extrude so it can be enabled for general use - campbell */ if ((totleft > 0) || (totleft == -1)) - #else +#else if (totleft > 0) - #endif +#endif { mappedcos = BKE_crazyspace_get_mapped_editverts(t->depsgraph, t->scene, tc->obedit); quats = MEM_mallocN(em->bm->totvert * sizeof(*quats), "crazy quats"); @@ -2793,13 +2794,13 @@ void flushTransNodes(TransInfo *t) float locx, locy; /* weirdo - but the node system is a mix of free 2d elements and dpi sensitive UI */ - #ifdef USE_NODE_CENTER +#ifdef USE_NODE_CENTER locx = (td2d->loc[0] - (BLI_rctf_size_x(&node->totr)) * +0.5f) / dpi_fac; locy = (td2d->loc[1] - (BLI_rctf_size_y(&node->totr)) * -0.5f) / dpi_fac; - #else +#else locx = td2d->loc[0] / dpi_fac; locy = td2d->loc[1] / dpi_fac; - #endif +#endif /* account for parents (nested nodes) */ if (node->parent) { -- cgit v1.2.3