Code cleanup: unreachable break/return
authorCampbell Barton <ideasman42@gmail.com>
Wed, 19 Mar 2014 01:46:33 +0000 (12:46 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 19 Mar 2014 01:47:09 +0000 (12:47 +1100)
21 files changed:
source/blender/avi/intern/avi_codecs.c
source/blender/avi/intern/avi_options.c
source/blender/blenkernel/intern/mask_evaluate.c
source/blender/blenkernel/intern/material.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/cpu.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/keyframing.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_path.c
source/blender/editors/object/object_bake.c
source/blender/editors/render/render_internal.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_nla/nla_select.c
source/blender/editors/transform/transform_orientations.c
source/blender/freestyle/intern/python/BPy_Id.cpp
source/blender/imbuf/intern/colormanagement.c
source/blender/imbuf/intern/indexer.c
source/blender/python/intern/bpy_rna.c
source/blender/windowmanager/intern/wm_operators.c

index e43826064a64977056e4d93daa6551e965410f85..c14d088c8ea53bccb667f2994659d22e41487812 100644 (file)
@@ -106,10 +106,8 @@ int avi_get_format_type(AviFormat format)
                case AVI_FORMAT_AVI_RGB:
                case AVI_FORMAT_MJPEG:
                        return FCC("vids");
-                       break;
                default:
                        return 0;
-                       break;
        }
 }
 
@@ -120,13 +118,10 @@ int avi_get_format_fcc(AviFormat format)
                case AVI_FORMAT_RGB32:
                case AVI_FORMAT_AVI_RGB:
                        return FCC("DIB ");
-                       break;
                case AVI_FORMAT_MJPEG:
                        return FCC("MJPG");
-                       break;
                default:
                        return 0;
-                       break;
        }
 }
 
@@ -137,12 +132,9 @@ int avi_get_format_compression(AviFormat format)
                case AVI_FORMAT_RGB32:
                case AVI_FORMAT_AVI_RGB:
                        return 0;
-                       break;
                case AVI_FORMAT_MJPEG:
                        return FCC("MJPG");
-                       break;
                default:
                        return 0;
-                       break;
        }
 }
index c552cbe87242eb4ee9add21e09317291d4f36e72..47c18831cbdf096af5451bf101a67288204dde3b 100644 (file)
@@ -125,7 +125,6 @@ AviError AVI_set_compress_option(AviMovie *movie, int option_type, int stream, A
                        break;
                default:
                        return AVI_ERROR_OPTION;
-                       break;
        }
 
        return AVI_ERROR_NONE;
index 4d9791a077ca5aeb1765569e3f19bc35bb602fb1..33e74582750889205f3d4a7f617d2988c7ff344d 100644 (file)
@@ -718,11 +718,9 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution(
        switch (spline->offset_mode) {
                case MASK_SPLINE_OFFSET_EVEN:
                        return mask_spline_feather_differentiated_points_with_resolution__even(spline, tot_feather_point, resol, do_feather_isect);
-                       break;
                case MASK_SPLINE_OFFSET_SMOOTH:
                default:
                        return mask_spline_feather_differentiated_points_with_resolution__double(spline, tot_feather_point, resol, do_feather_isect);
-                       break;
        }
 }
 
index 5f6331315f8ac20bb543b6a6e36dfcb2abd59feb..0dd62ae730d972c23268e888b691fb4397704df1 100644 (file)
@@ -507,13 +507,10 @@ Material ***give_matarar_id(ID *id)
        switch (GS(id->name)) {
                case ID_ME:
                        return &(((Mesh *)id)->mat);
-                       break;
                case ID_CU:
                        return &(((Curve *)id)->mat);
-                       break;
                case ID_MB:
                        return &(((MetaBall *)id)->mat);
-                       break;
        }
        return NULL;
 }
@@ -526,13 +523,10 @@ short *give_totcolp_id(ID *id)
        switch (GS(id->name)) {
                case ID_ME:
                        return &(((Mesh *)id)->totcol);
-                       break;
                case ID_CU:
                        return &(((Curve *)id)->totcol);
-                       break;
                case ID_MB:
                        return &(((MetaBall *)id)->totcol);
-                       break;
        }
        return NULL;
 }
index 41c5707cf4cff354f05fb41ddfdcb0cfd11f5a77..7ea0834d9f443666237ef94a042722f5130439dd 100644 (file)
@@ -127,10 +127,12 @@ MINLINE axis_t min_axis(axis_t a, axis_t b)
 {
        return (a < b) ? a : b;
 }
+#if 0
 MINLINE axis_t max_axis(axis_t a, axis_t b)
 {
        return (b < a) ? a : b;
 }
+#endif
 
 #if 0
 
