Code cleanup: fix a few warnings (>= 0 and == -1 tests on unsigned types).
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user