Minor warning cleanup & fix
authorCampbell Barton <ideasman42@gmail.com>
Mon, 27 Jun 2011 03:36:14 +0000 (03:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 27 Jun 2011 03:36:14 +0000 (03:36 +0000)
- comment/remove assignments from values to themselves.
- add case break statements (no functional change but some source code checkers notice).
- fix python errors when the sculpt brush is None.

12 files changed:
intern/iksolver/intern/IK_QSegment.cpp
intern/itasc/ConstraintSet.cpp
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/object/object_bake.c
source/blender/editors/transform/transform_constraints.c
source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_glare.c
source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
source/blender/python/generic/mathutils_Matrix.c
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h

index 237edfd4594e67d41a0bccd10646a3d7dcba0ed1..df4fbc8fadd5b922dd4e3dcd2522eb5e444c8b04 100644 (file)
@@ -905,9 +905,6 @@ void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
        lmin = MT_clamp(lmin, -MT_PI, MT_PI);
        lmax = MT_clamp(lmax, -MT_PI, MT_PI);
 
-       lmin = lmin;
-       lmax = lmax;
-
        if (axis == 1) {
                m_min_twist = lmin;
                m_max_twist = lmax;
index 3b50e3537586c624d681b1c388e9fded1be1f781..b07dc5bb9837308d4066d462130e264cf6076781 100644 (file)
@@ -134,6 +134,7 @@ bool ConstraintSet::setControlParameter(int id, ConstraintAction action, double
                break;
        default:
                assert(action==ACT_NONE);
+               break;
        }
        return setControlParameters(&values, 1, timestep);
 }
index aead20f76e37c508a0a0212aa1e2c32d5f252f93..b989085939f29c68c641ad2b4dddbe8a84d07aec 100644 (file)
@@ -1106,17 +1106,18 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
         layout.operator_menu_enum("brush.curve_preset", "shape")
         layout.separator()
 
-        sculpt_tool = brush.sculpt_tool
+        if brush is not None:  # unlikely but can happen
+            sculpt_tool = brush.sculpt_tool
 
-        if sculpt_tool != 'GRAB':
-            layout.prop_menu_enum(brush, "stroke_method")
+            if sculpt_tool != 'GRAB':
+                layout.prop_menu_enum(brush, "stroke_method")
 
-            if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
-                layout.prop_menu_enum(brush, "direction")
+                if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
+                    layout.prop_menu_enum(brush, "direction")
 
-            if sculpt_tool == 'LAYER':
-                layout.prop(brush, "use_persistent")
-                layout.operator("sculpt.set_persistent_base")
+                if sculpt_tool == 'LAYER':
+                    layout.prop(brush, "use_persistent")
+                    layout.operator("sculpt.set_persistent_base")
 
         layout.separator()
         layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
index 503a1d806ac698d1075663df59f9e352c47a6750..52eb76d071032d303663c89123b061ffb5269af2 100644 (file)
@@ -997,7 +997,11 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
 
     @classmethod
     def poll(cls, context):
-        return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.image_paint_object and context.tool_settings.image_paint)
+        ts = context.tool_settings
+        return ((context.sculpt_object and ts.sculpt) or
+                (context.vertex_paint_object and ts.vertex_paint) or
+                (context.weight_paint_object and ts.weight_paint) or
+                (context.image_paint_object and ts.image_paint))
 
     def draw(self, context):
         layout = self.layout
@@ -1005,6 +1009,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
         settings = __class__.paint_settings(context)
         brush = settings.brush
 
+        if brush is None:  # unlikely but can happen
+            layout.label(text="Brush Unset")
+            return
+
         col = layout.column()
 
         if context.sculpt_object and context.tool_settings.sculpt:
