diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-17 05:13:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-17 05:13:02 +0400 |
commit | 994f4bb3f78a467b6c34e30a9b8868fc4d01caf0 (patch) | |
tree | 937012cf0ba4a01d928c8c52c7794a683112d6a5 | |
parent | ad96dacbc5a7cc61ccf74405927847f243a955b5 (diff) |
Code cleanup: fix a few warnings (>= 0 and == -1 tests on unsigned types).
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 1 |
5 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 7c2542b33be..25ff7b5fa04 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1508,10 +1508,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf) int ok; - if(imtype == -1) { - /* use whatever existing image type is set by 'ibuf' */ - } - else if(imtype== R_IMF_IMTYPE_IRIS) { + if(imtype== R_IMF_IMTYPE_IRIS) { ibuf->ftype= IMAGIC; } #ifdef WITH_HDR diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 50fe9d26cf9..e117a934cd7 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2599,8 +2599,8 @@ static int set_active_group_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; int nr= RNA_enum_get(op->ptr, "group"); + BLI_assert(nr+1 >= 0); ob->actdef= nr+1; - BLI_assert(ob->actdef >= 0); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob); @@ -2733,8 +2733,8 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op) sort_map_update[0]= 0; vgroup_remap_update_users(ob, sort_map_update); + BLI_assert(sort_map_update[ob->actdef] >= 0); ob->actdef= sort_map_update[ob->actdef]; - BLI_assert(ob->actdef >= 0); MEM_freeN(sort_map_update); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index a5da5938f82..c0e3d00343b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1023,8 +1023,8 @@ static int weight_sample_group_exec(bContext *C, wmOperator *op) ViewContext vc; view3d_set_viewcontext(C, &vc); + BLI_assert(type + 1 >= 0); vc.obact->actdef= type + 1; - BLI_assert(vc.obact->actdef >= 0); DAG_id_tag_update(&vc.obact->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, vc.obact); @@ -1918,8 +1918,9 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED dg= ED_vgroup_add_name(ob, pchan->name); /* sets actdef */ } else { - ob->actdef= 1 + BLI_findindex(&ob->defbase, dg); - BLI_assert(ob->actdef >= 0); + int actdef = 1 + BLI_findindex(&ob->defbase, dg); + BLI_assert(actdef >= 0); + ob->actdef= actdef; } } } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 89547edaafa..e728267f45f 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -396,8 +396,8 @@ static int tree_element_active_defgroup(bContext *C, Scene *scene, TreeElement * /* id in tselem is object */ ob= (Object *)tselem->id; if(set) { + BLI_assert(te->index+1 >= 0); ob->actdef= te->index+1; - BLI_assert(ob->actdef >= 0); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 7d0c201a07c..45264fa862b 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -703,7 +703,6 @@ static void ffmpeg_postprocess(struct anim * anim) int dstStride2[4] = { -dstStride[0], 0, 0, 0 }; uint8_t* dst2[4] = { dst[0] + (anim->y - 1)*dstStride[0], 0, 0, 0 }; - int i; sws_scale(anim->img_convert_ctx, (const uint8_t * const *)input->data, |