RNA: pass only 0/1 to RNA_property_boolean_set

This commit is contained in:
Campbell Barton 2015-02-19 12:33:14 +11:00
parent eee79641c3
commit 5721863805
6 changed files with 10 additions and 10 deletions

View File

@ -1642,7 +1642,7 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event)
mousef[1] = p->mval[1];
RNA_float_set_array(&itemptr, "mouse", mousef);
RNA_float_set(&itemptr, "pressure", p->pressure);
RNA_boolean_set(&itemptr, "is_start", (p->flags & GP_PAINTFLAG_FIRSTRUN));
RNA_boolean_set(&itemptr, "is_start", (p->flags & GP_PAINTFLAG_FIRSTRUN) != 0);
RNA_float_set(&itemptr, "time", p->curtime - p->inittime);

View File

@ -1214,7 +1214,7 @@ static void bake_set_props(wmOperator *op, Scene *scene)
prop = RNA_struct_find_property(op->ptr, "use_selected_to_active");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_TO_ACTIVE));
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_TO_ACTIVE) != 0);
}
prop = RNA_struct_find_property(op->ptr, "cage_extrusion");
@ -1254,22 +1254,22 @@ static void bake_set_props(wmOperator *op, Scene *scene)
prop = RNA_struct_find_property(op->ptr, "use_clear");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CLEAR));
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CLEAR) != 0);
}
prop = RNA_struct_find_property(op->ptr, "use_cage");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CAGE));
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CAGE) != 0);
}
prop = RNA_struct_find_property(op->ptr, "use_split_materials");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_SPLIT_MAT));
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_SPLIT_MAT) != 0);
}
prop = RNA_struct_find_property(op->ptr, "use_automatic_name");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_AUTO_NAME));
RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_AUTO_NAME) != 0);
}
}

View File

@ -167,7 +167,7 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op)
static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS));
RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS) != 0);
if (RNA_struct_property_is_set(op->ptr, "filepath"))
return rigidbody_world_export_exec(C, op);

View File

@ -274,7 +274,7 @@ static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)
return open_exec(C, op);
if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS) != 0);
open_init(C, op);

View File

@ -231,7 +231,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
if (is_relative_path) {
if ((prop = RNA_struct_find_property(op->ptr, "relative_path"))) {
if (!RNA_property_is_set_ex(op->ptr, prop, false)) {
RNA_property_boolean_set(op->ptr, prop, U.flag & USER_RELPATHS);
RNA_property_boolean_set(op->ptr, prop, (U.flag & USER_RELPATHS) != 0);
}
}
}

View File

@ -1220,7 +1220,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
else {
RNA_property_boolean_set(op->ptr, prop, t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT);
RNA_property_boolean_set(op->ptr, prop, (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) != 0);
}
}