index d942ffdf2c9ca5280e35cfb69950fc8e50c4173e..784b19007852ccd47f31f04bcd4d74405fe25476 100644 (file)
@@ -52,8 +52,8 @@ int BLI_cpu_support_sse2(void)
                mov d, edx
        }
        return (d & 0x04000000) != 0;
-#endif
-
+#else
        return 0;
+#endif
 }
 
index 00a9ff2defbdc493a083db7bb8f9fdbe9165213a..3f81bb35db5605acb663f0043ea4c6d902ff176b 100644 (file)
@@ -3049,7 +3049,6 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
-                                       break;
                                }
                                case sizeof(short): /* short pointer for setting */
                                {
@@ -3059,7 +3058,6 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
-                                       break;
                                }
                                case sizeof(char):  /* char pointer for setting */
                                {
@@ -3069,7 +3067,6 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
-                                       break;
                                }
                        }
                }
index 8ffc3199f2ba8b44cc518db3a0b26f0a489a276b..069f66135e3f39cd8f78f8ab2fb7274af82323c3 100644 (file)
@@ -2026,8 +2026,6 @@ short id_frame_has_keyframe(ID *id, float frame, short filter)
        switch (GS(id->name)) {
                case ID_OB: /* object */
                        return object_frame_has_keyframe((Object *)id, frame, filter);
-                       break;
-                       
 #if 0
                // XXX TODO... for now, just use 'normal' behavior
                case ID_SCE: /* scene */
index 9087643290aecd99025bd0949fcf1f609afc9a34..cffd38b2a304e66505d482352236b8d40330f011 100644 (file)
@@ -2861,7 +2861,6 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
 
                                ED_region_tag_redraw(kcd->ar);
                                return OPERATOR_PASS_THROUGH;
-                               break;
                }
        }
        else { /* non-modal-mapped events */
index a6e4f504bd9ac692c062df1aae5a2a14a63baea2..373c4efb34d10a66a046e41dee6489ebdac31286 100644 (file)
@@ -176,11 +176,10 @@ static bool edgetag_test_cb(BMEdge *e, void *user_data_v)
                        return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? true : false;
 #ifdef WITH_FREESTYLE
                case EDGE_MODE_TAG_FREESTYLE:
-                       {
-                               FreestyleEdge *fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_FREESTYLE_EDGE);
-                               return (!fed) ? FALSE : (fed->flag & FREESTYLE_EDGE_MARK) ? true : false;
-                       }
-                       break;
+               {
+                       FreestyleEdge *fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_FREESTYLE_EDGE);
+                       return (!fed) ? FALSE : (fed->flag & FREESTYLE_EDGE_MARK) ? true : false;
+               }
 #endif
        }
        return 0;
index 0a4bbf10bf01681bf1109986358307736c224754..1f022c922e80f159cf4bca176c4f012dabe5a309 100644 (file)
@@ -765,7 +765,6 @@ static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const
        switch (event->type) {
                case ESCKEY:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
        }
        return OPERATOR_PASS_THROUGH;
 }
index eae15e7766db76613d980055b63912a7a44702b7..9531c7793d317f8a43c36733b19e7e89b4b122ba 100644 (file)
@@ -744,7 +744,6 @@ static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event
        switch (event->type) {
                case ESCKEY:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
        }
        return OPERATOR_PASS_THROUGH;
 }
index bb6c50d62244da8030fca85d00ba2dabf0c246b4..14cd7de01257edce80485881636ee4930bdbd9c6 100644 (file)
@@ -1378,7 +1378,6 @@ static int clip_prefetch_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
        switch (event->type) {
                case ESCKEY:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
        }
 
        return OPERATOR_PASS_THROUGH;
index 85e420f3e86ccf099948da5258e18ffa49a3ebc1..708c59729a5117f29c3f5c5ec35abd0a5eef4ad5 100644 (file)
@@ -191,7 +191,6 @@ static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const
        switch (event->type) {
                case MOUSEMOVE:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
 
                case LEFTMOUSE:
                        ED_area_headerprint(CTX_wm_area(C), NULL);
@@ -206,7 +205,6 @@ static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const
 
                        WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
                        return OPERATOR_FINISHED;
-                       break;
 
                case ESCKEY:
                        ED_area_headerprint(CTX_wm_area(C), NULL);
@@ -1497,7 +1495,6 @@ static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
        switch (event->type) {
                case ESCKEY:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
        }
 
        return OPERATOR_PASS_THROUGH;
@@ -1765,7 +1762,6 @@ static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent
        switch (event->type) {
                case ESCKEY:
                        return OPERATOR_RUNNING_MODAL;
-                       break;
        }
 
        return OPERATOR_PASS_THROUGH;
index f723696de69d6a6c84e845c4b90a1cbe93ee26bf..2bd2b660bcd4ed1fc839ce8a8523475d52149d4f 100644 (file)
@@ -67,16 +67,13 @@ static short selmodes_to_flagmodes(short sel)
        switch (sel) {
                case SELECT_SUBTRACT:
                        return ACHANNEL_SETFLAG_CLEAR;
-                       break;
-                       
+
                case SELECT_INVERT:
                        return ACHANNEL_SETFLAG_INVERT;
-                       break;
-                       
+
                case SELECT_ADD:
                default:
                        return ACHANNEL_SETFLAG_ADD;
-                       break;
        }
 }
 
