diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-20 03:17:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-20 03:17:44 +0400 |
commit | e7c15beaf68217b2dad2143c17ba88024e3de49f (patch) | |
tree | bd391a09f5d629be2f0ac7ae3163895adf58fa8e /source/blender/editors/object | |
parent | cb11af8b0651ba0106b5f66f3be061cb8f24154c (diff) |
code cleanup: use booleans for mesh and selection code.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_lattice.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_select.c | 18 |
4 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 053f1ffabd0..9d3b2b7272d 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -638,7 +638,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, const int mval[2], int sel) return data.bp; } -int mouse_lattice(bContext *C, const int mval[2], int extend, int deselect, int toggle) +bool mouse_lattice(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle) { ViewContext vc; BPoint *bp = NULL; @@ -663,10 +663,10 @@ int mouse_lattice(bContext *C, const int mval[2], int extend, int deselect, int WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data); - return 1; + return true; } - return 0; + return false; } /******************************** Undo *************************/ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index c9070dc6205..2239148ca1c 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -198,7 +198,7 @@ static int object_has_modifier(const Object *ob, const ModifierData *exclude, * If the callback ever returns TRUE, iteration will stop and the * function value will be TRUE. Otherwise the function returns FALSE. */ -int ED_object_iter_other(Main *bmain, Object *orig_ob, int include_orig, +int ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig, int (*callback)(Object *ob, void *callback_data), void *callback_data) { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 6039ff6d34b..34a6d359f6b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -843,20 +843,20 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent return OPERATOR_CANCELLED; } -static int parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop) +static bool parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop) { const char *prop_id = RNA_property_identifier(prop); int type = RNA_enum_get(ptr, "type"); /* Only show XMirror for PAR_ARMATURE_ENVELOPE and PAR_ARMATURE_AUTO! */ - if (strcmp(prop_id, "xmirror") == 0) { + if (STREQ(prop_id, "xmirror")) { if (ELEM(type, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO)) - return TRUE; + return true; else - return FALSE; + return false; } - return TRUE; + return true; } static void parent_set_ui(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index baa0199baf7..58e51fa0603 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -894,13 +894,13 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot) static int object_select_by_layer_exec(bContext *C, wmOperator *op) { unsigned int layernum; - short extend, match; + bool extend, match; extend = RNA_boolean_get(op->ptr, "extend"); layernum = RNA_int_get(op->ptr, "layers"); match = RNA_enum_get(op->ptr, "match"); - if (extend == 0) { + if (extend == false) { CTX_DATA_BEGIN (C, Base *, base, visible_bases) { ED_base_object_select(base, BA_DESELECT); @@ -910,12 +910,12 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, Base *, base, visible_bases) { - int ok = 0; + bool ok = false; - if (match == 1) /* exact */ + if (match == true) /* exact */ ok = (base->lay == (1 << (layernum - 1))); else /* shared layers */ - ok = (base->lay & (1 << (layernum - 1))); + ok = (base->lay & (1 << (layernum - 1))) != 0; if (ok) ED_base_object_select(base, BA_SELECT); @@ -1072,7 +1072,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot) static int object_select_mirror_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - short extend; + bool extend; extend = RNA_boolean_get(op->ptr, "extend"); @@ -1093,7 +1093,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op) } } - if (extend == 0) ED_base_object_select(primbase, BA_DESELECT); + if (extend == false) ED_base_object_select(primbase, BA_DESELECT); } CTX_DATA_END; @@ -1128,11 +1128,11 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot) static int object_select_random_exec(bContext *C, wmOperator *op) { float percent; - short extend; + bool extend; extend = RNA_boolean_get(op->ptr, "extend"); - if (extend == 0) { + if (extend == false) { CTX_DATA_BEGIN (C, Base *, base, visible_bases) { ED_base_object_select(base, BA_DESELECT); |