Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-19 08:06:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-19 08:06:06 +0300
commite9005b985ef283d952aaaa7486d42ad6a48fb117 (patch)
tree917221e91452b5075f710b9e5639d8d2b4b539ed /source/blender/editors
parent3b8d4aa25f23f1c4c1d9a42e6c876333c4f2c6d2 (diff)
remove some redundant vars, assignments & checks.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/interface/interface_layout.c12
-rw-r--r--source/blender/editors/render/render_shading.c3
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
4 files changed, 11 insertions, 10 deletions
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);