index 0182e7ac7a7621bc6d2b6046dc5919a281fce95b..0279ee0cd3da0ae700e07c601265cdc559f0208c 100644 (file)
@@ -229,7 +229,6 @@ static TransformOrientation *createMeshSpace(bContext *C, ReportList *reports,
                        break;
                default:
                        return NULL;
-                       break;
        }
 
        return addMatrixSpace(C, mat, name, overwrite);
index 8cf20401dd04f48e26d7003616bd8fb94a84f7ba..7ef56f6baeee2ab8e7b7b2c2d26d3c1540cd84c9 100644 (file)
@@ -105,22 +105,16 @@ static PyObject *Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid)
        switch (opid) {
                case Py_LT:
                        return PyBool_from_bool(o1->id->operator<(*(o2->id)));
-                       break;
                case Py_LE:
                        return PyBool_from_bool(o1->id->operator<(*(o2->id)) || o1->id->operator==(*(o2->id)));
-                       break;
                case Py_EQ:
                        return PyBool_from_bool(o1->id->operator==(*(o2->id)));
-                       break;
                case Py_NE:
                        return PyBool_from_bool(o1->id->operator!=(*(o2->id)));
-                       break;
                case Py_GT:
                        return PyBool_from_bool(!(o1->id->operator<(*(o2->id)) || o1->id->operator==(*(o2->id))));
-                       break;
                case Py_GE:
                        return PyBool_from_bool(!(o1->id->operator<(*(o2->id))));
-                       break;
        }
        Py_RETURN_NONE;
 }
index e8ffdc832408989f7abcb218165a75ce2aa734ca..efd3037cda0f34458631dba8a975141d6d56dbf2 100644 (file)
@@ -1164,22 +1164,16 @@ const char *IMB_colormanagement_role_colorspace_name_get(int role)
        switch (role) {
                case COLOR_ROLE_SCENE_LINEAR:
                        return global_role_scene_linear;
-                       break;
                case COLOR_ROLE_COLOR_PICKING:
                        return global_role_color_picking;
-                       break;
                case COLOR_ROLE_TEXTURE_PAINTING:
                        return global_role_texture_painting;
-                       break;
                case COLOR_ROLE_DEFAULT_SEQUENCER:
                        return global_role_default_sequencer;
-                       break;
                case COLOR_ROLE_DEFAULT_FLOAT:
                        return global_role_default_float;
-                       break;
                case COLOR_ROLE_DEFAULT_BYTE:
                        return global_role_default_byte;
-                       break;
                default:
                        printf("Unknown role was passed to %s\n", __func__);
                        BLI_assert(0);
index 2afcda8a1a64e2f5146504a6ad35b42589f387a1..14967c32477514ac3f64e33e7a463877f9d4489c 100644 (file)
@@ -336,7 +336,6 @@ int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size)
                default:
                        return 0;
        }
-       return 0;
 }
 
 int IMB_timecode_to_array_index(IMB_Timecode_Type tc)
@@ -356,7 +355,6 @@ int IMB_timecode_to_array_index(IMB_Timecode_Type tc)
                default:
                        return 0;
        }
-       return 0;
 }
 
 
index 23308bf997deee0ad5207259d99ab8581efe9045..cf13efae60e0f148d56a4f0b2ff639347299ebcc 100644 (file)
@@ -1920,7 +1920,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
                                             error_prefix, RNA_struct_identifier(ptr->type),
                                             RNA_property_identifier(prop));
                                return -1;
-                               break;
                }
        }
 
index bcbe7f076765d426f0a21e82cdc17f62ba70de17..2752d33e5f826fca618b554ceab398cb3690a36e 100644 (file)
@@ -3067,7 +3067,6 @@ int WM_border_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                }
                                wm_gesture_end(C, op);
                                return OPERATOR_CANCELLED;
-                               break;
 
                        case GESTURE_MODAL_CANCEL:
                                wm_gesture_end(C, op);
@@ -3588,7 +3587,6 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *ev
                                }
                                wm_gesture_end(C, op);
                                return OPERATOR_CANCELLED;
-                               break;
                                
                        case GESTURE_MODAL_CANCEL:
                                wm_gesture_end(C, op);