Minor warning cleanup & fix

- 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.
This commit is contained in:
Campbell Barton 2011-06-27 03:36:14 +00:00
parent 4b1cceddbd
commit 33e554799b
12 changed files with 29 additions and 19 deletions

@ -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;

@ -134,6 +134,7 @@ bool ConstraintSet::setControlParameter(int id, ConstraintAction action, double
break;
default:
assert(action==ACT_NONE);
break;
}
return setControlParameters(&values, 1, timestep);
}

@ -1106,6 +1106,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
layout.operator_menu_enum("brush.curve_preset", "shape")
layout.separator()
if brush is not None: # unlikely but can happen
sculpt_tool = brush.sculpt_tool
if sculpt_tool != 'GRAB':

@ -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:

@ -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)

@ -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;
}

@ -97,6 +97,7 @@ static void do_channel_matte(bNode *node, float *out, float *in)
default:
break;
}
break;
}
default:
break;

@ -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);

@ -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;
}
}

@ -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--;
}

@ -2142,6 +2142,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b
}
collisionShape = compoundShape;
}
break;
}
return collisionShape;
}

@ -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