From e9005b985ef283d952aaaa7486d42ad6a48fb117 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Mar 2011 05:06:06 +0000 Subject: remove some redundant vars, assignments & checks. --- source/blender/editors/armature/poselib.c | 2 +- source/blender/editors/interface/interface_layout.c | 12 +++++------- source/blender/editors/render/render_shading.c | 3 +++ source/blender/editors/space_view3d/drawobject.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 21e11d7a830..5fc872d070d 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -354,7 +354,7 @@ void POSELIB_OT_action_sanitise (wmOperatorType *ot) static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg)) { Object *ob= get_poselib_object(C); - bAction *act= (ob) ? ob->poselib : NULL; + bAction *act= ob->poselib; /* never NULL */ TimeMarker *marker; /* set the operator execution context correctly */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f5061dbf0af..1e94824a9f9 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1971,17 +1971,15 @@ static void ui_litem_layout_split(uiLayout *litem) uiLayoutItemSplt *split= (uiLayoutItemSplt*)litem; uiItem *item; float percentage; - int itemh, x, y, w, tot=0, colw=0; + const int tot= BLI_countlist(&litem->items); + int itemh, x, y, w, colw=0; + + if(tot == 0) + return; x= litem->x; y= litem->y; - for(item=litem->items.first; item; item=item->next) - tot++; - - if(tot == 0) - return; - percentage= (split->percentage == 0.0f)? 1.0f/(float)tot: split->percentage; w= (litem->w - (tot-1)*litem->space); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index df9d477425c..1de693699f4 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1153,6 +1153,9 @@ static void paste_mtex_copybuf(ID *id) case ID_PA: mtex= &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]); break; + default: + BLI_assert("invalid id type"); + return; } if(mtex) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cd37e0315b3..c18ec4b617c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5152,13 +5152,13 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) drawcircball(GL_LINE_LOOP, vec, size*2.0, imat); } else if (pd->forcefield == PFIELD_VORTEX) { - float ffall_val, force_val; + float /*ffall_val,*/ force_val; unit_m4(tmat); //if (has_ipo_code(ob->ipo, OB_PD_FFALL)) // ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); //else - ffall_val = pd->f_power; + // ffall_val = pd->f_power; //if (has_ipo_code(ob->ipo, OB_PD_FSTR)) // force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); -- cgit v1.2.3