diff options
Diffstat (limited to 'source/blender/editors')
24 files changed, 57 insertions, 49 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index a2ad5c582d5..6127f77d7d6 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -601,6 +601,7 @@ void ANIM_center_frame(struct bContext *C, int smooth_viewtx) break; } /* else drop through, keep range instead */ + ATTR_FALLTHROUGH; case ZOOM_FRAME_MODE_KEEP_RANGE: default: diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4566f0d9837..7ec19d12fb6 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -906,7 +906,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; } - /* else continue; <--- see if release event should be caught for tweak-end */ + /* else continue; <--- see if release event should be caught for tweak-end */ + ATTR_FALLTHROUGH; case RETKEY: case PADENTER: diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 21cb405c32b..8dfcd5acab8 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -885,6 +885,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) break; } default: + { if ((event->val == KM_PRESS) && handleNumInput(C, &pso->num, event)) { float value; @@ -972,6 +973,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) /* allow to pass through */ return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH; } + } } diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index d8bef20b118..0eb44085bae 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2240,9 +2240,9 @@ static void glueByMergeSort(ReebGraph *rg, ReebArc *a0, ReebArc *a1, ReebEdge *e else { a1 = nextArcMappedToEdge(a1, e1); } + } } } -} static void mergePaths(ReebGraph *rg, ReebEdge *e0, ReebEdge *e1, ReebEdge *e2) { diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 6947ca6b376..59b5b41f114 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -625,6 +625,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent break; } default: + { if ((event->val == KM_PRESS) && handleNumInput(C, &tgpi->num, event)) { const float factor = tgpi->init_factor; float value; @@ -649,6 +650,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent /* unhandled event - allow to pass through */ return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH; } + } } /* still running... */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 6dcdb312256..59064ec332e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3371,7 +3371,7 @@ static void ui_do_but_textedit( if (event->type == WHEELDOWNMOUSE) { break; } - /* fall-through */ + ATTR_FALLTHROUGH; case ENDKEY: ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift != 0, STRCUR_JUMP_ALL); @@ -3389,7 +3389,7 @@ static void ui_do_but_textedit( if (event->type == WHEELUPMOUSE) { break; } - /* fall-through */ + ATTR_FALLTHROUGH; case HOMEKEY: ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift != 0, STRCUR_JUMP_ALL); @@ -8409,7 +8409,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) case MIDDLEMOUSE: case MOUSEPAN: UI_but_tooltip_timer_remove(C, but); - /* fall-through */ + ATTR_FALLTHROUGH; default: /* handle button type specific events */ retval = ui_do_button(C, block, but, event); @@ -9203,23 +9203,23 @@ static int ui_handle_menu_event( break; case ONEKEY: case PAD1: - act = 1; + act = 1; ATTR_FALLTHROUGH; case TWOKEY: case PAD2: - if (act == 0) act = 2; + if (act == 0) act = 2; ATTR_FALLTHROUGH; case THREEKEY: case PAD3: - if (act == 0) act = 3; + if (act == 0) act = 3; ATTR_FALLTHROUGH; case FOURKEY: case PAD4: - if (act == 0) act = 4; + if (act == 0) act = 4; ATTR_FALLTHROUGH; case FIVEKEY: case PAD5: - if (act == 0) act = 5; + if (act == 0) act = 5; ATTR_FALLTHROUGH; case SIXKEY: case PAD6: - if (act == 0) act = 6; + if (act == 0) act = 6; ATTR_FALLTHROUGH; case SEVENKEY: case PAD7: - if (act == 0) act = 7; + if (act == 0) act = 7; ATTR_FALLTHROUGH; case EIGHTKEY: case PAD8: - if (act == 0) act = 8; + if (act == 0) act = 8; ATTR_FALLTHROUGH; case NINEKEY: case PAD9: - if (act == 0) act = 9; + if (act == 0) act = 9; ATTR_FALLTHROUGH; case ZEROKEY: case PAD0: if (act == 0) act = 10; @@ -9814,13 +9814,13 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle case (ZEROKEY + n): case (PAD0 + n): \ { if (num_dir == UI_RADIAL_NONE) num_dir = d; } (void)0 - CASE_NUM_TO_DIR(1, UI_RADIAL_SW); - CASE_NUM_TO_DIR(2, UI_RADIAL_S); - CASE_NUM_TO_DIR(3, UI_RADIAL_SE); - CASE_NUM_TO_DIR(4, UI_RADIAL_W); - CASE_NUM_TO_DIR(6, UI_RADIAL_E); - CASE_NUM_TO_DIR(7, UI_RADIAL_NW); - CASE_NUM_TO_DIR(8, UI_RADIAL_N); + CASE_NUM_TO_DIR(1, UI_RADIAL_SW); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(2, UI_RADIAL_S); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(3, UI_RADIAL_SE); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(4, UI_RADIAL_W); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(6, UI_RADIAL_E); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(7, UI_RADIAL_NW); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(8, UI_RADIAL_N); ATTR_FALLTHROUGH; CASE_NUM_TO_DIR(9, UI_RADIAL_NE); { but = ui_block_pie_dir_activate(block, event, num_dir); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index eef03852007..35de390274c 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -889,7 +889,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) data->is_accurate = (event->val == KM_PRESS); - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { ScrArea *sa = CTX_wm_area(C); @@ -1376,7 +1376,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve } - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { float B[2], mouse_coord[2], delta[2]; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index a8f3d1739bd..93cc9f30868 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -1070,7 +1070,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent /* render frame? */ if (oglrender->timer == event->customdata) break; - /* fall-through */ + ATTR_FALLTHROUGH; default: /* nothing to do */ return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 3380131e446..d80c312c623 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1863,10 +1863,11 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, int UNUSED(mute)) /* update animated texture nodes */ { Tex *tex; - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->tex.first; tex; tex = tex->id.next) { if (tex->use_nodes && tex->nodetree) { ntreeTexTagAnimated(tex->nodetree); } + } } } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index a142d40e7b9..eed2acbfc68 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -337,7 +337,7 @@ static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, con switch (wmn->data) { case ND_FRAME: clip_scopes_tag_refresh(sa); - /* fall-through */ + ATTR_FALLTHROUGH; case ND_FRAME_RANGE: ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 169eb76399b..56c240c3d20 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -875,8 +875,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) { data->accurate = event->val == KM_PRESS; } - - /* fall-through */ + ATTR_FALLTHROUGH; case MOUSEMOVE: mdelta[0] = event->mval[0] - data->mval[0]; mdelta[1] = event->mval[1] - data->mval[1]; diff --git a/source/blender/editors/space_clip/tracking_ops_plane.c b/source/blender/editors/space_clip/tracking_ops_plane.c index 4332f3ea765..aa8518befaa 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.c +++ b/source/blender/editors/space_clip/tracking_ops_plane.c @@ -301,8 +301,7 @@ static int slide_plane_marker_modal(bContext *C, if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) { data->accurate = event->val == KM_PRESS; } - - /* fall-through */ + ATTR_FALLTHROUGH; case MOUSEMOVE: mdelta[0] = event->mval[0] - data->previous_mval[0]; mdelta[1] = event->mval[1] - data->previous_mval[1]; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index ad9fb49baef..8037c2deb5b 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1208,7 +1208,7 @@ void uiTemplateImageStereo3d(uiLayout *layout, PointerRNA *stereo3d_format_ptr) case S3D_DISPLAY_SIDEBYSIDE: { uiItemR(col, stereo3d_format_ptr, "use_sidebyside_crosseyed", 0, NULL, ICON_NONE); - /* fall-through */ + ATTR_FALLTHROUGH; } case S3D_DISPLAY_TOPBOTTOM: { diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index bb6a8676cc1..561c29b68cc 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -391,7 +391,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri /* draw the rect to the edge of the screen */ immRectf(shdr_pos, v2d->cur.xmin, yminc, strip->start, ymaxc); } - /* fall-through */ + ATTR_FALLTHROUGH; /* this only draws after the strip */ case NLASTRIP_EXTEND_HOLD_FORWARD: diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index bcd0f6623e1..dc6b06790e0 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -107,13 +107,15 @@ static bool add_reroute_intersect_check(bNodeLink *link, float mcoords[][2], int if (node_link_bezier_points(NULL, NULL, link, coord_array, NODE_LINK_RESOL)) { - for (i = 0; i < tot - 1; i++) - for (b = 0; b < NODE_LINK_RESOL; b++) + for (i = 0; i < tot - 1; i++) { + for (b = 0; b < NODE_LINK_RESOL; b++) { if (isect_seg_seg_v2(mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1]) > 0) { result[0] = (mcoords[i][0] + mcoords[i + 1][0]) / 2.0f; result[1] = (mcoords[i][1] + mcoords[i + 1][1]) / 2.0f; return 1; } + } + } } return 0; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 8963eb760ce..f87a0b5e7af 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -562,7 +562,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen } if (seq1 == NULL) seq1 = seq2; if (seq3 == NULL) seq3 = seq2; - /* fall-through */ + ATTR_FALLTHROUGH; case 2: if (seq1 == NULL || seq2 == NULL) { *error_str = N_("2 selected sequence strips are needed"); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 1cea90d52db..e000095bd19 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -158,7 +158,7 @@ static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, con } ED_area_tag_redraw(sa); - /* fall-through */ /* fall down to tag redraw */ + ATTR_FALLTHROUGH; /* fall down to tag redraw */ case NA_ADDED: case NA_REMOVED: ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index c38c57b9528..9b0bd30ff11 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -455,7 +455,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e break; case PAGEDOWNKEY: scroll = SUGG_LIST_SIZE - 1; - /* fall-through */ + ATTR_FALLTHROUGH; case WHEELDOWNMOUSE: case DOWNARROWKEY: if (event->val == KM_PRESS) { @@ -489,7 +489,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e break; case PAGEUPKEY: scroll = SUGG_LIST_SIZE - 1; - /* fall-through */ + ATTR_FALLTHROUGH; case WHEELUPMOUSE: case UPARROWKEY: if (event->val == KM_PRESS) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2bae620a4ed..7bb95ba6d15 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6013,7 +6013,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv copy_m4_m4(imat, rv3d->viewinv); normalize_v3(imat[0]); normalize_v3(imat[1]); - /* fall-through */ + ATTR_FALLTHROUGH; case PART_DRAW_CROSS: case PART_DRAW_AXIS: /* lets calculate the scale: */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 02ad292e5c1..be5b475b89b 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1616,7 +1616,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) offset = -offset; length = -length; size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHT: immVertex2f(POS_INDEX, offset, 0); immVertex2f(POS_INDEX, offset + length, 0); @@ -1630,7 +1630,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) offset = -offset; length = -length; size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case UP: immVertex2f(POS_INDEX, 0, offset); immVertex2f(POS_INDEX, 0, offset + length); @@ -1651,7 +1651,7 @@ static void drawArrowHead(ArrowDirection d, short size) switch (d) { case LEFT: size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHT: immVertex2f(POS_INDEX, 0, 0); immVertex2f(POS_INDEX, -size, -size); @@ -1661,7 +1661,7 @@ static void drawArrowHead(ArrowDirection d, short size) case DOWN: size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case UP: immVertex2f(POS_INDEX, 0, 0); immVertex2f(POS_INDEX, -size, -size); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 024d465e29c..009cb2bac63 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -949,7 +949,7 @@ static int calc_manipulator_stats(const bContext *C) break; } /* if not gimbal, fall through to normal */ - /* fall-through */ + ATTR_FALLTHROUGH; } case V3D_MANIP_NORMAL: { @@ -960,7 +960,7 @@ static int calc_manipulator_stats(const bContext *C) break; } /* no break we define 'normal' as 'local' in Object mode */ - /* fall-through */ + ATTR_FALLTHROUGH; } case V3D_MANIP_LOCAL: { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index e1a45cb2309..c9e40865164 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -455,14 +455,14 @@ void initTransformOrientation(bContext *C, TransInfo *t) BLI_strncpy(t->spacename, IFACE_("gimbal"), sizeof(t->spacename)); break; } - /* fall-through */ /* no gimbal fallthrough to normal */ + ATTR_FALLTHROUGH; /* no gimbal fallthrough to normal */ case V3D_MANIP_NORMAL: if (obedit || (ob && ob->mode & OB_MODE_POSE)) { BLI_strncpy(t->spacename, IFACE_("normal"), sizeof(t->spacename)); ED_getTransformOrientationMatrix(C, t->spacemtx, t->around); break; } - /* fall-through */ /* we define 'normal' as 'local' in Object mode */ + ATTR_FALLTHROUGH; /* we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: BLI_strncpy(t->spacename, IFACE_("local"), sizeof(t->spacename)); diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 3727be1842c..61142fdc887 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -296,7 +296,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) } /* Else, common behavior with DELKEY, only difference is remove char(s) before/after the cursor. */ dir = STRCUR_DIR_PREV; - /* fall-through */ + ATTR_FALLTHROUGH; case DELKEY: if ((n->val_flag[idx] & NUM_EDITED) && n->str[0]) { int t_cur = cur = n->str_cur; @@ -322,7 +322,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) break; case LEFTARROWKEY: dir = STRCUR_DIR_PREV; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHTARROWKEY: cur = n->str_cur; if (event->ctrl) { diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index bcdaca450c6..d6e77e3081e 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -2173,6 +2173,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event) } break; } + ATTR_FALLTHROUGH; case PADENTER: case RETKEY: if (event->val == KM_PRESS) { |