From 41d4a1986548e66a652221e4a68c52900474eeff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Apr 2019 08:24:14 +0200 Subject: ClangFormat: format '#if 0' code in source/ --- .../editors/animation/anim_channels_defines.c | 50 ++++++++--- source/blender/editors/animation/anim_deps.c | 5 +- source/blender/editors/armature/armature_utils.c | 2 +- source/blender/editors/armature/meshlaplacian.c | 5 +- source/blender/editors/armature/pose_edit.c | 3 +- source/blender/editors/armature/pose_lib.c | 12 ++- source/blender/editors/curve/editcurve.c | 6 +- .../gizmo_library/gizmo_types/cage3d_gizmo.c | 8 +- source/blender/editors/gpencil/annotate_paint.c | 4 +- source/blender/editors/gpencil/drawgpencil.c | 8 +- source/blender/editors/gpencil/gpencil_paint.c | 4 +- source/blender/editors/include/ED_view3d.h | 5 +- source/blender/editors/include/UI_interface.h | 17 +++- source/blender/editors/interface/interface.c | 3 +- .../editors/interface/interface_context_menu.c | 48 +++++++---- source/blender/editors/interface/interface_draw.c | 68 ++++++++++----- .../blender/editors/interface/interface_layout.c | 5 +- .../editors/interface/interface_templates.c | 10 ++- source/blender/editors/lattice/editlattice_undo.c | 3 +- source/blender/editors/mesh/editmesh_rip.c | 3 +- source/blender/editors/mesh/editmesh_select.c | 7 +- source/blender/editors/mesh/editmesh_utils.c | 6 +- source/blender/editors/mesh/meshtools.c | 13 ++- .../blender/editors/object/object_data_transfer.c | 4 +- source/blender/editors/object/object_relations.c | 8 +- source/blender/editors/physics/particle_edit.c | 8 +- source/blender/editors/render/render_preview.c | 2 +- source/blender/editors/screen/area.c | 7 +- source/blender/editors/screen/screen_ops.c | 6 +- source/blender/editors/screen/workspace_edit.c | 3 +- source/blender/editors/sculpt_paint/paint_image.c | 10 ++- .../editors/sculpt_paint/paint_image_proj.c | 9 +- .../editors/sculpt_paint/paint_image_undo.c | 3 +- source/blender/editors/sculpt_paint/paint_stroke.c | 6 +- source/blender/editors/sculpt_paint/paint_vertex.c | 8 +- source/blender/editors/sculpt_paint/sculpt.c | 5 +- .../blender/editors/space_action/action_select.c | 6 +- source/blender/editors/space_console/console_ops.c | 2 - source/blender/editors/space_file/filelist.c | 25 +++--- source/blender/editors/space_graph/graph_draw.c | 4 +- source/blender/editors/space_image/image_buttons.c | 96 ++++++++++++++++++---- source/blender/editors/space_image/image_ops.c | 15 ++-- source/blender/editors/space_image/space_image.c | 3 +- source/blender/editors/space_info/info_report.c | 21 +++-- source/blender/editors/space_node/drawnode.c | 3 +- source/blender/editors/space_node/node_edit.c | 15 ++-- .../blender/editors/space_outliner/outliner_draw.c | 2 +- .../blender/editors/space_outliner/outliner_edit.c | 23 +++--- .../blender/editors/space_outliner/outliner_tree.c | 33 +++++--- .../editors/space_sequencer/sequencer_draw.c | 24 +++--- .../editors/space_sequencer/sequencer_edit.c | 36 ++++---- .../editors/space_sequencer/sequencer_select.c | 4 +- source/blender/editors/space_text/text_draw.c | 39 ++++++--- source/blender/editors/space_text/text_header.c | 31 +++++-- source/blender/editors/space_view3d/view3d_edit.c | 3 +- .../blender/editors/space_view3d/view3d_project.c | 8 +- .../blender/editors/space_view3d/view3d_select.c | 5 +- source/blender/editors/space_view3d/view3d_view.c | 13 ++- source/blender/editors/transform/transform.c | 3 +- .../editors/transform/transform_conversions.c | 3 +- .../editors/transform/transform_orientations.c | 3 +- source/blender/editors/uvedit/uvedit_ops.c | 6 +- .../blender/editors/uvedit/uvedit_parametrizer.c | 16 ++-- 63 files changed, 544 insertions(+), 272 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 78c17ac7015..a4fc022821a 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -405,7 +405,9 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, Pr #if 0 /* channel type has no settings */ -static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting) +static bool acf_generic_none_setting_valid(bAnimContext *ac, + bAnimListElem *ale, + eAnimChannel_Settings setting) { return false; } @@ -4715,15 +4717,43 @@ void ANIM_channel_draw_widgets(const bContext *C, RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr); UI_block_align_begin(block); - UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); - uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset, yminc, w, ICON_WIDTH, - &ptr, "color", -1, - 0, 0, 0, 0, gpl->info); - - UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); - uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset + w, yminc, w, ICON_WIDTH, - &ptr, "fill_color", -1, - 0, 0, 0, 0, gpl->info); + UI_block_emboss_set(block, + RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); + uiDefButR(block, + UI_BTYPE_COLOR, + 1, + "", + offset, + yminc, + w, + ICON_WIDTH, + &ptr, + "color", + -1, + 0, + 0, + 0, + 0, + gpl->info); + + UI_block_emboss_set(block, + RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE); + uiDefButR(block, + UI_BTYPE_COLOR, + 1, + "", + offset + w, + yminc, + w, + ICON_WIDTH, + &ptr, + "fill_color", + -1, + 0, + 0, + 0, + 0, + gpl->info); UI_block_emboss_set(block, UI_EMBOSS_NONE); UI_block_align_end(block); diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 53fec2e1ef7..df73c78aa18 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -408,7 +408,10 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data) #if 0 if (G.debug & G_DEBUG) { printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n", - __func__, ale->update, ale->type, ale->data); + __func__, + ale->update, + ale->type, + ale->data); } #endif /* Prevent crashes in cases where it can't be handled */ diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 50289197ed4..1afcfaca8aa 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -610,7 +610,7 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis print_m4("premat", premat); print_m4("postmat", postmat); print_m4("difmat", difmat); - printf("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2]))); + printf("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2]))); #endif curBone->roll = -atan2f(difmat[2][0], difmat[2][2]); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index febe2a49174..a9f8925febc 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1476,7 +1476,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR) if (fabsf(mdb->totalphi[b] - 1.0f) > 1e-4f) printf("totalphi deficiency [%s|%d] %d: %.10f\n", - (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]); + (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary", + mdb->semibound[b], + mdb->varidx[b], + mdb->totalphi[b]); #endif /* free */ diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 51641041ea1..599823a6401 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -167,7 +167,8 @@ static bool pose_has_protected_selected(Object *ob, short warn) } } if (pchan) { - if (warn) error("Cannot change Proxy protected bones"); + if (warn) + error("Cannot change Proxy protected bones"); return 1; } } diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 443bcdde028..ce809bee71e 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -1834,9 +1834,15 @@ void POSELIB_OT_browse_interactive(wmOperatorType *ot) // XXX: percentage vs factor? /* not used yet */ #if 0 - RNA_def_float_factor( - ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor", - "Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f); + RNA_def_float_factor(ot->srna, + "blend_factor", + 1.0f, + 0.0f, + 1.0f, + "Blend Factor", + "Amount that the pose is applied on top of the existing poses", + 0.0f, + 1.0f); #endif } diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index c37ce4cc89d..17582da2256 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -104,11 +104,13 @@ void printknots(Object *obedit) if (ED_curve_nurb_select_check(nu) && nu->type == CU_NURBS) { if (nu->knotsu) { num = KNOTSU(nu); - for (a = 0; a < num; a++) printf("knotu %d: %f\n", a, nu->knotsu[a]); + for (a = 0; a < num; a++) + printf("knotu %d: %f\n", a, nu->knotsu[a]); } if (nu->knotsv) { num = KNOTSV(nu); - for (a = 0; a < num; a++) printf("knotv %d: %f\n", a, nu->knotsv[a]); + for (a = 0; a < num; a++) + printf("knotv %d: %f\n", a, nu->knotsv[a]); } } } diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c index 3273012930a..441ebac6017 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c @@ -338,10 +338,10 @@ static void gizmo_cage3d_draw_intern( else { #if 0 const rctf _r = { - .xmin = -size_real[0], - .ymin = -size_real[1], - .xmax = size_real[0], - .ymax = size_real[1], + .xmin = -size_real[0], + .ymin = -size_real[1], + .xmax = size_real[0], + .ymax = size_real[1], }; #endif if (draw_style == ED_GIZMO_CAGE2D_STYLE_BOX) { diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 4933f081790..b64bccdf1ce 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -2429,7 +2429,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) /* event doesn't need to be handled */ #if 0 printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", - event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE); + event->type, + event->type == MIDDLEMOUSE, + event->type == MOUSEMOVE); #endif break; } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 24bdbcc4cba..2caaf7f7797 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -375,7 +375,7 @@ static int gp_set_filling_texture(Image *image, short flag) ImBuf *ibuf; uint *bind = &image->bindcode[TEXTARGET_TEXTURE_2D]; int error = GL_NO_ERROR; - ImageUser iuser = { NULL }; + ImageUser iuser = {NULL}; void *lock; iuser.ok = true; @@ -388,8 +388,7 @@ static int gp_set_filling_texture(Image *image, short flag) } GPU_create_gl_tex( - bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, - false, false, image); + bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, false, false, image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -452,7 +451,8 @@ static void gp_draw_stroke_fill(bGPdata *gpd, immUniform1i("t_flip", (gp_style->flag & GP_STYLE_COLOR_FLIP_FILL) != 0); #if 0 /* GPXX disabled, not used in annotations */ /* image texture */ - if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) || (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) { + if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) || + (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) { gp_set_filling_texture(gp_style->ima, gp_style->flag); } #endif diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index bfdfe64ed54..a12e9a357a7 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -3748,7 +3748,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) /* event doesn't need to be handled */ #if 0 printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", - event->type, event->type == MIDDLEMOUSE, event->type == MOUSEMOVE); + event->type, + event->type == MIDDLEMOUSE, + event->type == MOUSEMOVE); #endif break; } diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index e747dda95d4..fe7ccb7170c 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -707,7 +707,10 @@ void ED_scene_draw_fps(struct Scene *scene, int xoffset, int *yoffset); #if 0 void ED_view3d_operator_properties_viewmat(struct wmOperatorType *ot); void ED_view3d_operator_properties_viewmat_set(struct bContext *C, struct wmOperator *op); -void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, int *winy, float persmat[4][4]); +void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, + int *winx, + int *winy, + float persmat[4][4]); #endif /* render */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d3cce4a5dde..dd086461801 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -416,8 +416,16 @@ void UI_draw_roundbox_shade_x(bool filled, const float col[4]); #if 0 /* unused */ -int UI_draw_roundbox_corner_get(void); -void UI_draw_roundbox_shade_y(bool filled, float minx, float miny, float maxx, float maxy, float rad, float shadeleft, float shaderight, const float col[4]); +int UI_draw_roundbox_corner_get(void); +void UI_draw_roundbox_shade_y(bool filled, + float minx, + float miny, + float maxx, + float maxy, + float rad, + float shadeleft, + float shaderight, + const float col[4]); #endif void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); @@ -587,7 +595,10 @@ void UI_popup_block_ex(struct bContext *C, void *arg, struct wmOperator *op); #if 0 /* UNUSED */ -void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); +void uiPupBlockOperator(struct bContext *C, + uiBlockCreateFunc func, + struct wmOperator *op, + int opcontext); #endif void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 06b0634f6fb..a9079cdd021 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1274,7 +1274,8 @@ static bool ui_but_event_property_operator_string(const bContext *C, #if 0 else { printf("ERROR in %s(): Couldn't get path for scene property - %s\n", - __func__, RNA_property_identifier(prop)); + __func__, + RNA_property_identifier(prop)); } #endif } diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index afa1b5c87e1..c8800f495ce 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -655,12 +655,16 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) #if 0 /* Disabled for now. */ ot = WM_operatortype_find("UI_OT_override_type_set_button", false); uiItemFullO_ptr( - layout, ot, "Overrides Type", ICON_NONE, - NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); + layout, ot, "Overrides Type", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); RNA_boolean_set(&op_ptr, "all", true); - uiItemFullO_ptr( - layout, ot, "Single Override Type", ICON_NONE, - NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); + uiItemFullO_ptr(layout, + ot, + "Single Override Type", + ICON_NONE, + NULL, + WM_OP_INVOKE_DEFAULT, + 0, + &op_ptr); RNA_boolean_set(&op_ptr, "all", false); #endif uiItemBooleanO(layout, @@ -678,9 +682,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) } else { #if 0 /* Disabled for now. */ - uiItemFullO( - layout, "UI_OT_override_type_set_button", "Override Type", ICON_NONE, - NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); + uiItemFullO(layout, + "UI_OT_override_type_set_button", + "Override Type", + ICON_NONE, + NULL, + WM_OP_INVOKE_DEFAULT, + 0, + &op_ptr); RNA_boolean_set(&op_ptr, "all", false); #endif uiItemBooleanO(layout, @@ -896,9 +905,15 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) if (kmi) { if (ISKEYBOARD(kmi->type)) { #if 0 /* would rather use a block but, but gets weirdly positioned... */ - uiDefBlockBut( - block, menu_change_shortcut, but, "Change Shortcut", - 0, 0, uiLayoutGetWidth(layout), UI_UNIT_Y, ""); + uiDefBlockBut(block, + menu_change_shortcut, + but, + "Change Shortcut", + 0, + 0, + uiLayoutGetWidth(layout), + UI_UNIT_Y, + ""); #endif but2 = uiDefIconTextBut(block, @@ -1005,9 +1020,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) /* XXX inactive option, not for public! */ #if 0 - uiItemFullO( - layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE, - NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr_props); + uiItemFullO(layout, + "WM_OT_doc_edit", + "Submit Description", + ICON_NONE, + NULL, + WM_OP_INVOKE_DEFAULT, + 0, + &ptr_props); RNA_string_set(&ptr_props, "doc_id", buf); RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop)); #endif diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 0517278a149..efc748d39a1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -167,8 +167,13 @@ void UI_draw_roundbox_4fv( { #if 0 float vec[7][2] = { - {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, + {0.195, 0.02}, + {0.383, 0.067}, + {0.55, 0.169}, + {0.707, 0.293}, + {0.831, 0.45}, + {0.924, 0.617}, + {0.98, 0.805}, }; int a; @@ -270,13 +275,16 @@ void UI_draw_roundbox_4fv( } #if 0 -static void round_box_shade_col(uint attr, const float col1[3], float const col2[3], const float fac) +static void round_box_shade_col(uint attr, + const float col1[3], + float const col2[3], + const float fac) { float col[4] = { - fac * col1[0] + (1.0f - fac) * col2[0], - fac * col1[1] + (1.0f - fac) * col2[1], - fac * col1[2] + (1.0f - fac) * col2[2], - 1.0f, + fac * col1[0] + (1.0f - fac) * col2[0], + fac * col1[1] + (1.0f - fac) * col2[1], + fac * col1[2] + (1.0f - fac) * col2[2], + 1.0f, }; immAttr4fv(attr, col); } @@ -296,8 +304,13 @@ void UI_draw_roundbox_shade_x(bool filled, { #if 0 float vec[7][2] = { - {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, + {0.195, 0.02}, + {0.383, 0.067}, + {0.55, 0.169}, + {0.707, 0.293}, + {0.831, 0.45}, + {0.924, 0.617}, + {0.98, 0.805}, }; const float div = maxy - miny; const float idiv = 1.0f / div; @@ -317,9 +330,9 @@ void UI_draw_roundbox_shade_x(bool filled, } /* 'shade' defines strength of shading */ - coltop[0] = min_ff(1.0f, col[0] + shadetop); - coltop[1] = min_ff(1.0f, col[1] + shadetop); - coltop[2] = min_ff(1.0f, col[2] + shadetop); + coltop[0] = min_ff(1.0f, col[0] + shadetop); + coltop[1] = min_ff(1.0f, col[1] + shadetop); + coltop[2] = min_ff(1.0f, col[2] + shadetop); coldown[0] = max_ff(0.0f, col[0] + shadedown); coldown[1] = max_ff(0.0f, col[1] + shadedown); coldown[2] = max_ff(0.0f, col[2] + shadedown); @@ -440,13 +453,24 @@ void UI_draw_roundbox_shade_x(bool filled, #if 0 /* unused */ /* linear vertical shade within button or in outline */ /* view2d scrollers use it */ -void UI_draw_roundbox_shade_y( - bool filled, float minx, float miny, float maxx, float maxy, - float rad, float shadeleft, float shaderight, const float col[4]) +void UI_draw_roundbox_shade_y(bool filled, + float minx, + float miny, + float maxx, + float maxy, + float rad, + float shadeleft, + float shaderight, + const float col[4]) { float vec[7][2] = { - {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, + {0.195, 0.02}, + {0.383, 0.067}, + {0.55, 0.169}, + {0.707, 0.293}, + {0.831, 0.45}, + {0.924, 0.617}, + {0.98, 0.805}, }; const float div = maxx - minx; const float idiv = 1.0f / div; @@ -466,14 +490,13 @@ void UI_draw_roundbox_shade_y( immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); /* 'shade' defines strength of shading */ - colLeft[0] = min_ff(1.0f, col[0] + shadeleft); - colLeft[1] = min_ff(1.0f, col[1] + shadeleft); - colLeft[2] = min_ff(1.0f, col[2] + shadeleft); + colLeft[0] = min_ff(1.0f, col[0] + shadeleft); + colLeft[1] = min_ff(1.0f, col[1] + shadeleft); + colLeft[2] = min_ff(1.0f, col[2] + shadeleft); colRight[0] = max_ff(0.0f, col[0] + shaderight); colRight[1] = max_ff(0.0f, col[1] + shaderight); colRight[2] = max_ff(0.0f, col[2] + shaderight); - vert_count += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; vert_count += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; vert_count += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; @@ -2461,7 +2484,8 @@ void ui_draw_dropshadow( /* alpha ranges from 2 to 20 or so */ #if 0 /* Old Method (pre 2.8) */ float color[4] = {0.0f, 0.0f, 0.0f, calpha}; - UI_draw_roundbox_4fv(true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color); + UI_draw_roundbox_4fv( + true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color); #endif /* Compute final visibility to match old method result. */ /* TODO we could just find a better fit function inside the shader instead of this. */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 8e463bf8447..9b54192c772 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -112,7 +112,7 @@ typedef enum uiItemType { ITEM_LAYOUT_ROOT #if 0 - TEMPLATE_COLUMN_FLOW, + TEMPLATE_COLUMN_FLOW, TEMPLATE_SPLIT, TEMPLATE_BOX, @@ -1538,7 +1538,8 @@ void uiItemsFullEnumO(uiLayout *layout, * introduction of GP editing modes) */ #if 0 - RNA_property_enum_items_gettexted_all(block->evil_C, &ptr, prop, &item_array, &totitem, &free); + RNA_property_enum_items_gettexted_all( + block->evil_C, &ptr, prop, &item_array, &totitem, &free); #else RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free); #endif diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 6666991ad26..7e6b58ba850 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2354,8 +2354,14 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C) /* Disable for now, doesn't fit well in popover. */ #if 0 /* Repeat button with operator name as text. */ - uiItemFullO(layout, "SCREEN_OT_repeat_last", RNA_struct_ui_name(op->type->srna), - ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL); + uiItemFullO(layout, + "SCREEN_OT_repeat_last", + RNA_struct_ui_name(op->type->srna), + ICON_NONE, + NULL, + WM_OP_INVOKE_DEFAULT, + 0, + NULL); #endif if (WM_operator_repeat_check(C, op)) { diff --git a/source/blender/editors/lattice/editlattice_undo.c b/source/blender/editors/lattice/editlattice_undo.c index 9ee2e8b563b..166201adc15 100644 --- a/source/blender/editors/lattice/editlattice_undo.c +++ b/source/blender/editors/lattice/editlattice_undo.c @@ -102,8 +102,7 @@ static int validate_undoLatt(void *data, void *edata) UndoLattice *ult = (UndoLattice *)data; EditLatt *editlatt = (EditLatt *)edata; - return (ult->pntsu == editlatt->latt->pntsu && - ult->pntsv == editlatt->latt->pntsv && + return (ult->pntsu == editlatt->latt->pntsu && ult->pntsv == editlatt->latt->pntsv && ult->pntsw == editlatt->latt->pntsw); } #endif diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 42521d04008..a341b51ebdb 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -86,8 +86,7 @@ static float edbm_rip_edgedist_squared(ARegion *ar, #if 0 static float edbm_rip_linedist( - ARegion *ar, float mat[4][4], - const float co1[3], const float co2[3], const float mvalf[2]) + ARegion *ar, float mat[4][4], const float co1[3], const float co2[3], const float mvalf[2]) { float vec1[2], vec2[2]; diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 94886266d24..69066adba41 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -1173,9 +1173,7 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, float point[3]; #if 0 const float dist_sq_test = dist_squared_ray_to_seg_v3( - ray_origin, ray_direction, - e->v1->co, e->v2->co, - point, &depth); + ray_origin, ray_direction, e->v1->co, e->v2->co, point, &depth); #else if (coords) { mid_v3_v3v3( @@ -1801,7 +1799,8 @@ static bool mouse_mesh_loop( length_2 = len_squared_v2v2(mvalf, v2_co); } #if 0 - printf("mouse to v1: %f\nmouse to v2: %f\n", len_squared_v2v2(mvalf, v1_co), + printf("mouse to v1: %f\nmouse to v2: %f\n", + len_squared_v2v2(mvalf, v1_co), len_squared_v2v2(mvalf, v2_co)); #endif BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 1cb550fccc4..7d318fb16e1 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -363,10 +363,8 @@ void EDBM_mesh_load(Main *bmain, Object *ob) * cycles. */ #if 0 - for (Object *other_object = bmain->objects.first; - other_object != NULL; - other_object = other_object->id.next) - { + for (Object *other_object = bmain->objects.first; other_object != NULL; + other_object = other_object->id.next) { if (other_object->data == ob->data) { BKE_object_free_derived_caches(other_object); } diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index ce7908bf0a3..8cc23edad16 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -900,17 +900,15 @@ int ED_mesh_mirror_get_vert(Object *ob, int index) #if 0 -static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent) +static float *editmesh_get_mirror_uv( + BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent) { float vec[2]; float cent_vec[2]; float cent[2]; /* ignore nan verts */ - if (isnan(uv[0]) || !isfinite(uv[0]) || - isnan(uv[1]) || !isfinite(uv[1]) - ) - { + if (isnan(uv[0]) || !isfinite(uv[0]) || isnan(uv[1]) || !isfinite(uv[1])) { return NULL; } @@ -937,15 +935,14 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { uv_poly_center(efa, cent, cd_loop_uv_offset); - if ( (fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f) ) { + if ((fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f)) { BMIter liter; BMLoop *l; BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); - if ( (fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f) ) { + if ((fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f)) { return luv->uv; - } } } diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 57c7ff1535d..986055dd88c 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -65,11 +65,11 @@ static const EnumPropertyItem DT_layer_items[] = { "Vertex Group(s)", "Transfer active or all vertex groups"}, #if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */ - {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"}, + {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"}, #endif #if 0 /* XXX When SkinModifier is enabled, * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */ - {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"}, + {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"}, #endif {DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"}, {0, "", 0, "Edge Data", ""}, diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 3744632be3d..63cacc21d1c 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1339,11 +1339,13 @@ void OBJECT_OT_track_set(wmOperatorType *ot) #if 0 static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) { - Scene *sce = (Scene *) BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1); + Scene *sce = (Scene *)BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1); Base *base, *nbase; - if (sce == NULL) return; - if (sce->id.lib) return; + if (sce == NULL) + return; + if (sce->id.lib) + return; for (base = FIRSTBASE; base; base = base->next) { if (BASE_SELECTED(v3d, base)) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 627ffd68bbb..d592bbd82b1 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -510,9 +510,11 @@ static bool key_test_depth(const PEData *data, const float co[3], const int scre /* used to calculate here but all callers have the screen_co already, so pass as arg */ #if 0 - if (ED_view3d_project_int_global(data->vc.ar, co, screen_co, - V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) - { + if (ED_view3d_project_int_global(data->vc.ar, + co, + screen_co, + V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | + V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) { return 0; } #endif diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index c62d6530c6b..9b31b63edae 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1241,7 +1241,7 @@ static void icon_preview_endjob(void *customdata) if (prv_img->gputexture[i]) { GPU_texture_free(prv_img->gputexture[i]); prv_img->gputexture[i] = NULL; - WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ip->id); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ip->id); } } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4ca26d108a2..ce952b50f9d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -530,8 +530,11 @@ void ED_region_do_draw(bContext *C, ARegion *ar) uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); - immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, - ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin); + immRectf(pos, + ar->drawrct.xmin - ar->winrct.xmin, + ar->drawrct.ymin - ar->winrct.ymin, + ar->drawrct.xmax - ar->winrct.xmin, + ar->drawrct.ymax - ar->winrct.ymin); immUnbindProgram(); GPU_blend(false); #endif diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 94b5f695de8..f059659806e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3660,8 +3660,10 @@ static int region_quadview_exec(bContext *C, wmOperator *op) RV3D_ORTHO); /* forcing camera is distracting */ #if 0 - if (v3d->camera) region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB); - else region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP); + if (v3d->camera) + region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB); + else + region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP); #else (void)v3d; #endif diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 5750a1f36a7..ce64bdc27c8 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -89,8 +89,7 @@ static void workspace_change_update(WorkSpace *workspace_new, /* needs to be done before changing mode! (to ensure right context) */ UNUSED_VARS(workspace_old, workspace_new, C, wm); #if 0 - Object *ob_act = CTX_data_active_object(C) - eObjectMode mode_old = workspace_old->object_mode; + Object *ob_act = CTX_data_active_object(C) eObjectMode mode_old = workspace_old->object_mode; eObjectMode mode_new = workspace_new->object_mode; if (mode_old != mode_new) { diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 3a3f4335fd5..4c978f560b3 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -632,9 +632,15 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) /* duplicate warning, see texpaint_init */ #if 0 if (pop->s.warnmultifile) - BKE_reportf(op->reports, RPT_WARNING, "Image requires 4 color channels to paint: %s", pop->s.warnmultifile); + BKE_reportf(op->reports, + RPT_WARNING, + "Image requires 4 color channels to paint: %s", + pop->s.warnmultifile); if (pop->s.warnpackedfile) - BKE_reportf(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted: %s", pop->s.warnpackedfile); + BKE_reportf(op->reports, + RPT_WARNING, + "Packed MultiLayer files cannot be painted: %s", + pop->s.warnpackedfile); #endif MEM_freeN(pop); } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 7a99f819913..7f8887814a1 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -2351,8 +2351,10 @@ static float angle_2d_clockwise(const float p1[2], const float p2[2], const floa { float v1[2], v2[2]; - v1[0] = p1[0] - p2[0]; v1[1] = p1[1] - p2[1]; - v2[0] = p3[0] - p2[0]; v2[1] = p3[1] - p2[1]; + v1[0] = p1[0] - p2[0]; + v1[1] = p1[1] - p2[1]; + v2[0] = p3[0] - p2[0]; + v2[1] = p3[1] - p2[1]; return -atan2f(v1[0] * v2[1] - v1[1] * v2[0], v1[0] * v2[0] + v1[1] * v2[1]); } @@ -3035,8 +3037,7 @@ static void project_paint_face_init(const ProjPaintState *ps, if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) { #if 0 project_paint_undo_tiles_init( - &bounds_px, ps->projImages + image_index, tmpibuf, - tile_width, threaded, ps->do_masking); + &bounds_px, ps->projImages + image_index, tmpibuf, tile_width, threaded, ps->do_masking); #endif /* clip face and */ diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index 68abdfbf95b..b80144ac4af 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -417,7 +417,8 @@ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us) { ID *image_prev[2] = {NULL}; for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) { - tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(us->id_map, &tile->ima->id, image_prev); + tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev( + us->id_map, &tile->ima->id, image_prev); } } #endif diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 4a586f4f7df..8c1ba213ba0 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -479,8 +479,7 @@ static void paint_brush_stroke_add_step(bContext *C, if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || - BKE_brush_use_size_pressure(scene, pop->s.brush))) - { + BKE_brush_use_size_pressure(scene, pop->s.brush))) { return; } @@ -493,8 +492,7 @@ static void paint_brush_stroke_add_step(bContext *C, if (tablet && (pressure < 0.0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || - BKE_brush_use_size_pressure(scene, pop->s.brush))) - { + BKE_brush_use_size_pressure(scene, pop->s.brush))) { return; } #endif diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 70783ff004e..291320a520f 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -565,9 +565,11 @@ static void do_weight_paint_normalize_all_locked_try_active(MDeformVert *dvert, } #if 0 /* UNUSED */ -static bool has_unselected_unlocked_bone_group( - int defbase_tot, bool *defbase_sel, int selected, - const bool *lock_flags, const bool *vgroup_validmap) +static bool has_unselected_unlocked_bone_group(int defbase_tot, + bool *defbase_sel, + int selected, + const bool *lock_flags, + const bool *vgroup_validmap) { int i; if (defbase_tot == selected) { diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 9309def4a77..6882b249f0d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -676,7 +676,10 @@ static float frontface(const Brush *br, #if 0 -static bool sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float location[3], const float area_no[3]) +static bool sculpt_brush_test_cyl(SculptBrushTest *test, + float co[3], + float location[3], + const float area_no[3]) { if (sculpt_brush_test_sphere_fast(test, co)) { float t1[3], t2[3], t3[3], dist; diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 7499458181e..6b37cd8fe27 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -275,8 +275,7 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho /* loop over data selecting */ switch (ale->type) { #if 0 /* XXX: Keyframes are not currently shown here */ - case ANIMTYPE_GPDATABLOCK: - { + case ANIMTYPE_GPDATABLOCK: { bGPdata *gpd = ale->data; bGPDlayer *gpl; for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { @@ -478,8 +477,7 @@ static void region_select_action_keys( /* loop over data selecting */ switch (ale->type) { #if 0 /* XXX: Keyframes are not currently shown here */ - case ANIMTYPE_GPDATABLOCK: - { + case ANIMTYPE_GPDATABLOCK: { bGPdata *gpd = ale->data; bGPDlayer *gpl; for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index a17c1b675e6..1fc218c9461 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -144,14 +144,12 @@ static void console_lb_debug__internal(ListBase *lb) for (cl = lb->first; cl; cl = cl->next) printf("<%s> ", cl->line); printf("\n"); - } static void console_history_debug(const bContext *C) { SpaceConsole *sc = CTX_wm_space_console(C); - console_lb_debug__internal(&sc->history); } #endif diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 31a59f06079..21b0eefddbc 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2420,11 +2420,13 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) BLI_assert(filelist->filelist.entries == NULL); - if (filelist->filelist.root[0] == '/') filelist->filelist.root[0] = '\0'; + if (filelist->filelist.root[0] == '/') + filelist->filelist.root[0] = '\0'; if (filelist->filelist.root[0]) { idcode = groupname_to_code(filelist->filelist.root); - if (idcode == 0) filelist->filelist.root[0] = '\0'; + if (idcode == 0) + filelist->filelist.root[0] = '\0'; } if (filelist->dir[0] == 0) { @@ -2472,7 +2474,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) idcode = groupname_to_code(filelist->filelist.root); lb = which_libbase(bmain, idcode); - if (lb == NULL) return; + if (lb == NULL) + return; filelist->filelist.nbr_entries = 0; for (id = lb->first; id; id = id->next) { @@ -2523,19 +2526,21 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) } } # endif -// files->entry->nr = totbl + 1; + // files->entry->nr = totbl + 1; files->entry->poin = id; fake = id->flag & LIB_FAKEUSER; - if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { + if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || + idcode == ID_IM) { files->typeflag |= FILE_TYPE_IMAGE; } -// if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us); -// else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us); -// else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us); -// else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us); + // if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us); + // else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us); + // else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us); + // else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us); if (id->lib) { - if (totlib == 0) firstlib = files; + if (totlib == 0) + firstlib = files; totlib++; } diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 5bfe1c1aadd..eb9860bcd8f 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -315,8 +315,8 @@ static bool draw_fcurve_handles_check(SpaceGraph *sipo, FCurve *fcu) /* keyframes aren't editable */ (fcu->flag & FCURVE_PROTECTED) || #if 0 /* handles can still be selected and handle types set, better draw - campbell */ - /* editing the handles here will cause weird/incorrect interpolation issues */ - (fcu->flag & FCURVE_INT_VALUES) || + /* editing the handles here will cause weird/incorrect interpolation issues */ + (fcu->flag & FCURVE_INT_VALUES) || #endif /* group that curve belongs to is not editable */ ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index e217987f212..66e5607b06d 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -191,7 +191,8 @@ void image_preview_event(int event) BIF_store_spare(); /* 1 is do_previews */ - ntreeCompositExecTree(scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings); + ntreeCompositExecTree( + scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings); G.scene->nodetree->timecursor = NULL; G.scene->nodetree->test_break = NULL; @@ -203,7 +204,6 @@ void image_preview_event(int event) } } - /* nothing drawn here, we use it to store values */ static void preview_cb(ScrArea *sa, struct uiBlock *block) { @@ -221,18 +221,24 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block) /* while dragging we need to update the rects, otherwise it doesn't end with correct one */ - BLI_rctf_init(&dispf, 15.0f, BLI_rcti_size_x(&block->rect) - 15.0f, 15.0f, (BLI_rctf_size_y(&block->rect)) - 15.0f); + BLI_rctf_init(&dispf, + 15.0f, + BLI_rcti_size_x(&block->rect) - 15.0f, + 15.0f, + (BLI_rctf_size_y(&block->rect)) - 15.0f); ui_graphics_to_window_rct(sa->win, &dispf, disprect); /* correction for gla draw */ BLI_rcti_translate(disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); calc_image_view(sima, 'p'); -// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); + // printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); /* map to image space coordinates */ - mval[0] = disprect->xmin; mval[1] = disprect->ymin; + mval[0] = disprect->xmin; + mval[1] = disprect->ymin; areamouseco_to_ipoco(v2d, mval, &dispf.xmin, &dispf.ymin); - mval[0] = disprect->xmax; mval[1] = disprect->ymax; + mval[0] = disprect->xmax; + mval[1] = disprect->ymax; areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax); /* map to render coordinates */ @@ -245,8 +251,7 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block) CLAMP(disprect->xmax, 0, winx); CLAMP(disprect->ymin, 0, winy); CLAMP(disprect->ymax, 0, winy); -// printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); - + // printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax); } static bool is_preview_allowed(ScrArea *cur) @@ -268,8 +273,7 @@ static bool is_preview_allowed(ScrArea *cur) return 1; } - -static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW +static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW { uiBlock *block; SpaceImage *sima = sa->spacedata.first; @@ -287,10 +291,10 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PRE ofsx = -150 + (sa->winx / 2) / sima->blockscale; ofsy = -100 + (sa->winy / 2) / sima->blockscale; - if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0) return; + if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0) + return; UI_but_func_drawextra_set(block, preview_cb); - } #endif @@ -1063,17 +1067,73 @@ void uiTemplateImage(uiLayout *layout, iuser = ntree_get_active_iuser(scene->nodetree); if (iuser) { UI_block_align_begin(block); - uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_RECORD, ICON_REC, "Record", 10, 120, 100, 20, 0, 0, 0, 0, 0, ""); - uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110, 120, 100, 20, 0, 0, 0, 0, 0, ""); - but = uiDefBut(block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, ""); + uiDefIconTextBut(block, + UI_BTYPE_BUT, + B_SIMA_RECORD, + ICON_REC, + "Record", + 10, + 120, + 100, + 20, + 0, + 0, + 0, + 0, + 0, + ""); + uiDefIconTextBut(block, + UI_BTYPE_BUT, + B_SIMA_PLAY, + ICON_PLAY, + "Play", + 110, + 120, + 100, + 20, + 0, + 0, + 0, + 0, + 0, + ""); + but = uiDefBut( + block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, ""); UI_but_func_set(but, image_freecache_cb, ima, NULL); if (iuser->frames) BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr); - else strcpy(str, "Frames:"); + else + strcpy(str, "Frames:"); UI_block_align_begin(block); - uiDefButI(block, UI_BTYPE_NUM, imagechanged, str, 10, 90, 150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use"); - uiDefButI(block, UI_BTYPE_NUM, imagechanged, "StartFr:", 160, 90, 150, 20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie"); + uiDefButI(block, + UI_BTYPE_NUM, + imagechanged, + str, + 10, + 90, + 150, + 20, + &iuser->frames, + 0.0, + MAXFRAMEF, + 0, + 0, + "Number of images of a movie to use"); + uiDefButI(block, + UI_BTYPE_NUM, + imagechanged, + "StartFr:", + 160, + 90, + 150, + 20, + &iuser->sfra, + 1.0, + MAXFRAMEF, + 0, + 0, + "Global starting frame of the movie"); } #endif } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 06bacabe6fa..086f3103523 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -3403,14 +3403,14 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event { ScrArea *sa, *cur = curarea; - node_curvemap_sample(fp); /* sends global to node editor */ + node_curvemap_sample(fp); /* sends global to node editor */ for (sa = G.curscreen->areabase.first; sa; sa = sa->next) { if (sa->spacetype == SPACE_NODE) { areawinset(sa->win); scrarea_do_windraw(sa); } } - node_curvemap_sample(NULL); /* clears global in node editor */ + node_curvemap_sample(NULL); /* clears global in node editor */ curarea = cur; } #endif @@ -3650,8 +3650,12 @@ static int image_record_composite_apply(bContext *C, wmOperator *op) BKE_image_all_free_anim_ibufs(scene->r.cfra); ntreeCompositTagAnimated(scene->nodetree); - ntreeCompositExecTree(scene->nodetree, &scene->r, 0, scene->r.cfra != rcd->old_cfra, - &scene->view_settings, &scene->display_settings); /* 1 is no previews */ + ntreeCompositExecTree(scene->nodetree, + &scene->r, + 0, + scene->r.cfra != rcd->old_cfra, + &scene->view_settings, + &scene->display_settings); /* 1 is no previews */ ED_area_tag_redraw(CTX_wm_area(C)); @@ -3714,7 +3718,8 @@ static int image_record_composite_exec(bContext *C, wmOperator *op) if (!image_record_composite_init(C, op)) return OPERATOR_CANCELLED; - while (image_record_composite_apply(C, op)) {} + while (image_record_composite_apply(C, op)) { + } image_record_composite_exit(C, op); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index e1875fd6129..9c834f09fd4 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -745,7 +745,8 @@ static void image_main_region_draw(const bContext *C, ARegion *ar) /* scrollers? */ #if 0 - scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + scrollers = UI_view2d_scrollers_calc( + C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); UI_view2d_scrollers_draw(C, v2d, scrollers); UI_view2d_scrollers_free(scrollers); #endif diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index 707838cf7e5..1521a400779 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -46,11 +46,16 @@ int info_report_mask(SpaceInfo *UNUSED(sinfo)) #if 0 int report_mask = 0; - if (sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL; - if (sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_ALL; - if (sinfo->rpt_mask & INFO_RPT_OP) report_mask |= RPT_OPERATOR_ALL; - if (sinfo->rpt_mask & INFO_RPT_WARN) report_mask |= RPT_WARNING_ALL; - if (sinfo->rpt_mask & INFO_RPT_ERR) report_mask |= RPT_ERROR_ALL; + if (sinfo->rpt_mask & INFO_RPT_DEBUG) + report_mask |= RPT_DEBUG_ALL; + if (sinfo->rpt_mask & INFO_RPT_INFO) + report_mask |= RPT_INFO_ALL; + if (sinfo->rpt_mask & INFO_RPT_OP) + report_mask |= RPT_OPERATOR_ALL; + if (sinfo->rpt_mask & INFO_RPT_WARN) + report_mask |= RPT_WARNING_ALL; + if (sinfo->rpt_mask & INFO_RPT_ERR) + report_mask |= RPT_ERROR_ALL; return report_mask; #endif @@ -71,10 +76,8 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op)) sc->type = CONSOLE_TYPE_PYTHON; for (report = reports->list.last; report; report = report->prev) { - if ((report->type & report_mask) && - (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) && - (report->flag & SELECT)) - { + if ((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) && + (report->flag & SELECT)) { console_history_add_str(sc, report->message, 0); WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 7072f34ee4d..327aa94ca3e 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -204,7 +204,8 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) bNode *node = node_v; Tex *tex; - if (node->menunr < 1) return; + if (node->menunr < 1) + return; if (node->id) { id_us_min(node->id); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 84f512957c7..09af141b026 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -752,8 +752,8 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) #if 0 if (node->id) ; // XXX BIF_preview_changed(-1); - // allqueue(REDRAWBUTSSHADING, 1); - // allqueue(REDRAWIPO, 0); + // allqueue(REDRAWBUTSSHADING, 1); + // allqueue(REDRAWIPO, 0); #endif } } @@ -804,7 +804,8 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op) return 1; } -static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out) +static void edit_node_properties_get( + wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out) { bNode *node; bNodeSocket *sock = NULL; @@ -819,8 +820,12 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r sockindex = RNA_int_get(op->ptr, "socket"); switch (in_out) { - case SOCK_IN: sock = BLI_findlink(&node->inputs, sockindex); break; - case SOCK_OUT: sock = BLI_findlink(&node->outputs, sockindex); break; + case SOCK_IN: + sock = BLI_findlink(&node->inputs, sockindex); + break; + case SOCK_OUT: + sock = BLI_findlink(&node->outputs, sockindex); + break; } if (rnode) diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 2d33c5db49d..f0dface1e32 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -100,7 +100,7 @@ static void outliner_width(SpaceOutliner *soops, ListBase *lb, int *w) { TreeElement *te = lb->first; while (te) { -// TreeStoreElem *tselem = TREESTORE(te); + // TreeStoreElem *tselem = TREESTORE(te); // XXX fixme... te->xend is not set yet if (!TSELEM_OPEN(tselem, soops)) { diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 11d01931945..6cfb5ce8202 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1296,8 +1296,8 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot) #if 0 /* find next element that has this name */ -static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char *name, int flags, - TreeElement *prev, int *prevFound) +static TreeElement *outliner_find_name( + SpaceOutliner *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) { TreeElement *te, *tes; @@ -1318,16 +1318,18 @@ static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char } tes = outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound); - if (tes) return tes; + if (tes) + return tes; } /* nothing valid found */ return NULL; } -static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags) +static void outliner_find_panel( + Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags) { - ReportList *reports = NULL; // CTX_wm_reports(C); + ReportList *reports = NULL; // CTX_wm_reports(C); TreeElement *te = NULL; TreeElement *last_find; TreeStoreElem *tselem; @@ -1354,10 +1356,10 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner else { /* pop up panel - no previous, or user didn't want search after previous */ name[0] = '\0'; -// XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) { -// te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound); -// } -// else return; /* XXX RETURN! XXX */ + // XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) { + // te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound); + // } + // else return; /* XXX RETURN! XXX */ } /* do selection and reveal */ @@ -1374,7 +1376,8 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner /* make te->ys center of view */ ytop = (int)(te->ys + BLI_rctf_size_y(&ar->v2d.mask) / 2); - if (ytop > 0) ytop = 0; + if (ytop > 0) + ytop = 0; ar->v2d.cur.ymax = (float)ytop; ar->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask)); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index a03d9b6fb6d..6b24e83e8ee 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -372,9 +372,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops, soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index); #if 0 /* disabled as it needs to be reworked for recoded constraints system */ target = get_constraint_target(con, &str); - if (str && str[0]) ten1->name = str; - else if (target) ten1->name = target->id.name + 2; - else ten1->name = con->name; + if (str && str[0]) + ten1->name = str; + else if (target) + ten1->name = target->id.name + 2; + else + ten1->name = con->name; #endif ten1->name = con->name; ten1->directdata = con; @@ -434,9 +437,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops, ten = outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a); #if 0 /* disabled due to constraints system targets recode... code here needs review */ target = get_constraint_target(con, &str); - if (str && str[0]) ten->name = str; - else if (target) ten->name = target->id.name + 2; - else ten->name = con->name; + if (str && str[0]) + ten->name = str; + else if (target) + ten->name = target->id.name + 2; + else + ten->name = con->name; #endif ten->name = con->name; ten->directdata = con; @@ -1548,15 +1554,20 @@ static int treesort_obtype_alpha(const void *v1, const void *v2) else { /* 2nd we check ob type */ if (x1->idcode == ID_OB && x2->idcode == ID_OB) { - if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1; - else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1; - else return 0; + if (((Object *)x1->id)->type > ((Object *)x2->id)->type) + return 1; + else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) + return -1; + else + return 0; } else { int comp = strcmp(x1->name, x2->name); - if (comp > 0) return 1; - else if (comp < 0) return -1; + if (comp > 0) + return 1; + else if (comp < 0) + return -1; return 0; } } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index e2140fba1f6..628d487210a 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1201,13 +1201,19 @@ void sequencer_draw_maskedit(const bContext *C, Scene *scene, ARegion *ar, Space width = (scene->r.size * scene->r.xsch) / 100; height = (scene->r.size * scene->r.ysch) / 100; - ED_mask_draw_region( - mask, ar, - 0, 0, 0, /* TODO */ - width, height, - aspx, aspy, - false, true, - NULL, C); + ED_mask_draw_region(mask, + ar, + 0, + 0, + 0, /* TODO */ + width, + height, + aspx, + aspy, + false, + true, + NULL, + C); } } } @@ -1623,9 +1629,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq) recty = (render_size * scene->r.ysch) / 100; if (sseq->mainb != SEQ_DRAW_SEQUENCE) { - give_ibuf_prefetch_request( - rectx, recty, (scene->r.cfra), sseq->chanshown, - proxy_size); + give_ibuf_prefetch_request(rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size); } } #endif diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index cf07e252404..c94da4afa52 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1036,22 +1036,22 @@ static void set_filter_seq(Scene *scene) Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, false); + if (ed == NULL) + return; - if (ed == NULL) return; - - if (okee("Set Deinterlace") == 0) return; + if (okee("Set Deinterlace") == 0) + return; - SEQP_BEGIN (ed, seq) - { + SEQP_BEGIN (ed, seq) { if (seq->flag & SELECT) { if (seq->type == SEQ_TYPE_MOVIE) { seq->flag |= SEQ_FILTERY; BKE_sequence_reload_new_file(scene, seq, false); BKE_sequence_calc(scene, seq); } - } - } SEQ_END; + } + SEQ_END; } #endif @@ -1228,7 +1228,8 @@ bool sequencer_edit_poll(bContext *C) bool sequencer_strip_poll(bContext *C) { Editing *ed; - return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) && (ed->act_seq != NULL)); + return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) && + (ed->act_seq != NULL)); } #endif @@ -2886,9 +2887,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) /* Apply aspect, dosnt need to be that accurate */ imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp)); - if (((imgwidth >= width) || (imgheight >= height)) && - ((width > 0) && (height > 0))) - { + if (((imgwidth >= width) || (imgheight >= height)) && ((width > 0) && (height > 0))) { /* Find the zoom value that will fit the image in the image space */ zoomX = ((float)width) / ((float)imgwidth); zoomY = ((float)height) / ((float)imgheight); @@ -2965,10 +2964,14 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot) #if 0 static const EnumPropertyItem view_type_items[] = { - {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""}, - {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""}, - {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""}, - {0, NULL, 0, NULL, NULL}, + {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""}, + {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""}, + {SEQ_VIEW_SEQUENCE_PREVIEW, + "SEQUENCER_PREVIEW", + ICON_SEQ_SEQUENCER, + "Sequencer and Image Preview", + ""}, + {0, NULL, 0, NULL, NULL}, }; #endif @@ -3169,7 +3172,8 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child) Sequence *parent = NULL; Sequence *seq; - if (ed == NULL) return NULL; + if (ed == NULL) + return NULL; for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq != child) && seq_is_parent(seq, child)) { diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index a59a3b830e3..09cc4635254 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -541,12 +541,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e #if 0 // XXX probably need to redo this differently for 2.5 if (marker) { int mval[2], xo, yo; -// getmouseco_areawin(mval); + // getmouseco_areawin(mval); xo = mval[0]; yo = mval[1]; while (get_mbut()) { -// getmouseco_areawin(mval); + // getmouseco_areawin(mval); if (abs(mval[0] - xo) + abs(mval[1] - yo) > 4) { transform_markers('g', 0); return; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index dadb86f439b..b2c5f42adb4 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -107,7 +107,8 @@ static void txt_format_text(SpaceText *st) { TextLine *linep; - if (!st->text) return; + if (!st->text) + return; for (linep = st->text->lines.first; linep; linep = linep->next) txt_format_line(st, linep, 0); @@ -989,18 +990,23 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) int i, br, lines; int boxw, boxh, l, x, y /* , top */ /* UNUSED */; - if (!st || !st->text) return; - if (!texttool_text_is_active(st->text)) return; + if (!st || !st->text) + return; + if (!texttool_text_is_active(st->text)) + return; docs = texttool_docs_get(); - if (!docs) return; + if (!docs) + return; text_draw_context_init(st, &tdc); /* Count the visible lines to the cursor */ - for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ; - if (l < 0) return; + for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) + ; + if (l < 0) + return; if (st->showlinenrs) { x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4; @@ -1017,7 +1023,8 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING); /* Draw panel */ - uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); + uint pos = GPU_vertformat_attr_add( + immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_BACK); @@ -1044,9 +1051,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) UI_FontThemeColor(tdc.font_id, TH_TEXT); - i = 0; br = DOC_WIDTH; lines = 0; // XXX -doc_scroll; + i = 0; + br = DOC_WIDTH; + lines = 0; // XXX -doc_scroll; for (p = docs; *p; p++) { - if (*p == '\r' && *(++p) != '\n') *(--p) = '\n'; /* Fix line endings */ + if (*p == '\r' && *(++p) != '\n') + *(--p) = '\n'; /* Fix line endings */ if (*p == ' ' || *p == '\t') br = i; else if (*p == '\n') { @@ -1055,7 +1065,9 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) y -= st->lheight_dpi; text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL); } - i = 0; br = DOC_WIDTH; lines++; + i = 0; + br = DOC_WIDTH; + lines++; } buf[i++] = *p; if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */ @@ -1065,9 +1077,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL); } p -= i - br - 1; /* Rewind pointer to last break */ - i = 0; br = DOC_WIDTH; lines++; + i = 0; + br = DOC_WIDTH; + lines++; } - if (lines >= DOC_HEIGHT) break; + if (lines >= DOC_HEIGHT) + break; } } #endif diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 435a6fd67de..cbb3be0f1c8 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -195,13 +195,30 @@ void TEXT_OT_start_find(wmOperatorType *ot) uiPopupMenu *pup; pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE); - uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"), - 0, "type", FILE_TOP); - uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"), - 0, "type", FILE_BOTTOM); - uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE); - uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"), - 0, "type", NEXT_PAGE); + uiItemEnumO(layout, + "TEXT_OT_move", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"), + 0, + "type", + FILE_TOP); + uiItemEnumO(layout, + "TEXT_OT_move", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"), + 0, + "type", + FILE_BOTTOM); + uiItemEnumO(layout, + "TEXT_OT_move", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), + 0, + "type", + PREV_PAGE); + uiItemEnumO(layout, + "TEXT_OT_move", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"), + 0, + "type", + NEXT_PAGE); UI_popup_menu_end(C, pup); } #endif diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 1d2d361d868..84ebacc0a2f 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1646,7 +1646,8 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf) #if 0 WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM); WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM); - WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE); + WM_modalkeymap_add_item( + keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE); #endif /* assign map to operators */ diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 6932e94e78d..f50f6f81087 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -498,7 +498,10 @@ void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], /* very similar to ED_view3d_win_to_3d() but has no advantage, de-duplicating */ #if 0 -bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval[2], const bool do_fallback) +bool view3d_get_view_aligned_coordinate(ARegion *ar, + float fp[3], + const int mval[2], + const bool do_fallback) { RegionView3D *rv3d = ar->regiondata; float dvec[3]; @@ -508,8 +511,7 @@ bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval ret = ED_view3d_project_int_global(ar, fp, mval_cpy, V3D_PROJ_TEST_NOP); if (ret == V3D_PROJ_RET_OK) { - const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), - (float)(mval_cpy[1] - mval[1])}; + const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), (float)(mval_cpy[1] - mval[1])}; const float zfac = ED_view3d_calc_zfac(rv3d, fp, NULL); ED_view3d_win_to_delta(ar, mval_f, dvec, zfac); sub_v3_v3(fp, dvec); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index c0f2e563365..088b611a0e8 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1080,9 +1080,8 @@ static void do_lasso_select_node(int mcords[][2], short moves, const eSelectOp s ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent); const bool is_select = node->flag & SELECT; - const bool is_inside = ( - BLI_rcti_isect_pt_v(&rect, node_cent) && - BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1])); + const bool is_inside = (BLI_rcti_isect_pt_v(&rect, node_cent) && + BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1])); const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside); if (sel_op_result != -1) { SET_FLAG_FROM_TEST(node->flag, sel_op_result, SELECT); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index e313ed39c49..0738703d1b0 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -739,9 +739,16 @@ void view3d_winmatrix_set(Depsgraph *depsgraph, ARegion *ar, const View3D *v3d, rv3d->is_persp = !is_ortho; #if 0 - printf("%s: %d %d %f %f %f %f %f %f\n", __func__, winx, winy, - viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, - clipsta, clipend); + printf("%s: %d %d %f %f %f %f %f %f\n", + __func__, + winx, + winy, + viewplane.xmin, + viewplane.ymin, + viewplane.xmax, + viewplane.ymax, + clipsta, + clipend); #endif if (rect) { /* picking */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 944c6436dfb..76bd66f87b5 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -6731,7 +6731,8 @@ static BMLoop *get_next_loop( cross_v3_v3v3(vec_accum, l_tmp->f->no, tdir); #if 0 /* rough guess, we can do better! */ - normalize_v3_length(vec_accum, (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f); + normalize_v3_length(vec_accum, + (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f); #else /* be clever, check the opposite ngon edge to slide into. * this gives best results */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index b682617f348..ef8089b8225 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -6932,7 +6932,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) #if 0 if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */ /* same as below */ - ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); + ED_markers_post_apply_transform( + ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); } else /* TFM_TIME_TRANSLATE */ #endif diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 18b19d903c4..8b4c1c30959 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -587,8 +587,7 @@ static unsigned int bm_mesh_edges_select_get_n(BMesh *bm, BMEdge **elems, const static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n) { return bm_mesh_elems_select_get_n__internal( - bm, (BMElem **)elems, min_ii(n, bm->totfacesel), - BM_FACES_OF_MESH, BM_FACE); + bm, (BMElem **)elems, min_ii(n, bm->totfacesel), BM_FACES_OF_MESH, BM_FACE); } #endif diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 291dbdf6942..d1e63ad2986 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2649,8 +2649,10 @@ static int uv_mouse_select_multi( /* before bmesh */ #if 0 if (ts->selectmode != SCE_SELECT_FACE) { - if (flush == 1) EDBM_select_flush(em); - else if (flush == -1) EDBM_deselect_flush(em); + if (flush == 1) + EDBM_select_flush(em); + else if (flush == -1) + EDBM_deselect_flush(em); } #else if (flush != 0) { diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 69183d02ab9..913aacec4c8 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -1393,7 +1393,12 @@ static int p_polygon_point_in(float *cp1, float *cp2, float *p) return (p_area_signed(cp1, cp2, p) >= 0.0f); } -static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float (*newpoints)[2], int *nnewpoints, float *cp1, float *cp2) +static void p_polygon_kernel_clip(float (*oldpoints)[2], + int noldpoints, + float (*newpoints)[2], + int *nnewpoints, + float *cp1, + float *cp2) { float *p2, *p1, isect[2]; int i, p2in, p1in; @@ -1438,7 +1443,7 @@ static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float ( static void p_polygon_kernel_center(float (*points)[2], int npoints, float *center) { int i, size, nnewpoints = npoints; - float (*oldpoints)[2], (*newpoints)[2], *p1, *p2; + float(*oldpoints)[2], (*newpoints)[2], *p1, *p2; size = npoints * 3; oldpoints = MEM_mallocN(sizeof(float) * 2 * size, "PPolygonOldPoints"); @@ -1477,7 +1482,7 @@ static void p_polygon_kernel_center(float (*points)[2], int npoints, float *cent newpoints = MEM_mallocN(sizeof(float) * 2 * size, "newpoints"); } else { - float (*sw_points)[2] = oldpoints; + float(*sw_points)[2] = oldpoints; oldpoints = newpoints; newpoints = sw_points; } @@ -1616,7 +1621,7 @@ static void p_vert_harmonic_insert(PVert *v) * weights fails */ int npoints = 0, i; - float (*points)[2]; + float(*points)[2]; e = v->edge; do { @@ -1939,8 +1944,7 @@ static PBool p_collapse_allowed(PEdge *edge, PEdge *pair) if (oldv->flag & PVERT_PIN) return P_FALSE; - return (p_collapse_allowed_topologic(edge, pair) && - p_collapse_allowed_geometric(edge, pair)); + return (p_collapse_allowed_topologic(edge, pair) && p_collapse_allowed_geometric(edge, pair)); } static float p_collapse_cost(PEdge *edge, PEdge *pair) -- cgit v1.2.3