index cc9a6f7f5f051cc2c39b09f701ea560b9c67b463..57f6c9de88ee2a32c1441908cb65584b81a234ea 100644 (file)
@@ -852,7 +852,6 @@ static void finish_images(MultiresBakeRender *bkr)
 
        for(link= bkr->image.first; link; link= link->next) {
                Image *ima= (Image*)link->data;
-               int i;
                ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
 
                if(ibuf->x<=0 || ibuf->y<=0)
index 0ca0812f050317d96d022cc0f99026c7e4abb36c..be5f539431fe31e297f260a17f545dc9ab2b4614 100644 (file)
@@ -105,8 +105,8 @@ void constraintNumInput(TransInfo *t, float vec[3])
                if (getConstraintSpaceDimension(t) == 2) {
                        int axis = mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
                        if (axis == (CON_AXIS0|CON_AXIS1)) {
-                               vec[0] = vec[0];
-                               vec[1] = vec[1];
+                               /* vec[0] = vec[0]; */ /* same */
+                               /* vec[1] = vec[1]; */ /* same */
                                vec[2] = nval;
                        }
                        else if (axis == (CON_AXIS1|CON_AXIS2)) {
@@ -115,14 +115,14 @@ void constraintNumInput(TransInfo *t, float vec[3])
                                vec[0] = nval;
                        }
                        else if (axis == (CON_AXIS0|CON_AXIS2)) {
-                               vec[0] = vec[0];
+                               /* vec[0] = vec[0]; */  /* same */
                                vec[2] = vec[1];
                                vec[1] = nval;
                        }
                }
                else if (getConstraintSpaceDimension(t) == 1) {
                        if (mode & CON_AXIS0) {
-                               vec[0] = vec[0];
+                               /* vec[0] = vec[0]; */ /* same */
                                vec[1] = nval;
                                vec[2] = nval;
                        }
index b32c531d8f9ba9d26ec45deebb04261755d955b6..e395716f36decdefd5c4fd0bf82660f2d758ebf1 100644 (file)
@@ -97,6 +97,7 @@ static void do_channel_matte(bNode *node, float *out, float *in)
                        default:
                                break;
                }
+               break;
        }
        default:
                break;
index 1a339b45a05d6e647557c12b1fd1e654357e1581..2e0822a4511eae9482d5b6428b57b793c24dba52 100644 (file)
@@ -467,6 +467,7 @@ static void node_composit_exec_glare(void *UNUSED(data), bNode *node, bNodeStack
                case 2:
                default:
                        streaks(ndg, new, src);
+                       break;
        }
 
        free_compbuf(src);
index b6b1764ff0f80717087f14b060a2f71273dba0a8..eccac4f0e6d4f603272e925129173409014b10e1 100644 (file)
@@ -97,6 +97,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
                                                break;
                                        case 2:
                                                bicubic_interpolation(ibuf, obuf, u, v, xo, yo);
+                                               break;
                                        }
 
                                }
index 4b7f9dc0d973520c90a38f4cdae13d0fc6ad9b1d..bed7dd12f083a9ecfe6dfe25ca684ad054dc96e5 100644 (file)
@@ -779,7 +779,7 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self)
                for(blank_columns = (4 - self->col_size); blank_columns > 0; blank_columns--){
                        self->contigPtr[new_pos + blank_columns] = 0.0f;
                }
-               for(curr_pos = curr_pos; curr_pos >= first_row_elem; curr_pos--){
+               for( ; curr_pos >= first_row_elem; curr_pos--){
                        self->contigPtr[new_pos] = self->contigPtr[curr_pos];
                        new_pos--;
                }
index 0c5cbb22fbc2cfecf0493e3dea608e475d4adc6f..2bc11ef5f5b7283b2ad25495499171192393536a 100644 (file)
@@ -2142,6 +2142,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b
                        }
                        collisionShape = compoundShape;
                }
+               break;
        }
        return collisionShape;
 }
index 51e00b9111f8bfbf4b655e6a5316f4d0b5c426c7..18e1282b11190875e663b797e50f12b306c44e7e 100644 (file)
@@ -128,7 +128,7 @@ protected:
                virtual void            setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)
                {
                        //based on DEFAULT_PHYSICS_TIC_RATE of 60 hertz
-                       setNumTimeSubSteps(fixedTimeStep/60.f);
+                       setNumTimeSubSteps((int)(fixedTimeStep / 60.f));
                }
                //returns 0.f if no fixed timestep is used