code cleanup: use booleans for mesh and selection code.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Mar 2013 23:17:44 +0000 (23:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Mar 2013 23:17:44 +0000 (23:17 +0000)
55 files changed:
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/multires.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/pose_select.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_curve.h
source/blender/editors/include/ED_mball.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_particle.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/io/io_ops.c
source/blender/editors/mask/mask_select.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_rip.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_console/console_intern.h
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_operators.c

index eb29c49ab84f2cfb647c92962c95133cd5fd4b36..71024a4ead2d6a3aef2e40cb90b71c659f074b1d 100644 (file)
@@ -212,7 +212,7 @@ void BKE_mesh_calc_normals_mapping_ex(
         struct MVert *mverts, int numVerts,
         struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3],
         struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
-        const short only_face_normals);
+        const bool only_face_normals);
 
 void BKE_mesh_calc_normals(
         struct MVert *mverts, int numVerts,
index bee2c374f27e697b7d4ded755e3d7ec6ade26780..aa09fe1ce8df635ffe61f6495e61d27f0edca03c 100644 (file)
@@ -75,7 +75,7 @@ struct DerivedMesh *multires_make_derived_from_derived(struct DerivedMesh *dm,
 
 struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
                                                            struct ModifierData *lastmd);
-struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, int use_first);
+struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, bool use_first);
 struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd,
                                     struct Object *ob);
 void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
index 819d20d477059f64e43bc505818902f6e5bd7893..d6cd7290038d8c8142cce4012f9569ec0221e748 100644 (file)
 
 static RNG *brush_rng;
 
-void BKE_brush_system_init(void) {
+void BKE_brush_system_init(void)
+{
        brush_rng = BLI_rng_new(0);
        BLI_rng_srandom(brush_rng, 31415682);
 }
 
-void BKE_brush_system_exit(void) {
+void BKE_brush_system_exit(void)
+{
        BLI_rng_free(brush_rng);
 }
 
index de176651c19aaa8dff1798b16da675f5aacb1f96..b36f484f4ee9f8cdb96bf1f28b7e9ec37e80f236 100644 (file)
@@ -1814,7 +1814,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
                                       MLoop *mloop, MPoly *mpolys,
                                       int numLoops, int numPolys, float (*polyNors_r)[3],
                                       MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
-                                      const short only_face_normals)
+                                      const bool only_face_normals)
 {
        float (*pnors)[3] = polyNors_r, (*fnors)[3] = faceNors_r;
        int i;
index 722e1f2b91803e060a2a13065248814fbd4b7d6c..88f534c581cc3c8005f10bc3eabeb2f6814d7393 100644 (file)
@@ -310,7 +310,7 @@ MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *
 /* used for applying scale on mdisps layer and syncing subdivide levels when joining objects
  * use_first - return first multires modifier if all multires'es are disabled
  */
-MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_first)
+MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, bool use_first)
 {
        ModifierData *md;
        MultiresModifierData *mmd = NULL, *firstmmd = NULL;
index 7a3fc3a8d9b96760119ca0a4cb39feccc30ddb9a..205f67cf96af6d82939107c0c3339b3ec7e4bddf 100644 (file)
@@ -1037,7 +1037,7 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned
        }
 }
 
-static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int camera)
+static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera)
 {
        ListBase *markers = ED_context_get_markers(C);
        ARegion *ar = CTX_wm_region(C);
@@ -1106,8 +1106,8 @@ static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int c
 
 static int ed_marker_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
-       short extend = RNA_boolean_get(op->ptr, "extend");
-       short camera = 0;
+       bool extend = RNA_boolean_get(op->ptr, "extend");
+       bool camera = false;
 #ifdef DURIAN_CAMERA_SWITCH
        camera = RNA_boolean_get(op->ptr, "camera");
 #endif
index 7ff318bb6b6f2104e8ab65bc067a7ab041d354c8..bbdc0df41a77c4c78268c785fa09bcb54beac1d5 100644 (file)
@@ -454,7 +454,7 @@ static int ebone_select_flag(EditBone *ebone)
 }
 
 /* context: editmode armature in view3d */
-int mouse_armature(bContext *C, const int mval[2], int extend, int deselect, int toggle)
+bool mouse_armature(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        Object *obedit = CTX_data_edit_object(C);
        bArmature *arm = obedit->data;
@@ -550,10 +550,10 @@ int mouse_armature(bContext *C, const int mval[2], int extend, int deselect, int
                }
                
                WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, vc.obedit);
-               return 1;
+               return true;
        }
 
-       return 0;
+       return false;
 }
 
 
index 4fa1389426dc95bf6cb76bc4fae02168ed1b1694..c599e978e584872ec06c6c144d371bbb4bf37241 100644 (file)
@@ -67,7 +67,7 @@
 /* called from editview.c, for mode-less pose selection */
 /* assumes scene obact and basact is still on old situation */
 int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, short hits,
-                            short extend, short deselect, short toggle)
+                            bool extend, bool deselect, bool toggle)
 {
        Object *ob = base->object;
        Bone *nearBone;
@@ -575,7 +575,7 @@ void POSE_OT_select_hierarchy(wmOperatorType *ot)
 
 /* -------------------------------------- */
 
-static short pose_select_same_group(bContext *C, Object *ob, short extend)
+static short pose_select_same_group(bContext *C, Object *ob, bool extend)
 {
        bArmature *arm = (ob) ? ob->data : NULL;
        bPose *pose = (ob) ? ob->pose : NULL;
@@ -607,7 +607,7 @@ static short pose_select_same_group(bContext *C, Object *ob, short extend)
                }
                
                /* deselect all bones before selecting new ones? */
-               if ((extend == 0) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
+               if ((extend == false) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
                        pchan->bone->flag &= ~BONE_SELECTED;
        }
        CTX_DATA_END;
@@ -634,7 +634,7 @@ static short pose_select_same_group(bContext *C, Object *ob, short extend)
        return changed;
 }
 
-static short pose_select_same_layer(bContext *C, Object *ob, short extend)
+static short pose_select_same_layer(bContext *C, Object *ob, bool extend)
 {
        bPose *pose = (ob) ? ob->pose : NULL;
        bArmature *arm = (ob) ? ob->data : NULL;
@@ -652,7 +652,7 @@ static short pose_select_same_layer(bContext *C, Object *ob, short extend)
                        layers |= pchan->bone->layer;
                        
                /* deselect all bones before selecting new ones? */
-               if ((extend == 0) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
+               if ((extend == false) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
                        pchan->bone->flag &= ~BONE_SELECTED;
        }
        CTX_DATA_END;
@@ -673,7 +673,7 @@ static short pose_select_same_layer(bContext *C, Object *ob, short extend)
        return changed;
 }
 
-static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
+static int pose_select_same_keyingset(bContext *C, Object *ob, bool extend)
 {
        KeyingSet *ks = ANIM_scene_get_active_keyingset(CTX_data_scene(C));
        KS_Path *ksp;
@@ -690,7 +690,7 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
                return 0;
                
        /* if not extending selection, deselect all selected first */
-       if (extend == 0) {
+       if (extend == false) {
                CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
                {
                        if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0)
index e134507600e1596cdad91fec328cef7cb681cdd1..bd72ec100faae07efd60e9485e3e5fbede8cf72e 100644 (file)
@@ -4201,7 +4201,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
 
 /***************** pick select from 3d view **********************/
 
-int mouse_nurb(bContext *C, const int mval[2], int extend, int deselect, int toggle)
+bool mouse_nurb(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        Object *obedit = CTX_data_edit_object(C);
        Curve *cu = obedit->data;
@@ -4314,10 +4314,10 @@ int mouse_nurb(bContext *C, const int mval[2], int extend, int deselect, int tog
 
                WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
-               return 1;
+               return true;
        }
        
-       return 0;
+       return false;
 }
 
 /******************** spin operator ***********************/
index 671adfb8d1ecefcbe184b61654e0e2b551bb456e..a4d3c5e1ee553a3afb811fe80ddea8109c8e8082 100644 (file)
@@ -1526,7 +1526,7 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
+static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
 {
        const char *prop_id = RNA_property_identifier(prop);
        int link_strokes = RNA_boolean_get(ptr, "use_link_strokes");
@@ -1542,7 +1542,7 @@ static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
            strcmp(prop_id, "radius_multiplier") == 0 ||
            strcmp(prop_id, "use_link_strokes") == 0)
        {
-               return TRUE;
+               return true;
        }
        
        /* Never show this prop */
@@ -1550,44 +1550,44 @@ static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
                return FALSE;
 
        if (link_strokes) {
-               /* Only show when link_stroke is TRUE */
+               /* Only show when link_stroke is true */
                if (strcmp(prop_id, "timing_mode") == 0)
-                       return TRUE;
+                       return true;
                
                if (timing_mode != GP_STROKECONVERT_TIMING_NONE) {
-                       /* Only show when link_stroke is TRUE and stroke timing is enabled */
+                       /* Only show when link_stroke is true and stroke timing is enabled */
                        if (strcmp(prop_id, "frame_range") == 0 ||
                            strcmp(prop_id, "start_frame") == 0)
                        {
-                               return TRUE;
+                               return true;
                        }
                        
                        /* Only show if we have valid timing data! */
                        if (valid_timing && strcmp(prop_id, "use_realtime") == 0)
-                               return TRUE;
+                               return true;
                        
                        /* Only show if realtime or valid_timing is FALSE! */
                        if ((!realtime || !valid_timing) && strcmp(prop_id, "end_frame") == 0)
-                               return TRUE;
+                               return true;
                        
                        if (valid_timing && timing_mode == GP_STROKECONVERT_TIMING_CUSTOMGAP) {
                                /* Only show for custom gaps! */
                                if (strcmp(prop_id, "gap_duration") == 0)
-                                       return TRUE;
+                                       return true;
                                
                                /* Only show randomness for non-null custom gaps! */
                                if (strcmp(prop_id, "gap_randomness") == 0 && (gap_duration > 0.0f))
-                                       return TRUE;
+                                       return true;
                                
                                /* Only show seed for randomize action! */
                                if (strcmp(prop_id, "seed") == 0 && (gap_duration > 0.0f) && (gap_randomness > 0.0f))
-                                       return TRUE;
+                                       return true;
                        }
                }
        }
 
        /* Else, hidden! */
-       return FALSE;
+       return false;
 }
 
 static void gp_convert_ui(bContext *C, wmOperator *op)
index 310b60f13e8856a8e95adc4868eacbafba3336e1..3367dcb9c4cd097523df053cb20cb4a901ead610 100644 (file)
@@ -123,8 +123,8 @@ void ED_armature_deselect_all(struct Object *obedit, int toggle);
 void ED_armature_deselect_all_visible(struct Object *obedit);
 
 int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, 
-                            short hits, short extend, short deselect, short toggle);
-int mouse_armature(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
+                            short hits, bool extend, bool deselect, bool toggle);
+bool mouse_armature(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 int join_armature_exec(struct bContext *C, struct wmOperator *op);
 struct Bone *get_indexed_bone(struct Object *ob, int index);
 float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only);
index 66c1798f507f341caf683287d75e89a84f33b6f3..80b106680621ccc1a72ac6a8382ca03ca41e1785 100644 (file)
@@ -63,7 +63,7 @@ void    load_editNurb(struct Object *obedit);
 void    make_editNurb(struct Object *obedit);
 void    free_editNurb(struct Object *obedit);
 
-int     mouse_nurb(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
+bool    mouse_nurb(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 
 struct Nurb *add_nurbs_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);
 
index 4655188a3dd673100bd30396b96cce4d63303543..da96aba011ebdf22d579a178a4ad02dbc66ee518 100644 (file)
@@ -41,7 +41,7 @@ void ED_keymap_metaball(struct wmKeyConfig *keyconf);
 
 struct MetaElem *add_metaball_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], float dia, int type, int newname);
 
-int mouse_mball(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
+bool mouse_mball(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 
 void free_editMball(struct Object *obedit);
 void make_editMball(struct Object *obedit);
index e704b8f0bf3b42dc0f48cda30da3f01f53935d5f..7257011e28a00114cb4ecdcadc0279ec91ca919b 100644 (file)
@@ -74,7 +74,7 @@ struct rcti;
 
 
 /* editmesh_utils.c */
-void           EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const short use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
+void           EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const bool use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
 void           EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
 struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
 void           EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
@@ -93,7 +93,7 @@ void           EDBM_index_arrays_ensure(struct BMEditMesh *em, const char htype)
 void           EDBM_index_arrays_init(struct BMEditMesh *em, const char htype);
 void           EDBM_index_arrays_free(struct BMEditMesh *em);
 #ifndef NDEBUG
-int            EDBM_index_arrays_check(struct BMEditMesh *em);
+bool           EDBM_index_arrays_check(struct BMEditMesh *em);
 #endif
 struct BMVert *EDBM_vert_at_index(struct BMEditMesh *em, int index);
 struct BMEdge *EDBM_edge_at_index(struct BMEditMesh *em, int index);
@@ -137,29 +137,29 @@ void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
 
 
 /* editmesh_select.c */
-void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, int extend);
+void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, bool extend);
 void EDBM_automerge(struct Scene *scene, struct Object *ob, int update);
 
-int  EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
+bool EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
 int  EDBM_backbuf_check(unsigned int index);
 void EDBM_backbuf_free(void);
 
-int  EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot,
+bool EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot,
                                    short xmin, short ymin, short xmax, short ymax);
-int  EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
+bool EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
 
-struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const short sel, const short strict);
+struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const bool sel, const bool strict);
 struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *r_dist);
 struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, float *r_dist);
 
-int  EDBM_select_pick(struct bContext *C, const int mval[2], short extend, short deselect, short toggle);
+bool EDBM_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 
 void EDBM_selectmode_set(struct BMEditMesh *em);
 void EDBM_selectmode_convert(struct BMEditMesh *em, const short selectmode_old, const short selectmode_new);
 
 /* user access this */
-int EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new,
-                           const int action, const int use_extend, const int use_expand);
+bool EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new,
+                            const int action, const bool use_extend, const bool use_expand);
 
 
 void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select);
@@ -183,17 +183,17 @@ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEd
 
 /* editface.c */
 void paintface_flush_flags(struct Object *ob);
-int  paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend, int deselect, int toggle);
-int  do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend);
-void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags);
+bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle);
+int  do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend);
+void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
 void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], int mode);
-int  paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
+bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
 
 void paintface_hide(struct Object *ob, const int unselected);
 void paintface_reveal(struct Object *ob);
 
-void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
-void paintvert_select_ungrouped(struct Object *ob, short extend, short flush_flags);
+void paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
+void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags);
 void paintvert_flush_flags(struct Object *ob);
 
 /* mirrtopo */
@@ -204,9 +204,9 @@ typedef struct MirrTopoStore_t {
        int prev_ob_mode;
 } MirrTopoStore_t;
 
-int  ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
+bool ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
 void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
-                           const short skip_em_vert_array_init);
+                           const bool skip_em_vert_array_init);
 void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
 
 
@@ -286,9 +286,9 @@ int            mesh_get_x_mirror_vert(struct Object *ob, int index);
 struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index);
 int           *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
 
-int ED_mesh_pick_vert(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size, int use_zbuf);
-int ED_mesh_pick_face(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size);
-int ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
+bool ED_mesh_pick_vert(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf);
+bool ED_mesh_pick_face(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size);
+bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
 
 #define ED_MESH_PICK_DEFAULT_VERT_SIZE 50
 #define ED_MESH_PICK_DEFAULT_FACE_SIZE 3
index 2c43f6e4f25772c5f7525df8e9a3028fc91b5407..43bff7ce9eef47cb5c7370146d04b30255541a42 100644 (file)
@@ -164,7 +164,7 @@ void ED_object_constraint_update(struct Object *ob);
 void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
 
 /* object_lattice.c */
-int  mouse_lattice(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
+bool mouse_lattice(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 void undo_push_lattice(struct bContext *C, const char *name);
 
 /* object_lattice.c */
@@ -190,7 +190,7 @@ int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene,
                              struct Object *ob, struct ModifierData *md, int mode);
 int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
 
-int ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, int include_orig,
+int ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, const bool include_orig,
                          int (*callback)(struct Object *ob, void *callback_data),
                          void *callback_data);
 
index dee97c7882a9a75ae40c8102f9c4d3735974ec14..f9516f255cfd1497f744432fa6a753a01d40fbb2 100644 (file)
@@ -58,10 +58,10 @@ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra
 void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
 
 /* selection tools */
-int PE_mouse_particles(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
-int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend);
+int PE_mouse_particles(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
+int PE_border_select(struct bContext *C, struct rcti *rect, bool select, bool extend);
 int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad);
-int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, short extend, short select);
+int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, bool extend, bool select);
 void PE_deselect_all_visible(struct PTCacheEdit *edit);
 
 /* undo */
index 12afeb2d3438e21246a0c9d71f6f34da2fd21ac9..4a24d937a2b813b39efed2bb1b6b93d1a5fe73e0 100644 (file)
@@ -264,7 +264,7 @@ void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, i
 void view3d_get_transformation(const struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
 
 /* XXX should move to BLI_math */
-int edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2]);
+bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2]);
 
 /* get 3d region from context, also if mouse is in header or toolbar */
 struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
index f805b199280822e91bc0a7c4c7445f3d859a3c98..4077e6d1689dc9c0946627ece6ce81224b1e1647 100644 (file)
@@ -608,7 +608,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, in
 uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip);
 
 uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2);
-int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align);
+int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align);
 
 /* Links
  *
@@ -762,7 +762,7 @@ void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct Pointe
 void uiLayoutContextCopy(uiLayout *layout, struct bContextStore *context);
 const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
 void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, struct wmOperator *op,
-                          int (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
+                          bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
                           const char label_align, const short flag);
 struct MenuType *uiButGetMenuType(uiBut *but);
 
index 2ca26ae53170a588c20ef7dd3b457a04e1f3ccf3..5b6e432fc611f3bc0f47a4b39d8745395bee3129 100644 (file)
@@ -2914,7 +2914,7 @@ static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt,
 
 /* this function does not initialize the layout, functions can be called on the layout before and after */
 void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,
-                          int (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
+                          bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
                           const char label_align, const short flag)
 {
        if (!op->properties) {
index 7c84784c46bbe0fe2eb2f83d1f63e7feea741a84..3bf1a1a770175580a9fc1d618a7adec563819e34 100644 (file)
@@ -137,7 +137,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
  * in cases where PROP_HIDDEN flag can't be used for a property.
  */
 int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr,
-                     int (*check_prop)(PointerRNA *, PropertyRNA *),
+                     bool (*check_prop)(PointerRNA *, PropertyRNA *),
                      const char label_align)
 {
        uiLayout *split, *col;
index f2a0532932daa7cd6ee198739d64774ff6f53279..a33340cc39a4c85488bd7ee294ae30c836d1bf44 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "io_collada.h"
 
+#include "BLI_utildefines.h"
+
 #include "WM_types.h"
 #include "WM_api.h"
 
index ccc2fad5f5247219b4ec9be6f3eeca4a4cf18738..7de6f66f2eff1368a7db44142000c5dec468fad2 100644 (file)
@@ -252,9 +252,9 @@ static int select_exec(bContext *C, wmOperator *op)
        MaskSpline *spline;
        MaskSplinePoint *point = NULL;
        float co[2];
-       short extend = RNA_boolean_get(op->ptr, "extend");
-       short deselect = RNA_boolean_get(op->ptr, "deselect");
-       short toggle = RNA_boolean_get(op->ptr, "toggle");
+       bool extend = RNA_boolean_get(op->ptr, "extend");
+       bool deselect = RNA_boolean_get(op->ptr, "deselect");
+       bool toggle = RNA_boolean_get(op->ptr, "toggle");
 
        int is_handle = 0;
        const float threshold = 19;
@@ -263,7 +263,7 @@ static int select_exec(bContext *C, wmOperator *op)
 
        point = ED_mask_point_find_nearest(C, mask, co, threshold, &masklay, &spline, &is_handle, NULL);
 
-       if (extend == 0 && deselect == 0 && toggle == 0)
+       if (extend == false && deselect == false && toggle == false)
                ED_mask_select_toggle_all(mask, SEL_DESELECT);
 
        if (point) {
index 260d01d726afd030e18f0d6349161ce3650ffb57..d6ae2497cbb84d483d5492c2dd112146b6b243b4 100644 (file)
@@ -203,7 +203,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
        MLoop *ml;
        MEdge *med;
        char *linkflag;
-       int a, b, do_it = TRUE, mark = 0;
+       int a, b, mark = 0;
+       bool do_it = true;
 
        ehash = BLI_edgehash_new();
        seamhash = BLI_edgehash_new();
@@ -234,7 +235,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
        }
 
        while (do_it) {
-               do_it = FALSE;
+               do_it = false;
 
                /* expand selection */
                mp = me->mpoly;
@@ -257,7 +258,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
                                if (mark) {
                                        linkflag[a] = 1;
                                        hash_add_face(ehash, mp, me->mloop + mp->loopstart);
-                                       do_it = TRUE;
+                                       do_it = true;
                                }
                        }
                }
@@ -315,7 +316,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, const int UNUSED(m
        paintface_flush_flags(ob);
 }
 
-void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
+void paintface_deselect_all_visible(Object *ob, int action, bool flush_flags)
 {
        Mesh *me;
        MPoly *mpoly;
@@ -374,14 +375,15 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
        }
 }
 
-int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
+bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
 {
        Mesh *me;
        MPoly *mp;
        MTexPoly *tf;
        MLoop *ml;
        MVert *mvert;
-       int a, b, ok = FALSE;
+       int a, b;
+       bool ok = false;
        float vec[3], bmat[3][3];
 
        me = BKE_mesh_from_object(ob);
@@ -404,7 +406,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
                        minmax_v3v3_v3(r_min, r_max, vec);
                }
 
-               ok = TRUE;
+               ok = true;
        }
 
        return ok;
@@ -483,7 +485,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
 }
 #endif
 
-int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], int extend, int deselect, int toggle)
+bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        Mesh *me;
        MPoly *mpoly, *mpoly_sel;
@@ -493,13 +495,13 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
        me = BKE_mesh_from_object(ob);
 
        if (!ED_mesh_pick_face(C, ob, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE))
-               return 0;
+               return false;
        
        if (index >= me->totpoly)
-               return 0;
+               return false;
 
        mpoly_sel = me->mpoly + index;
-       if (mpoly_sel->flag & ME_HIDE) return 0;
+       if (mpoly_sel->flag & ME_HIDE) return false;
        
        /* clear flags */
        mpoly = me->mpoly;
@@ -534,10 +536,10 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
        paintface_flush_flags(ob);
        WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
        ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
-       return 1;
+       return true;
 }
 
-int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
+int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
 {
        Object *ob = vc->obact;
        Mesh *me;
@@ -556,8 +558,8 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 
        selar = MEM_callocN(me->totpoly + 1, "selar");
 
-       if (extend == 0 && select) {
-               paintface_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
+       if (extend == false && select) {
+               paintface_deselect_all_visible(vc->obact, SEL_DESELECT, false);
 
                mpoly = me->mpoly;
                for (a = 1; a <= me->totpoly; a++, mpoly++) {
@@ -652,8 +654,8 @@ void paintvert_flush_flags(Object *ob)
                }
        }
 }
-/*  note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
-void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
+/*  note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
+void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
 {
        Mesh *me;
        MVert *mvert;
@@ -712,7 +714,7 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
        }
 }
 
-void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags)
+void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags)
 {
        Mesh *me = BKE_mesh_from_object(ob);
        MVert *mv;
@@ -724,7 +726,7 @@ void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags)
        }
 
        if (!extend) {
-               paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE);
+               paintvert_deselect_all_visible(ob, SEL_DESELECT, false);
        }
 
        dv = me->dvert;
@@ -769,7 +771,7 @@ static int mirrtopo_vert_sort(const void *v1, const void *v2)
        return 0;
 }
 
-int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store)
+bool ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store)
 {
        int totvert;
        int totedge;
@@ -788,16 +790,16 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *
            (totvert != mesh_topo_store->prev_vert_tot) ||
            (totedge != mesh_topo_store->prev_edge_tot))
        {
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 
 }
 
 void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
-                           const short skip_em_vert_array_init)
+                           const bool skip_em_vert_array_init)
 {
        MEdge *medge;
        BMEditMesh *em = me->edit_btmesh;
@@ -900,7 +902,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
        index_lookup = MEM_mallocN(totvert * sizeof(*index_lookup), "mesh_topo_lookup");
 
        if (em) {
-               if (skip_em_vert_array_init == FALSE) {
+               if (skip_em_vert_array_init == false) {
                        EDBM_index_arrays_ensure(em, BM_VERT);
                }
        }
index 174715495f6b9a19d9980519bebcc2f456c2a12c..bcff5adb345c951fc46603be495c484b61cc6ed8 100644 (file)
@@ -62,7 +62,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
 
        *state = 0;
        if (obedit == NULL || obedit->type != OB_MESH) {
-               obedit = ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
+               obedit = ED_object_add_type(C, OB_MESH, loc, rot, false, layer);
 
                rename_id((ID *)obedit, idname);
                rename_id((ID *)obedit->data, idname);
@@ -72,7 +72,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
                *state = 1;
        }
 
-       *dia = ED_object_new_primitive_matrix(C, obedit, loc, rot, mat, FALSE);
+       *dia = ED_object_new_primitive_matrix(C, obedit, loc, rot, mat, false);
 
        return obedit;
 }
@@ -87,7 +87,7 @@ static void make_prim_finish(bContext *C, Object *obedit, int *state, int enter_
        EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
 
        /* only recalc editmode tessface if we are staying in editmode */
-       EDBM_update_generic(em, !exit_editmode, TRUE);
+       EDBM_update_generic(em, !exit_editmode, true);
 
        /* userdef */
        if (exit_editmode) {
@@ -134,7 +134,7 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_cube_exec(bContext *C, wmOperator *op)
@@ -174,7 +174,7 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static const EnumPropertyItem fill_type_items[] = {
@@ -235,7 +235,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
        RNA_def_property_subtype(prop, PROP_DISTANCE);
        RNA_def_enum(ot->srna, "fill_type", fill_type_items, 0, "Fill Type", "");
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
@@ -296,7 +296,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
        RNA_def_property_subtype(prop, PROP_DISTANCE);
        RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Cap Fill Type", "");
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_cone_exec(bContext *C, wmOperator *op)
@@ -356,7 +356,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
        RNA_def_property_subtype(prop, PROP_DISTANCE);
        RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Base Fill Type", "");
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_grid_exec(bContext *C, wmOperator *op)
@@ -409,7 +409,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
        prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX);
        RNA_def_property_subtype(prop, PROP_DISTANCE);
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
@@ -455,7 +455,7 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
@@ -507,7 +507,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
        prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00);
        RNA_def_property_subtype(prop, PROP_DISTANCE);
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
 
 static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
@@ -559,5 +559,5 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
        prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
        RNA_def_property_subtype(prop, PROP_DISTANCE);
 
-       ED_object_add_generic_props(ot, TRUE);
+       ED_object_add_generic_props(ot, true);
 }
index e52b1e5c372360158d145c18b54c848c09954ee2..57d3f7406cae7077aa86a9582d9a8da215646fb4 100644 (file)
@@ -1200,7 +1200,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
 
        for (i = 0; i < tot; i++, result++) {
                BMLoop *l1;
-               BMFace *hitf;
+               BMFace *f_hit;
                ListBase *lst;
                Ref *ref;
 
@@ -1233,7 +1233,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
                                        continue;
                                }
                                if ((kcd->vc.rv3d->rflag & RV3D_CLIPPING) &&
-                                   ED_view3d_clipping_test(kcd->vc.rv3d, p, TRUE))
+                                   ED_view3d_clipping_test(kcd->vc.rv3d, p, true))
                                {
                                        continue;
                                }
@@ -1243,7 +1243,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
                                mul_m4_v3(kcd->ob->imat, view);
 
                                if (kcd->cut_through) {
-                                       hitf = FALSE;
+                                       f_hit = NULL;
                                }
                                else {
                                        /* check if this point is visible in the viewport */
@@ -1267,11 +1267,11 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
                                        add_v3_v3(p1, no);
                                                
                                        /* ray cast */
-                                       hitf = BMBVH_RayCast(bmtree, p1, no, NULL, NULL);
+                                       f_hit = BMBVH_RayCast(bmtree, p1, no, NULL, NULL);
                                }
 
                                /* ok, if visible add the new point */
-                               if (!hitf && !BLI_smallhash_haskey(ehash, (intptr_t)kfe)) {
+                               if (!f_hit && !BLI_smallhash_haskey(ehash, (intptr_t)kfe)) {
                                        BMEdgeHit hit;
        
                                        if (len_squared_v3v3(p, kcd->curr.co) < depsilon_sq ||
@@ -1555,7 +1555,7 @@ static int knife_sample_screen_density(KnifeTool_OpData *kcd, const float radius
                                dis_sq = len_squared_v2v2(kfv->sco, sco);
                                if (dis_sq < radius_sq) {
                                        if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
-                                               if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
+                                               if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, true) == 0) {
                                                        c++;
                                                }
                                        }
@@ -1634,7 +1634,7 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo
 
                                        interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, lambda);
 
-                                       if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
+                                       if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, true) == 0) {
                                                cure = kfe;
                                                curdis = dis;
                                        }
@@ -1725,7 +1725,7 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo
                                dis_sq = len_squared_v2v2(kfv->sco, sco);
                                if (dis_sq < curdis_sq && dis_sq < maxdist_sq) {
                                        if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
-                                               if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
+                                               if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, true) == 0) {
                                                        curv = kfv;
                                                        curdis_sq = dis_sq;
                                                }
@@ -1933,7 +1933,7 @@ static void remerge_faces(KnifeTool_OpData *kcd)
                if (BLI_array_count(faces) > 0) {
                        idx = BM_elem_index_get(faces[0]);
 
-                       f2 = BM_faces_join(bm, faces, BLI_array_count(faces), TRUE);
+                       f2 = BM_faces_join(bm, faces, BLI_array_count(faces), true);
                        if (f2) {
                                BMO_elem_flag_enable(bm, f2, FACE_NEW);
                                BM_elem_index_set(f2, idx); /* set_dirty! *//* BMESH_TODO, check if this is valid or not */
@@ -2144,7 +2144,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
 
                        f2 = BM_face_create_quad_tri(bm,
                                                     v1, v2, v3, NULL,
-                                                    NULL, FALSE);
+                                                    NULL, false);
 
                        BMO_elem_flag_enable(bm, f2, FACE_NEW);
 
@@ -2184,7 +2184,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
                BM_elem_attrs_copy(bm, bm, f2, f);
 
                BM_ITER_ELEM (l1, &liter1, f, BM_LOOPS_OF_FACE) {
-                       BM_loop_interp_from_face(bm, l1, f2, TRUE, TRUE);
+                       BM_loop_interp_from_face(bm, l1, f2, true, true);
                }
        }
 
@@ -2434,11 +2434,11 @@ static ListBase *find_hole(KnifeTool_OpData *kcd, ListBase *fedges)
 }
 
 /* Try to find "nice" diagonals - short, and far apart from each other.
- * If found, return TRUE and make a 'main chain' going across f which uses
+ * If found, return true and make a 'main chain' going across f which uses
  * the two diagonals and one part of the hole, and a 'side chain' that
  * completes the hole. */
-static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, ListBase **mainchain,
-                            ListBase **sidechain)
+static bool find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, ListBase **mainchain,
+                             ListBase **sidechain)
 {
        float **fco, **hco;
        BMVert **fv;
@@ -2450,14 +2450,14 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
        ListBase *chain;
        BMVert *v;
        BMIter iter;
-       int nh, nf, i, j, k, m, ax, ay, ok, sep = 0 /* Quite warnings */, bestsep;
+       int nh, nf, i, j, k, m, ax, ay, sep = 0 /* Quite warnings */, bestsep;
        int besti[2], bestj[2];
        float d, bestd;
 
        nh = BLI_countlist(hole);
        nf = f->len;
        if (nh < 2 || nf < 3)
-               return 0;
+               return false;
 
        /* Gather 2d projections of hole and face vertex coordinates.
         * Use best-axis projection - not completely accurate, maybe revisit */
@@ -2518,18 +2518,20 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
                                bestd = FLT_MAX;
                        }
                        for (j = 0; j < nf; j++) {
+                               bool ok;
+
                                if (m == 1 && j == bestj[0])
                                        continue;
                                d = len_squared_v2v2(hco[i], fco[j]);
                                if (d > bestd)
                                        continue;
 
-                               ok = TRUE;
+                               ok = true;
                                for (k = 0; k < nh && ok; k++) {
                                        if (k == i || (k + 1) % nh == i)
                                                continue;
                                        if (isect_line_line_v2(hco[i], fco[j], hco[k], hco[(k + 1) % nh]))
-                                               ok = FALSE;
+                                               ok = false;
                                }
                                if (!ok)
                                        continue;
@@ -2537,7 +2539,7 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
                                        if (k == j || (k + 1) % nf == j)
                                                continue;
                                        if (isect_line_line_v2(hco[i], fco[j], fco[k], fco[(k + 1) % nf]))
-                                               ok = FALSE;
+                                               ok = false;
                                }
                                if (ok) {
                                        besti[m] = i;
@@ -2572,14 +2574,14 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
                }
                *sidechain = chain;
 
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
-static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMFace *f)
+static bool knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMFace *f)
 {
        /* BMesh *bm = kcd->em->bm; */ /* UNUSED */
        BMVert *v1, *v2;
@@ -2589,7 +2591,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
        int v1inside, v2inside;
 
        if (!f)
-               return FALSE;
+               return false;
 
        v1 = kfe->v1->v;
        v2 = kfe->v2->v;
@@ -2608,7 +2610,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
        v1inside = l1 ? 0 : BM_face_point_inside_test(f, kfe->v1->co);
        v2inside = l2 ? 0 : BM_face_point_inside_test(f, kfe->v2->co);
        if ((l1 && v2inside) || (l2 && v1inside) || (v1inside && v2inside))
-               return TRUE;
+               return true;
        if (l1 && l2) {
                /* Can have case where v1 and v2 are on shared chain between two faces.
                 * BM_face_legal_splits does visibility and self-intersection tests,
@@ -2617,7 +2619,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
                mid_v3_v3v3(mid, kfe->v1->co, kfe->v2->co);
                return BM_face_point_inside_test(f, mid);
        }
-       return FALSE;
+       return false;
 }
 
 /* Split face f with KnifeEdges on chain.  f remains as one side, the face formed is put in *newface.
@@ -2658,7 +2660,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
                        *newface = NULL;
                }
                else {
-                       *newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, TRUE);
+                       *newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, true);
                }
        }
        else {
@@ -2670,7 +2672,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
                        for (l_iter = lnew->next, i = 0; i < nco; l_iter = l_iter->next, i++) {
                                BLI_assert(equals_v3v3(cos[i], l_iter->v->co));
                                if (kcd->select_result) {
-                                       BM_edge_select_set(bm, l_iter->e, TRUE);
+                                       BM_edge_select_set(bm, l_iter->e, true);
                                }
                                kverts[i]->v = l_iter->v;
                        }
@@ -2680,7 +2682,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
        /* the select chain above doesnt account for the first loop */
        if (kcd->select_result) {
                if (lnew) {
-                       BM_edge_select_set(bm, lnew->e, TRUE);
+                       BM_edge_select_set(bm, lnew->e, true);
                }
        }
 }
@@ -2717,7 +2719,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
                if (fnew_kfedges->first)
                        knife_make_face_cuts(kcd, fnew, fnew_kfedges);
 
-               /* find_chain should always remove edges if it returns TRUE,
+               /* find_chain should always remove edges if it returns true,
                 * but guard against infinite loop anyway */
                count = BLI_countlist(kfedges);
                if (count >= oldcount) {
@@ -2783,7 +2785,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
                                knife_make_face_cuts(kcd, fnew2, fnew2_kfedges);
                        if (f == fhole)
                                break;
-                       /* find_hole should always remove edges if it returns TRUE,
+                       /* find_hole should always remove edges if it returns true,
                         * but guard against infinite loop anyway */
                        count = BLI_countlist(kfedges);
                        if (count >= oldcount) {
@@ -2887,7 +2889,7 @@ static void knifetool_finish_ex(KnifeTool_OpData *kcd)
 #endif
 
        EDBM_mesh_normals_update(kcd->em);
-       EDBM_update_generic(kcd->em, TRUE, TRUE);
+       EDBM_update_generic(kcd->em, true, true);
 }
 static void knifetool_finish(wmOperator *op)
 {
@@ -3191,7 +3193,7 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                knife_update_active(kcd);
                                knife_update_header(C, kcd);
                                ED_region_tag_redraw(kcd->ar);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODAL_MIDPOINT_OFF:
                                kcd->snap_midpoints = false;
@@ -3200,29 +3202,29 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                knife_update_active(kcd);
                                knife_update_header(C, kcd);
                                ED_region_tag_redraw(kcd->ar);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODEL_IGNORE_SNAP_ON:
                                ED_region_tag_redraw(kcd->ar);
                                kcd->ignore_vert_snapping = kcd->ignore_edge_snapping = true;
                                knife_update_header(C, kcd);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODEL_IGNORE_SNAP_OFF:
                                ED_region_tag_redraw(kcd->ar);
                                kcd->ignore_vert_snapping = kcd->ignore_edge_snapping = false;
                                knife_update_header(C, kcd);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODAL_ANGLE_SNAP_TOGGLE:
                                kcd->angle_snapping = !kcd->angle_snapping;
                                knife_update_header(C, kcd);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODAL_CUT_THROUGH_TOGGLE:
                                kcd->cut_through = !kcd->cut_through;
                                knife_update_header(C, kcd);
-                               do_refresh = TRUE;
+                               do_refresh = true;
                                break;
                        case KNF_MODAL_NEW_CUT:
                                ED_region_tag_redraw(kcd->ar);
@@ -3301,8 +3303,8 @@ void MESH_OT_knife_tool(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
 
-       RNA_def_boolean(ot->srna, "use_occlude_geometry", TRUE, "Occlude Geometry", "Only cut the front most geometry");
-       RNA_def_boolean(ot->srna, "only_selected", FALSE, "Only Selected", "Only cut selected geometry");
+       RNA_def_boolean(ot->srna, "use_occlude_geometry", true, "Occlude Geometry", "Only cut the front most geometry");
+       RNA_def_boolean(ot->srna, "only_selected", false, "Only Selected", "Only cut selected geometry");
 }
 
 
index 5b9864ca23933f663ceefde55d9e3756112d6694..89bfc315094e426b19a49482389d59aae086d629 100644 (file)
@@ -77,8 +77,8 @@ typedef struct RingSelOpData {
        BMEdge *eed;
        NumInput num;
 
-       int extend;
-       int do_cut;
+       bool extend;
+       bool do_cut;
 } RingSelOpData;
 
 /* modal loop selection drawing callback */
@@ -186,7 +186,7 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
                         BMW_NIL_LAY);
 
                for (eed = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) {
-                       BM_edge_select_set(em->bm, eed, TRUE);
+                       BM_edge_select_set(em->bm, eed, true);
                }
                BMW_end(&walker);
 
@@ -276,9 +276,9 @@ static void ringsel_finish(bContext *C, wmOperator *op)
        const int cuts = RNA_int_get(op->ptr, "number_cuts");
        const float smoothness = 0.292f * RNA_float_get(op->ptr, "smoothness");
 #ifdef BMW_EDGERING_NGON
-       const int use_only_quads = FALSE;
+       const bool use_only_quads = false;
 #else
-       const int use_only_quads = TRUE;
+       const bool use_only_quads = false;
 #endif
 
        if (lcd->eed) {
@@ -293,11 +293,11 @@ static void ringsel_finish(bContext *C, wmOperator *op)
                        BM_mesh_esubdivide(em->bm, BM_ELEM_SELECT,
                                           smoothness, 0.0f, 0.0f,
                                           cuts,
-                                          SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, TRUE,
+                                          SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, true,
                                           use_only_quads, 0);
 
                        /* tessface is already re-recalculated */
-                       EDBM_update_generic(em, FALSE, TRUE);
+                       EDBM_update_generic(em, false, true);
 
                        /* force edge slide to edge select mode in in face select mode */
                        if (em->selectmode & SCE_SELECT_FACE) {
@@ -349,7 +349,7 @@ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
 
 
 /* called when modal loop selection gets set up... */
-static int ringsel_init(bContext *C, wmOperator *op, int do_cut)
+static int ringsel_init(bContext *C, wmOperator *op, bool do_cut)
 {
        RingSelOpData *lcd;
 
@@ -423,7 +423,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
        float smoothness = RNA_float_get(op->ptr, "smoothness");
        int cuts = RNA_int_get(op->ptr, "number_cuts");
        RingSelOpData *lcd = op->customdata;
-       int show_cuts = 0;
+       bool show_cuts = false;
 
        view3d_operator_needs_opengl(C);
 
@@ -471,12 +471,12 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                cuts++;
                                RNA_int_set(op->ptr, "number_cuts", cuts);
                                ringsel_find_edge(lcd, cuts);
-                               show_cuts = TRUE;
+                               show_cuts = true;
                        }
                        else {
                                smoothness = min_ff(smoothness + 0.05f, 4.0f);
                                RNA_float_set(op->ptr, "smoothness", smoothness);
-                               show_cuts = TRUE;
+                               show_cuts = true;
                        }
                        
                        ED_region_tag_redraw(lcd->ar);
@@ -491,12 +491,12 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                cuts = max_ii(cuts - 1, 0);
                                RNA_int_set(op->ptr, "number_cuts", cuts);
                                ringsel_find_edge(lcd, cuts);
-                               show_cuts = TRUE;
+                               show_cuts = true;
                        }
                        else {
                                smoothness = max_ff(smoothness - 0.05f, 0.0f);
                                RNA_float_set(op->ptr, "smoothness", smoothness);
-                               show_cuts = TRUE;
+                               show_cuts = true;
                        }
                        
                        ED_region_tag_redraw(lcd->ar);
@@ -534,7 +534,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        
                        RNA_int_set(op->ptr, "number_cuts", cuts);
                        ringsel_find_edge(lcd, cuts);
-                       show_cuts = TRUE;
+                       show_cuts = true;
                        
                        ED_region_tag_redraw(lcd->ar);
                }
index 8198e088e5a61e38ccae2ff1ae8ebe4805866fa7..07f7742028f863f0b399a2bb59a777c2120f3aa7 100644 (file)
@@ -207,7 +207,7 @@ static BMEdge *edbm_ripsel_edge_mark_step(BMVert *v, const int uid)
 
                        BM_edge_loop_pair(e, &l_a, &l_b); /* no need to check, we know this will be true */
 
-                       /* so (IS_VISIT_DONE == TRUE) */
+                       /* so (IS_VISIT_DONE == true) */
                        BM_elem_index_set(l_a, uid);
                        BM_elem_index_set(l_b, uid);
 
@@ -246,7 +246,7 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm)
        }
 
        /* set contiguous loops ordered 'uid' values for walking after split */
-       while (TRUE) {
+       while (true) {
                int tot = 0;
                BMIter eiter;
                BMEdge *e_step;
@@ -373,7 +373,7 @@ static void edbm_ripsel_deselect_helper(BMesh *bm, EdgeLoopPair *eloop_pairs,
                e = (score_a > score_b) ? lp->l_a->e : lp->l_b->e;
                v_prev = edbm_ripsel_edloop_pair_start_vert(e);
                for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) {
-                       BM_edge_select_set(bm, e, FALSE);
+                       BM_edge_select_set(bm, e, false);
                }
        }
 }
@@ -486,9 +486,9 @@ static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *u
                        }
 
                        /* face should never exist */
-                       BLI_assert(BM_face_exists(f_verts, f_verts[3] ? 4 : 3, &f) == FALSE);
+                       BLI_assert(BM_face_exists(f_verts, f_verts[3] ? 4 : 3, &f) == false);
 
-                       f = BM_face_create_quad_tri_v(bm, f_verts, f_verts[3] ? 4 : 3, f_example, FALSE);
+                       f = BM_face_create_quad_tri_v(bm, f_verts, f_verts[3] ? 4 : 3, f_example, false);
 
                        l_iter = BM_FACE_FIRST_LOOP(f);
 
@@ -511,21 +511,21 @@ static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *u
 /* --- end 'face-fill' code --- */
 
 
-static int edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op)
+static bool edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op)
 {
        BMOperator bmop;
 
        if (!EDBM_op_init(em, &bmop, op, "split_edges edges=%he verts=%hv use_verts=%b",
-                         BM_ELEM_TAG, BM_ELEM_SELECT, TRUE))
+                         BM_ELEM_TAG, BM_ELEM_SELECT, true))
        {
-               return FALSE;
+               return false;
        }
        BMO_op_exec(em->bm, &bmop);
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
-               return FALSE;
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
+               return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 /**
@@ -549,7 +549,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
        float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
        float dist = FLT_MAX;
        float d;
-       int is_wire;
+       bool is_wire;
 
        BMEditSelection ese;
        int totboundary_edge = 0;
@@ -585,7 +585,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                         * otherwise we can't a face away from a wire edge */
                        totboundary_edge += (is_boundary != 0 || BM_edge_is_wire(e));
                        if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
-                               if (is_boundary == FALSE && BM_edge_is_manifold(e)) {
+                               if (is_boundary == false && BM_edge_is_manifold(e)) {
                                        d = edbm_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval, INSET_DEFAULT);
                                        if (d < dist) {
                                                dist = d;
@@ -640,22 +640,22 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
         * - the boundary edge total is greater then 2,
         *   in this case edge split _can_ work but we get far nicer results if we use this special case.
         * - there are only 2 edges but we are a wire vert. */
-       if ((is_wire == FALSE && totboundary_edge > 2) ||
-           (is_wire == TRUE  && totboundary_edge > 1))
+       if ((is_wire == false && totboundary_edge > 2) ||
+           (is_wire == true  && totboundary_edge > 1))
        {
                BMVert **vout;
                int vout_len;
 
-               BM_vert_select_set(bm, v, FALSE);
+               BM_vert_select_set(bm, v, false);
 
-               if (bmesh_vert_separate(bm, v, &vout, &vout_len) == FALSE) {
+               if (bmesh_vert_separate(bm, v, &vout, &vout_len) == false) {
                        BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
                        return OPERATOR_CANCELLED;
                }
                else if (vout_len < 2) {
                        MEM_freeN(vout);
                        /* set selection back to avoid active-unselected vertex */
-                       BM_vert_select_set(bm, v, TRUE);
+                       BM_vert_select_set(bm, v, true);
                        /* should never happen */
                        BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
                        return OPERATOR_CANCELLED;
@@ -673,7 +673,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                         * either by its face corner, or connected edge (when no faces are attached) */
                        for (i = 0; i < vout_len; i++) {
 
-                               if (BM_vert_is_wire(vout[i]) == FALSE) {
+                               if (BM_vert_is_wire(vout[i]) == false) {
                                        /* find the best face corner */
                                        BM_ITER_ELEM (l, &iter, vout[i], BM_LOOPS_OF_VERT) {
                                                if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
@@ -709,7 +709,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
 
                        /* select the vert from the best region */
                        v = vout[vi_best];
-                       BM_vert_select_set(bm, v, TRUE);
+                       BM_vert_select_set(bm, v, true);
 
                        if (ese.ele) {
                                BM_select_history_store(bm, v);
@@ -804,7 +804,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
                                /* disable by default, re-enable winner at end */
-                               BM_vert_select_set(bm, v, FALSE);
+                               BM_vert_select_set(bm, v, false);
 
                                BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
                                        /* calculate a point in the face, rather then calculate the middle,
@@ -829,7 +829,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
                }
 
                if (v_best) {
-                       BM_vert_select_set(bm, v_best, TRUE);
+                       BM_vert_select_set(bm, v_best, true);
                        if (ese.ele) {
                                BM_select_history_store(bm, v_best);
                        }
@@ -878,14 +878,14 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
 
        /* expand edge selection */
        BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
-               int all_manifold;
+               bool all_manifold;
                int totedge_manifold;  /* manifold, visible edges */
                int i;
 
                e2 = NULL;
                i = 0;
                totedge_manifold = 0;
-               all_manifold = TRUE;
+               all_manifold = true;
                BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
 
                        if (!BM_edge_is_wire(e) &&
@@ -901,8 +901,8 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
                        }
 
                        /** #BM_vert_other_disk_edge has no hidden checks so don't check hidden here */
-                       if ((all_manifold == TRUE) && (BM_edge_is_manifold(e) == FALSE)) {
-                               all_manifold = FALSE;
+                       if ((all_manifold == true) && (BM_edge_is_manifold(e) == false)) {
+                               all_manifold = false;
                        }
                }
 
@@ -911,7 +911,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
                        /* note: if the case of 3 edges has one change in loop stepping,
                         * if this becomes more involved we may be better off splitting
                         * the 3 edge case into its own else-if branch */
-                       if ((totedge_manifold == 4 || totedge_manifold == 3) || (all_manifold == FALSE)) {
+                       if ((totedge_manifold == 4 || totedge_manifold == 3) || (all_manifold == false)) {
                                BMLoop *l_a = e2->l;
                                BMLoop *l_b = l_a->radial_next;
 
@@ -1034,7 +1034,7 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -1056,6 +1056,6 @@ void MESH_OT_rip(wmOperatorType *ot)
 
        /* to give to transform */
        Transform_Properties(ot, P_PROPORTIONAL);
-       RNA_def_boolean(ot->srna, "mirror", FALSE, "Mirror Editing", "");
-       RNA_def_boolean(ot->srna, "use_fill", FALSE, "Fill", "Fill the ripped region");
+       RNA_def_boolean(ot->srna, "mirror", false, "Mirror Editing", "");
+       RNA_def_boolean(ot->srna, "use_fill", false, "Fill", "Fill the ripped region");
 }
index 3d0101f962bdfd31ed38306982f61d5308a863ee..449ab45da6980eb5de9df213b7d46c2290a2385c 100644 (file)
@@ -74,7 +74,7 @@
 
 /* ****************************** MIRROR **************** */
 
-void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
+void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, bool extend)
 {
        BMVert *v1, *v2;
        BMIter iter;
@@ -88,7 +88,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
                }
        }
 
-       EDBM_verts_mirror_cache_begin(em, TRUE);
+       EDBM_verts_mirror_cache_begin(em, true);
 
        if (!extend)
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
@@ -99,7 +99,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
 
                v2 = EDBM_verts_mirror_get(em, v1);
                if (v2 && !BM_elem_flag_test(v2, BM_ELEM_HIDDEN)) {
-                       BM_vert_select_set(em->bm, v2, TRUE);
+                       BM_vert_select_set(em->bm, v2, true);
                }
        }
 
@@ -124,7 +124,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
                                  BM_ELEM_SELECT, scene->toolsettings->doublimit);
 
                if (LIKELY(ok) && update) {
-                       EDBM_update_generic(em, TRUE, TRUE);
+                       EDBM_update_generic(em, true, true);
                }
        }
 }
@@ -184,19 +184,19 @@ static void draw_triangulated(const int mcords[][2], const short tot)
 
 /* reads rect, and builds selection array for quick lookup */
 /* returns if all is OK */
-int EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
+bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
 {
        struct ImBuf *buf;
        unsigned int *dr;
        int a;
        
        if (vc->obedit == NULL || vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
-               return 0;
+               return false;
        }
        
        buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
-       if (buf == NULL) return 0;
-       if (bm_vertoffs == 0) return 0;
+       if (buf == NULL) return false;
+       if (bm_vertoffs == 0) return false;
 
        dr = buf->rect;
        
@@ -210,7 +210,7 @@ int EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax
                dr++;
        }
        IMB_freeImBuf(buf);
-       return 1;
+       return true;
 }
 
 int EDBM_backbuf_check(unsigned int index)
@@ -233,7 +233,7 @@ void EDBM_backbuf_free(void)
  * - grab again and compare
  * returns 'OK' 
  */
-int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
+bool EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
 {
        unsigned int *dr, *drm;
        struct ImBuf *buf, *bufmask;
@@ -242,16 +242,16 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
        /* method in use for face selecting too */
        if (vc->obedit == NULL) {
                if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
-                       return 0;
+                       return false;
                }
        }
        else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
-               return 0;
+               return false;
        }
 
        buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
-       if (buf == NULL) return 0;
-       if (bm_vertoffs == 0) return 0;
+       if (buf == NULL) return false;
+       if (bm_vertoffs == 0) return false;
 
        dr = buf->rect;
 
@@ -282,7 +282,7 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
        bufmask = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
 
        if (bufmask == NULL) {
-               return 0; /* only when mem alloc fails, go crash somewhere else! */
+               return false;  /* only when mem alloc fails, go crash somewhere else! */
        }
        else {
                drm = bufmask->rect;
@@ -299,11 +299,11 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
        IMB_freeImBuf(buf);
        IMB_freeImBuf(bufmask);
 
-       return 1;
+       return true;
 }
 
 /* circle shaped sample area */
-int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
+bool EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
 {
        struct ImBuf *buf;
        unsigned int *dr;
@@ -313,18 +313,18 @@ int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
        /* method in use for face selecting too */
        if (vc->obedit == NULL) {
                if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
-                       return 0;
+                       return false;
                }
        }
        else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
-               return 0;
+               return false;
        }
 
        xmin = xs - rads; xmax = xs + rads;
        ymin = ys - rads; ymax = ys + rads;
        buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
-       if (bm_vertoffs == 0) return 0;
-       if (buf == NULL) return 0;
+       if (bm_vertoffs == 0) return false;
+       if (buf == NULL) return false;
 
        dr = buf->rect;
        
@@ -340,7 +340,7 @@ int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
        }
 
        IMB_freeImBuf(buf);
-       return 1;
+       return true;
        
 }
 
@@ -396,7 +396,7 @@ static unsigned int findnearestvert__backbufIndextest(void *handle, unsigned int
  *      if 0, unselected vertice are given the bias
  * strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased 
  */
-BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const short sel, const short strict)
+BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, const bool strict)
 {
        if (vc->v3d->drawtype > OB_WIRE && (vc->v3d->flag & V3D_ZBUF_SELECT)) {
                float distance;
@@ -436,7 +436,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const short sel,
                data.lastIndex = lastSelectedIndex;
                data.mval_fl[0] = vc->mval[0];
                data.mval_fl[1] = vc->mval[1];
-               data.select = sel;
+               data.select = sel ? BM_ELEM_SELECT : 0;
                data.dist = *r_dist;
                data.strict = strict;
                data.closest = NULL;
@@ -482,7 +482,7 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, const float
                        vec[1] = eed->v1->co[1] + lambda * (eed->v2->co[1] - eed->v1->co[1]);
                        vec[2] = eed->v1->co[2] + lambda * (eed->v2->co[2] - eed->v1->co[2]);
 
-                       if (ED_view3d_clipping_test(data->vc.rv3d, vec, TRUE) == 0) {
+                       if (ED_view3d_clipping_test(data->vc.rv3d, vec, true) == 0) {
                                data->dist = distance;
                                data->closest = eed;
                        }
@@ -729,14 +729,14 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -770,15 +770,15 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, true);
        EDBM_selectmode_flush(em);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -814,16 +814,16 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
        /* select the output */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, true);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
        EDBM_selectmode_flush(em);
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -976,9 +976,9 @@ void MESH_OT_select_mode(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
-       prop = RNA_def_boolean(ot->srna, "use_extend", FALSE, "Extend", "");
+       prop = RNA_def_boolean(ot->srna, "use_extend", false, "Extend", "");
        RNA_def_property_flag(prop, PROP_SKIP_SAVE);
-       prop = RNA_def_boolean(ot->srna, "use_expand", FALSE, "Expand", "");
+       prop = RNA_def_boolean(ot->srna, "use_expand", false, "Expand", "");
        RNA_def_property_flag(prop, PROP_SKIP_SAVE);
        ot->prop = prop = RNA_def_enum(ot->srna, "type", elem_items, 0, "Type", "");
        RNA_def_property_flag(prop, PROP_SKIP_SAVE);
@@ -990,7 +990,7 @@ void MESH_OT_select_mode(wmOperatorType *ot)
 
 /* ****************  LOOP SELECTS *************** */
 
-static void walker_select(BMEditMesh *em, int walkercode, void *start, int select)
+static void walker_select(BMEditMesh *em, int walkercode, void *start, const bool select)
 {
        BMesh *bm = em->bm;
        BMElem *ele;
@@ -1041,14 +1041,14 @@ static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
        if (looptype) {
                for (edindex = 0; edindex < totedgesel; edindex += 1) {
                        eed = edarray[edindex];
-                       walker_select(em, BMW_EDGERING, eed, TRUE);
+                       walker_select(em, BMW_EDGERING, eed, true);
                }
                EDBM_selectmode_flush(em);
        }
        else {
                for (edindex = 0; edindex < totedgesel; edindex += 1) {
                        eed = edarray[edindex];
-                       walker_select(em, BMW_LOOP, eed, TRUE);
+                       walker_select(em, BMW_LOOP, eed, true);
                }
                EDBM_selectmode_flush(em);
        }
@@ -1084,12 +1084,12 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
 
 /* ***************** loop select (non modal) ************** */
 
-static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short deselect, short toggle, short ring)
+static void mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool ring)
 {
        ViewContext vc;
        BMEditMesh *em;
        BMEdge *eed;
-       int select = TRUE;
+       bool select = true;
        float dist = 50.0f;
        float mvalf[2];
 
@@ -1103,21 +1103,21 @@ static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short
 
        eed = EDBM_edge_find_nearest(&vc, &dist);
        if (eed) {
-               if (extend == 0 && deselect == 0 && toggle == 0) {
+               if (extend == false && deselect == false && toggle == false) {
                        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
                }
        
                if (extend) {
-                       select = TRUE;
+                       select = true;
                }
                else if (deselect) {
-                       select = FALSE;
+                       select = false;
                }
                else if (BM_elem_flag_test(eed, BM_ELEM_SELECT) == 0) {
-                       select = TRUE;
+                       select = true;
                }
                else if (toggle) {
-                       select = FALSE;
+                       select = false;
                }
 
                if (em->selectmode & SCE_SELECT_FACE) {
@@ -1208,7 +1208,8 @@ static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *e
        
        view3d_operator_needs_opengl(C);
        
-       mouse_mesh_loop(C, event->mval, RNA_boolean_get(op->ptr, "extend"),
+       mouse_mesh_loop(C, event->mval,
+                       RNA_boolean_get(op->ptr, "extend"),
                        RNA_boolean_get(op->ptr, "deselect"),
                        RNA_boolean_get(op->ptr, "toggle"),
                        RNA_boolean_get(op->ptr, "ring"));
@@ -1341,15 +1342,15 @@ static int edgetag_context_check(Scene *scene, BMesh *bm, BMEdge *e)
 {
        switch (scene->toolsettings->edge_mode) {
                case EDGE_MODE_SELECT:
-                       return BM_elem_flag_test(e, BM_ELEM_SELECT) ? TRUE : FALSE;
+                       return BM_elem_flag_test(e, BM_ELEM_SELECT) ? true : false;
                case EDGE_MODE_TAG_SEAM:
                        return BM_elem_flag_test(e, BM_ELEM_SEAM);
                case EDGE_MODE_TAG_SHARP:
                        return !BM_elem_flag_test(e, BM_ELEM_SMOOTH);
                case EDGE_MODE_TAG_CREASE:
-                       return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? TRUE : FALSE;
+                       return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? true : false;
                case EDGE_MODE_TAG_BEVEL:
-                       return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? TRUE : FALSE;
+                       return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? true : false;
        }
        return 0;
 }
@@ -1386,7 +1387,7 @@ static int edgetag_shortest_path(Scene *scene, BMesh *bm, BMEdge *e_src, BMEdge
        edgetag_ensure_cd_flag(scene, OBACT->data);
 
        BM_ITER_MESH_INDEX (e, &eiter, bm, BM_EDGES_OF_MESH, i) {
-               if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE) {
+               if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == false) {
                        BM_elem_flag_disable(e, BM_ELEM_TAG);
                }
                else {
@@ -1435,14 +1436,14 @@ static int edgetag_shortest_path(Scene *scene, BMesh *bm, BMEdge *e_src, BMEdge
        }
        
        if (e == e_dst) {
-               short all_set = TRUE;
+               bool all_set = true;
 
                /* Check whether the path is already completely tagged.
                 * if it is, the tags will be cleared instead of set. */
                e = e_dst;
                do {
                        if (!edgetag_context_check(scene, bm, e)) {
-                               all_set = FALSE;
+                               all_set = false;
                                break;
                        }
                } while ((e = edges_prev[BM_elem_index_get(e)]));
@@ -1521,12 +1522,12 @@ static int mouse_mesh_shortest_path_edge(ViewContext *vc)
                                break;
                }
                
-               EDBM_update_generic(em, FALSE, FALSE);
+               EDBM_update_generic(em, false, false);
 
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
@@ -1603,7 +1604,7 @@ static int facetag_shortest_path(Scene *scene, BMesh *bm, BMFace *f_src, BMFace
        // BM_mesh_elem_index_ensure(bm, BM_VERT /* | BM_EDGE */); // NOT NEEDED FOR FACETAG
 
        BM_ITER_MESH_INDEX (f, &fiter, bm, BM_FACES_OF_MESH, i) {
-               if (BM_elem_flag_test(f, BM_ELEM_HIDDEN) == FALSE) {
+               if (BM_elem_flag_test(f, BM_ELEM_HIDDEN) == false) {
                        BM_elem_flag_disable(f, BM_ELEM_TAG);
                }
                else {
@@ -1652,14 +1653,14 @@ static int facetag_shortest_path(Scene *scene, BMesh *bm, BMFace *f_src, BMFace
        }
 
        if (f == f_dst) {
-               short all_set = TRUE;
+               bool all_set = true;
 
                /* Check whether the path is already completely tagged.
                 * if it is, the tags will be cleared instead of set. */
                f = f_dst;
                do {
                        if (!facetag_context_check(scene, bm, f)) {
-                               all_set = FALSE;
+                               all_set = false;
                                break;
                        }
                } while ((f = faces_prev[BM_elem_index_get(f)]));
@@ -1687,7 +1688,7 @@ static int mouse_mesh_shortest_path_face(ViewContext *vc)
        f_dst = EDBM_face_find_nearest(vc, &dist);
        if (f_dst) {
                int path = 0;
-               BMFace *f_act = BM_active_face_get(em->bm, FALSE, TRUE);
+               BMFace *f_act = BM_active_face_get(em->bm, false, true);
 
                if (f_act) {
                        if (f_act != f_dst) {
@@ -1712,12 +1713,12 @@ static int mouse_mesh_shortest_path_face(ViewContext *vc)
 
                BM_active_face_set(em->bm, f_dst);
 
-               EDBM_update_generic(em, FALSE, FALSE);
+               EDBM_update_generic(em, false, false);
 
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
@@ -1787,7 +1788,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
 /* ************************************************** */
 /* here actual select happens */
 /* gets called via generic mouse select operator */
-int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselect, short toggle)
+bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        ViewContext vc;
        BMVert *eve = NULL;
@@ -1802,7 +1803,7 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
        if (unified_findnearest(&vc, &eve, &eed, &efa)) {
 
                /* Deselect everything */
-               if (extend == 0 && deselect == 0 && toggle == 0)
+               if (extend == false && deselect == false && toggle == false)
                        EDBM_flag_disable_all(vc.em, BM_ELEM_SELECT);
 
                if (efa) {
@@ -1813,13 +1814,13 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
                                /* Work-around: deselect first, so we can guarantee it will */
                                /* be active even if it was already selected */
                                BM_select_history_remove(vc.em->bm, efa);
-                               BM_face_select_set(vc.em->bm, efa, FALSE);
+                               BM_face_select_set(vc.em->bm, efa, false);
                                BM_select_history_store(vc.em->bm, efa);
-                               BM_face_select_set(vc.em->bm, efa, TRUE);
+                               BM_face_select_set(vc.em->bm, efa, true);
                        }
                        else if (deselect) {
                                BM_select_history_remove(vc.em->bm, efa);
-                               BM_face_select_set(vc.em->bm, efa, FALSE);
+                               BM_face_select_set(vc.em->bm, efa, false);
                        }
                        else {
                                /* set the last selected face */
@@ -1827,11 +1828,11 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
 
                                if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                        BM_select_history_store(vc.em->bm, efa);
-                                       BM_face_select_set(vc.em->bm, efa, TRUE);
+                                       BM_face_select_set(vc.em->bm, efa, true);
                                }
                                else if (toggle) {
                                        BM_select_history_remove(vc.em->bm, efa);
-                                       BM_face_select_set(vc.em->bm, efa, FALSE);
+                                       BM_face_select_set(vc.em->bm, efa, false);
                                }
                        }
                }
@@ -1840,22 +1841,22 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
                                /* Work-around: deselect first, so we can guarantee it will */
                                /* be active even if it was already selected */
                                BM_select_history_remove(vc.em->bm, eed);
-                               BM_edge_select_set(vc.em->bm, eed, FALSE);
+                               BM_edge_select_set(vc.em->bm, eed, false);
                                BM_select_history_store(vc.em->bm, eed);
-                               BM_edge_select_set(vc.em->bm, eed, TRUE);
+                               BM_edge_select_set(vc.em->bm, eed, true);
                        }
                        else if (deselect) {
                                BM_select_history_remove(vc.em->bm, eed);
-                               BM_edge_select_set(vc.em->bm, eed, FALSE);
+                               BM_edge_select_set(vc.em->bm, eed, false);
                        }
                        else {
                                if (!BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
                                        BM_select_history_store(vc.em->bm, eed);
-                                       BM_edge_select_set(vc.em->bm, eed, TRUE);
+                                       BM_edge_select_set(vc.em->bm, eed, true);
                                }
                                else if (toggle) {
                                        BM_select_history_remove(vc.em->bm, eed);
-                                       BM_edge_select_set(vc.em->bm, eed, FALSE);
+                                       BM_edge_select_set(vc.em->bm, eed, false);
                                }
                        }
                }
@@ -1864,22 +1865,22 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
                                /* Work-around: deselect first, so we can guarantee it will */
                                /* be active even if it was already selected */
                                BM_select_history_remove(vc.em->bm, eve);
-                               BM_vert_select_set(vc.em->bm, eve, FALSE);
+                               BM_vert_select_set(vc.em->bm, eve, false);
                                BM_select_history_store(vc.em->bm, eve);
-                               BM_vert_select_set(vc.em->bm, eve, TRUE);
+                               BM_vert_select_set(vc.em->bm, eve, true);
                        }
                        else if (deselect) {
                                BM_select_history_remove(vc.em->bm, eve);
-                               BM_vert_select_set(vc.em->bm, eve, FALSE);
+                               BM_vert_select_set(vc.em->bm, eve, false);
                        }
                        else {
                                if (!BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
                                        BM_select_history_store(vc.em->bm, eve);
-                                       BM_vert_select_set(vc.em->bm, eve, TRUE);
+                                       BM_vert_select_set(vc.em->bm, eve, true);
                                }
                                else if (toggle) {
                                        BM_select_history_remove(vc.em->bm, eve);
-                                       BM_vert_select_set(vc.em->bm, eve, FALSE);
+                                       BM_vert_select_set(vc.em->bm, eve, false);
                                }
                        }
                }
@@ -1896,10 +1897,10 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
                }
 
                WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
-               return 1;
+               return true;
        }
 
-       return 0;
+       return false;
 }
 
 static void edbm_strip_selections(BMEditMesh *em)
@@ -1951,12 +1952,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
        else if (em->selectmode & SCE_SELECT_EDGE) {
                /* deselect vertices, and select again based on edge select */
                eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
-               for (; eve; eve = BM_iter_step(&iter)) BM_vert_select_set(em->bm, eve, FALSE);
+               for (; eve; eve = BM_iter_step(&iter)) BM_vert_select_set(em->bm, eve, false);
                
                eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
                for (; eed; eed = BM_iter_step(&iter)) {
                        if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
-                               BM_edge_select_set(em->bm, eed, TRUE);
+                               BM_edge_select_set(em->bm, eed, true);
                        }
                }
                
@@ -1966,12 +1967,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
        else if (em->selectmode & SCE_SELECT_FACE) {
                /* deselect eges, and select again based on face select */
                eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
-               for (; eed; eed = BM_iter_step(&iter)) BM_edge_select_set(em->bm, eed, FALSE);
+               for (; eed; eed = BM_iter_step(&iter)) BM_edge_select_set(em->bm, eed, false);
                
                efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
                for (; efa; efa = BM_iter_step(&iter)) {
                        if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
-                               BM_face_select_set(em->bm, efa, TRUE);
+                               BM_face_select_set(em->bm, efa, true);
                        }
                }
        }
@@ -1995,7 +1996,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
 
                        BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                                if (BM_elem_flag_test(eed, BM_ELEM_TAG)) {
-                                       BM_edge_select_set(em->bm, eed, TRUE);
+                                       BM_edge_select_set(em->bm, eed, true);
                                }
                        }
                }
@@ -2007,7 +2008,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
 
                        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                                if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
-                                       BM_face_select_set(em->bm, efa, TRUE);
+                                       BM_face_select_set(em->bm, efa, true);
                                }
                        }
                }
@@ -2021,7 +2022,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
 
                        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                                if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
-                                       BM_face_select_set(em->bm, efa, TRUE);
+                                       BM_face_select_set(em->bm, efa, true);
                                }
                        }
                }
@@ -2029,13 +2030,13 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
 }
 
 /* user facing function, does notification and undo push */
-int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
-                           const int action, const int use_extend, const int use_expand)
+bool EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
+                            const int action, const bool use_extend, const bool use_expand)
 {
        ToolSettings *ts = CTX_data_tool_settings(C);
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = NULL;
-       int ret = FALSE;
+       bool ret = false;
 
        if (obedit && obedit->type == OB_MESH) {
                em = BMEdit_FromObject(obedit);
@@ -2052,21 +2053,21 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
                case 0:  /* disable */
                        /* check we have something to do */
                        if ((em->selectmode & selectmode_new) == 0) {
-                               return FALSE;
+                               return false;
                        }
                        em->selectmode &= ~selectmode_new;
                        break;
                case 1:  /* enable */
                        /* check we have something to do */
                        if ((em->selectmode & selectmode_new) != 0) {
-                               return FALSE;
+                               return false;
                        }
                        em->selectmode |= selectmode_new;
                        break;
                case 2:  /* toggle */
                        /* can't disable this flag if its the only one set */
                        if (em->selectmode == selectmode_new) {
-                               return FALSE;
+                               return false;
                        }
                        em->selectmode ^= selectmode_new;
                        break;
@@ -2080,7 +2081,7 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
                                em->selectmode = SCE_SELECT_VERTEX;
                        ts->selectmode = em->selectmode;
                        EDBM_selectmode_set(em);
-                       ret = TRUE;
+                       ret = true;
                        break;
                case SCE_SELECT_EDGE:
                        if (use_extend == 0 || em->selectmode == 0) {
@@ -2094,7 +2095,7 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
                        }
                        ts->selectmode = em->selectmode;
                        EDBM_selectmode_set(em);
-                       ret = TRUE;
+                       ret = true;
                        break;
                case SCE_SELECT_FACE:
                        if (use_extend == 0 || em->selectmode == 0) {
@@ -2109,14 +2110,14 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
                        }
                        ts->selectmode = em->selectmode;
                        EDBM_selectmode_set(em);
-                       ret = TRUE;
+                       ret = true;
                        break;
                default:
                        BLI_assert(0);
                        break;
        }
 
-       if (ret == TRUE) {
+       if (ret == true) {
                WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
                WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL);
        }
@@ -2185,25 +2186,25 @@ int EDBM_select_interior_faces(BMEditMesh *em)
        BMIter eiter;
        BMFace *efa;
        BMEdge *eed;
-       int ok;
-       int change = FALSE;
+       bool ok;
+       bool change = false;
 
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
                        continue;
 
 
-               ok = TRUE;
+               ok = true;
                BM_ITER_ELEM (eed, &eiter, efa, BM_EDGES_OF_FACE) {
                        if (BM_edge_face_count(eed) < 3) {
-                               ok = FALSE;
+                               ok = false;
                                break;
                        }
                }
 
                if (ok) {
-                       BM_face_select_set(bm, efa, TRUE);
-                       change = TRUE;
+                       BM_face_select_set(bm, efa, true);
+                       change = true;
                }
        }
 
@@ -2216,9 +2217,9 @@ static void linked_limit_default(bContext *C, wmOperator *op)
                Object *obedit = CTX_data_edit_object(C);
                BMEditMesh *em = BMEdit_FromObject(obedit);
                if (em->selectmode == SCE_SELECT_FACE)
-                       RNA_boolean_set(op->ptr, "limit", TRUE);
+                       RNA_boolean_set(op->ptr, "limit", true);
                else
-                       RNA_boolean_set(op->ptr, "limit", FALSE);
+                       RNA_boolean_set(op->ptr, "limit", false);
        }
 }
 
@@ -2378,7 +2379,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                        if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
                                for (efa = BMW_begin(&walker, efa); efa; efa = BMW_step(&walker)) {
-                                       BM_face_select_set(bm, efa, TRUE);
+                                       BM_face_select_set(bm, efa, true);
                                }
                        }
                }
@@ -2560,7 +2561,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
                if (!BM_elem_flag_test(ele, BM_ELEM_TAG)) {
                        /* Deselect elements that aren't at "nth" depth from active */
                        if ((offset + BMW_current_depth(&walker)) % nth) {
-                               BM_elem_select_set(bm, ele, FALSE);
+                               BM_elem_select_set(bm, ele, false);
                        }
                        BM_elem_flag_enable(ele, BM_ELEM_TAG);
                }
@@ -2619,7 +2620,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
                }
        }
        else if (em->selectmode & SCE_SELECT_FACE) {
-               f = BM_active_face_get(em->bm, TRUE, FALSE);
+               f = BM_active_face_get(em->bm, true, false);
                if (f) {
                        *r_efa = f;
                        return;
@@ -2666,7 +2667,7 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        return OPERATOR_FINISHED;
 }
@@ -2723,14 +2724,14 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
        const float sharp = RNA_float_get(op->ptr, "sharpness");
 
        BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
-               if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE &&
+               if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == false &&
                    BM_edge_loop_pair(e, &l1, &l2))
                {
                        /* edge has exactly two neighboring faces, check angle */
                        const float angle = angle_normalized_v3v3(l1->f->no, l2->f->no);
 
                        if (fabsf(angle) > sharp) {
-                               BM_edge_select_set(em->bm, e, TRUE);
+                               BM_edge_select_set(em->bm, e, true);
                        }
                }
        }
@@ -2791,7 +2792,7 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
                        f = stack[i - 1];
                        i--;
 
-                       BM_face_select_set(em->bm, f, TRUE);
+                       BM_face_select_set(em->bm, f, true);
 
                        BM_elem_flag_enable(f, BM_ELEM_TAG);
 
@@ -2867,13 +2868,13 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
        
        BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(v)) {
-                       BM_vert_select_set(em->bm, v, TRUE);
+                       BM_vert_select_set(em->bm, v, true);
                }
        }
        
        BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && !BM_edge_is_manifold(e)) {
-                       BM_edge_select_set(em->bm, e, TRUE);
+                       BM_edge_select_set(em->bm, e, true);
                }
        }
 
@@ -2918,7 +2919,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        if (em->selectmode & SCE_SELECT_VERTEX) {
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_vert_select_set(em->bm, eve, TRUE);
+                               BM_vert_select_set(em->bm, eve, true);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -2926,7 +2927,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                        if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_edge_select_set(em->bm, eed, TRUE);
+                               BM_edge_select_set(em->bm, eed, true);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -2934,7 +2935,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        else {
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_face_select_set(em->bm, efa, TRUE);
+                               BM_face_select_set(em->bm, efa, true);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -3037,14 +3038,14 @@ static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))
                BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
                                BM_elem_flag_enable(l->next->v, BM_ELEM_TAG);
-                               BM_vert_select_set(em->bm, l->v, FALSE);
+                               BM_vert_select_set(em->bm, l->v, false);
                        }
                }
        }
 
        BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
-                       BM_vert_select_set(em->bm, v, TRUE);
+                       BM_vert_select_set(em->bm, v, true);
                }
        }
 
@@ -3076,7 +3077,7 @@ static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
        BMEdge *e;
        BMIter iter;
 
-       BM_mesh_elem_hflag_disable_all(em->bm, BM_EDGE, BM_ELEM_TAG, FALSE);
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_EDGE, BM_ELEM_TAG, false);
 
        BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
                BMLoop *l1, *l2;
@@ -3099,7 +3100,7 @@ static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
        
        BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
-                       BM_edge_select_set(em->bm, e, TRUE);
+                       BM_edge_select_set(em->bm, e, true);
                }
        }
 
@@ -3290,7 +3291,7 @@ static int edbm_loop_to_region_exec(bContext *C, wmOperator *op)
        
        BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
                if (BM_elem_flag_test(f, BM_ELEM_TAG) && !BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
-                       BM_face_select_set(em->bm, f, TRUE);
+                       BM_face_select_set(em->bm, f, true);
                }
        }
        
index e82176b058de54c22789eb9f7761c2b6fa7b38f0..3ea08366ecf93a8ec259d0faa0dc585beeaefbba 100644 (file)
@@ -111,10 +111,10 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
                           smooth, fractal, along_normal,
                           cuts,
                           SUBDIV_SELECT_ORIG, RNA_enum_get(op->ptr, "quadcorner"),
-                          RNA_boolean_get(op->ptr, "quadtri"), TRUE, FALSE,
+                          RNA_boolean_get(op->ptr, "quadtri"), true, false,
                           RNA_int_get(op->ptr, "seed"));
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -174,7 +174,7 @@ static int edbm_unsubdivide_exec(bContext *C, wmOperator *op)
 
        BMO_op_exec(em->bm, &bmop);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return 0;
        }
 
@@ -183,7 +183,7 @@ static int edbm_unsubdivide_exec(bContext *C, wmOperator *op)
        }
        EDBM_selectmode_flush(em);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -246,7 +246,7 @@ static short edbm_extrude_discrete_faces(BMEditMesh *em, wmOperator *op, const c
        BMO_op_exec(em->bm, &bmop);
        
        BMO_ITER (f, &siter, bmop.slots_out, "faces.out", BM_FACE) {
-               BM_face_select_set(em->bm, f, TRUE);
+               BM_face_select_set(em->bm, f, true);
 
                /* set face vertex normals to face normal */
                BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
@@ -254,7 +254,7 @@ static short edbm_extrude_discrete_faces(BMEditMesh *em, wmOperator *op, const c
                }
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return 0;
        }
 
@@ -272,9 +272,9 @@ static short edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
        BMO_op_exec(em->bm, &bmop);
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_VERT | BM_EDGE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_VERT | BM_EDGE, BM_ELEM_SELECT, true);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return 0;
        }
 
@@ -289,12 +289,12 @@ static short edbm_extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char
        EDBM_op_init(em, &bmop, op, "extrude_vert_indiv verts=%hv", hflag);
 
        /* deselect original verts */
-       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_in, "verts", BM_VERT, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_in, "verts", BM_VERT, BM_ELEM_SELECT, true);
 
        BMO_op_exec(em->bm, &bmop);
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, true);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return 0;
        }
 
@@ -383,7 +383,7 @@ static short edbm_extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
        zero_v3(nor);
        
        BMO_ITER (ele, &siter, extop.slots_out, "geom.out", BM_ALL) {
-               BM_elem_select_set(bm, ele, TRUE);
+               BM_elem_select_set(bm, ele, true);
 
                if (ele->head.htype == BM_FACE) {
                        f = (BMFace *)ele;
@@ -408,8 +408,8 @@ static short edbm_extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
        BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (BM_elem_flag_test(eed, hflag)) {
                        if (hflag & BM_ELEM_SELECT) {
-                               BM_vert_select_set(em->bm, eed->v1, TRUE);
-                               BM_vert_select_set(em->bm, eed->v2, TRUE);
+                               BM_vert_select_set(em->bm, eed->v1, true);
+                               BM_vert_select_set(em->bm, eed->v2, true);
                        }
 
                        BM_elem_flag_enable(eed->v1, hflag & ~BM_ELEM_SELECT);
@@ -418,7 +418,7 @@ static short edbm_extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
                else {
                        if (BM_elem_flag_test(eed->v1, hflag) && BM_elem_flag_test(eed->v2, hflag)) {
                                if (hflag & BM_ELEM_SELECT) {
-                                       BM_edge_select_set(em->bm, eed, TRUE);
+                                       BM_edge_select_set(em->bm, eed, true);
                                }
 
                                BM_elem_flag_enable(eed, hflag & ~BM_ELEM_SELECT);
@@ -462,7 +462,7 @@ static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
        
        EDBM_mesh_normals_update(em);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -584,7 +584,7 @@ static int edbm_extrude_region_exec(bContext *C, wmOperator *op)
         * done.*/
        EDBM_mesh_normals_update(em);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -615,7 +615,7 @@ static int edbm_extrude_verts_exec(bContext *C, wmOperator *op)
 
        edbm_extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
        
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -646,7 +646,7 @@ static int edbm_extrude_edges_exec(bContext *C, wmOperator *op)
 
        edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
        
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -677,7 +677,7 @@ static int edbm_extrude_faces_exec(bContext *C, wmOperator *op)
 
        edbm_extrude_discrete_faces(em, op, BM_ELEM_SELECT, nor);
        
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -783,8 +783,8 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
        BMVert *v1;
        BMIter iter;
        float min[3], max[3];
-       int done = FALSE;
-       short use_proj;
+       bool done = false;
+       bool use_proj;
        
        em_setup_viewcontext(C, &vc);
 
@@ -799,7 +799,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
        BM_ITER_MESH (v1, &iter, vc.em->bm, BM_VERTS_OF_MESH) {
                if (BM_elem_flag_test(v1, BM_ELEM_SELECT)) {
                        minmax_v3v3_v3(min, max, v1->co);
-                       done = TRUE;
+                       done = true;
                }
        }
 
@@ -815,7 +815,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
                                         (float)event->mval[1]};
 
                /* check for edges that are half selected, use for rotation */
-               done = FALSE;
+               done = false;
                BM_ITER_MESH (eed, &iter, vc.em->bm, BM_EDGES_OF_MESH) {
                        if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
                                float co1[2], co2[2];
@@ -836,7 +836,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
                                                nor[0] +=  (co2[1] - co1[1]);
                                                nor[1] += -(co2[0] - co1[0]);
                                        }
-                                       done = TRUE;
+                                       done = true;
                                }
                        }
                }
@@ -919,10 +919,10 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
                BMO_op_exec(vc.em->bm, &bmop);
 
                BMO_ITER (v1, &oiter, bmop.slots_out, "vert.out", BM_VERT) {
-                       BM_vert_select_set(vc.em->bm, v1, TRUE);
+                       BM_vert_select_set(vc.em->bm, v1, true);
                }
 
-               if (!EDBM_op_finish(vc.em, &bmop, op, TRUE)) {
+               if (!EDBM_op_finish(vc.em, &bmop, op, true)) {
                        return OPERATOR_CANCELLED;
                }
        }
@@ -935,7 +935,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
         * done. */
        EDBM_mesh_normals_update(vc.em);
 
-       EDBM_update_generic(vc.em, TRUE, TRUE);
+       EDBM_update_generic(vc.em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -1000,7 +1000,7 @@ static int edbm_delete_exec(bContext *C, wmOperator *op)
 
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -1033,7 +1033,7 @@ static int edbm_collapse_edge_exec(bContext *C, wmOperator *op)
        if (!EDBM_op_callf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -1061,7 +1061,7 @@ static int edbm_collapse_edge_loop_exec(bContext *C, wmOperator *op)
        if (!EDBM_op_callf(em, op, "dissolve_edge_loop edges=%he", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -1273,11 +1273,11 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
                BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, true);
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -1332,7 +1332,7 @@ static int edbm_mark_seam(bContext *C, wmOperator *op)
        }
 
        ED_uvedit_live_unwrap(scene, obedit);
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1386,7 +1386,7 @@ static int edbm_mark_sharp(bContext *C, wmOperator *op)
                }
        }
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1422,13 +1422,13 @@ static int edbm_vert_connect(bContext *C, wmOperator *op)
        }
        BMO_op_exec(bm, &bmop);
        len = BMO_slot_get(bmop.slots_out, "edges.out")->len;
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
        else {
                EDBM_selectmode_flush(em);  /* so newly created edges get the selection state from the vertex */
 
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
 
                return len ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
        }
@@ -1462,11 +1462,11 @@ static int edbm_edge_split_exec(bContext *C, wmOperator *op)
        }
        BMO_op_exec(bm, &bmop);
        len = BMO_slot_get(bmop.slots_out, "edges.out")->len;
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
        
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return len ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
 }
@@ -1499,13 +1499,13 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -1544,7 +1544,7 @@ static int edbm_flip_normals_exec(bContext *C, wmOperator *op)
        if (!EDBM_op_callf(em, op, "reverse_faces faces=%hf", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
        
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1565,8 +1565,8 @@ void MESH_OT_flip_normals(wmOperatorType *ot)
 }
 
 static const EnumPropertyItem direction_items[] = {
-       {FALSE, "CW", 0, "Clockwise", ""},
-       {TRUE, "CCW", 0, "Counter Clockwise", ""},
+       {false, "CW", 0, "Clockwise", ""},
+       {true, "CCW", 0, "Counter Clockwise", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
@@ -1613,19 +1613,19 @@ static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op)
 
        /* avoids leaving old verts selected which can be a problem running multiple times,
         * since this means the edges become selected around the face which then attempt to rotate */
-       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_in, "edges", BM_EDGE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_in, "edges", BM_EDGE, BM_ELEM_SELECT, true);
 
        BMO_op_exec(em->bm, &bmop);
        /* edges may rotate into hidden vertices, if this does _not_ run we get an ilogical state */
-       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_HIDDEN, TRUE);
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_HIDDEN, true);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, true);
        EDBM_selectmode_flush(em);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -1645,7 +1645,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* props */
-       RNA_def_boolean(ot->srna, "use_ccw", FALSE, "Counter Clockwise", "");
+       RNA_def_boolean(ot->srna, "use_ccw", false, "Counter Clockwise", "");
 }
 
 
@@ -1656,7 +1656,7 @@ static int edbm_hide_exec(bContext *C, wmOperator *op)
        
        EDBM_mesh_hide(em, RNA_boolean_get(op->ptr, "unselected"));
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1686,7 +1686,7 @@ static int edbm_reveal_exec(bContext *C, wmOperator *UNUSED(op))
        
        EDBM_mesh_reveal(em);
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1713,13 +1713,13 @@ static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op)
        
        /* doflip has to do with bmesh_rationalize_normals, it's an internal
         * thing */
-       if (!EDBM_op_callf(em, op, "recalc_face_normals faces=%hf use_flip=%b", BM_ELEM_SELECT, TRUE))
+       if (!EDBM_op_callf(em, op, "recalc_face_normals faces=%hf use_flip=%b", BM_ELEM_SELECT, true))
                return OPERATOR_CANCELLED;
 
        if (RNA_boolean_get(op->ptr, "inside"))
                EDBM_op_callf(em, op, "reverse_faces faces=%hf", BM_ELEM_SELECT);
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1748,7 +1748,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BMEdit_FromObject(obedit);
        ModifierData *md;
-       int mirrx = FALSE, mirry = FALSE, mirrz = FALSE;
+       int mirrx = false, mirry = false, mirrz = false;
        int i, repeat;
        float clip_dist = 0.0f;
 
@@ -1758,7 +1758,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
 
        /* mirror before smooth */
        if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
-               EDBM_verts_mirror_cache_begin(em, TRUE);
+               EDBM_verts_mirror_cache_begin(em, true);
        }
 
        /* if there is a mirror modifier with clipping, flag the verts that
@@ -1770,11 +1770,11 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
                
                        if (mmd->flag & MOD_MIR_CLIPPING) {
                                if (mmd->flag & MOD_MIR_AXIS_X)
-                                       mirrx = TRUE;
+                                       mirrx = true;
                                if (mmd->flag & MOD_MIR_AXIS_Y)
-                                       mirry = TRUE;
+                                       mirry = true;
                                if (mmd->flag & MOD_MIR_AXIS_Z)
-                                       mirrz = TRUE;
+                                       mirrz = true;
 
                                clip_dist = mmd->tolerance;
                        }
@@ -1801,7 +1801,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
                EDBM_verts_mirror_cache_end(em);
        }
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }      
@@ -1830,7 +1830,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BMEdit_FromObject(obedit);
-       int usex = TRUE, usey = TRUE, usez = TRUE, preserve_volume = TRUE;
+       int usex = true, usey = true, usez = true, preserve_volume = true;
        int i, repeat;
        float lambda_factor;
        float lambda_border;
@@ -1849,7 +1849,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
 
        /* mirror before smooth */
        if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
-               EDBM_verts_mirror_cache_begin(em, TRUE);
+               EDBM_verts_mirror_cache_begin(em, true);
        }
 
        repeat = RNA_int_get(op->ptr, "repeat");
@@ -1877,7 +1877,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
                EDBM_verts_mirror_cache_end(em);
        }
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1931,7 +1931,7 @@ static int edbm_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op))
 
        mesh_set_smooth_faces(em, 1);
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1958,7 +1958,7 @@ static int edbm_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op))
 
        mesh_set_smooth_faces(em, 0);
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        return OPERATOR_FINISHED;
 }
@@ -1997,11 +1997,11 @@ static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -2020,11 +2020,11 @@ static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -2046,12 +2046,12 @@ static int edbm_rotate_colors_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
        /* dependencies graph and notification stuff */
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -2071,11 +2071,11 @@ static int edbm_reverse_colors_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -2096,7 +2096,7 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* props */
-       RNA_def_boolean(ot->srna, "use_ccw", FALSE, "Counter Clockwise", "");
+       RNA_def_boolean(ot->srna, "use_ccw", false, "Counter Clockwise", "");
 }
 
 //void MESH_OT_uvs_mirror(wmOperatorType *ot)
@@ -2133,7 +2133,7 @@ void MESH_OT_colors_rotate(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* props */
-       RNA_def_boolean(ot->srna, "use_ccw", FALSE, "Counter Clockwise", "");
+       RNA_def_boolean(ot->srna, "use_ccw", false, "Counter Clockwise", "");
 }
 
 void MESH_OT_colors_reverse(wmOperatorType *ot)
@@ -2271,7 +2271,7 @@ static int edbm_merge_exec(bContext *C, wmOperator *op)
        if (!status)
                return OPERATOR_CANCELLED;
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -2365,7 +2365,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
                             BM_ELEM_SELECT, threshold);
                BMO_op_exec(em->bm, &bmop);
 
-               if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+               if (!EDBM_op_finish(em, &bmop, op, true)) {
                        return OPERATOR_CANCELLED;
                }
        }
@@ -2380,7 +2380,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
                        return OPERATOR_CANCELLED;
                }
 
-               if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+               if (!EDBM_op_finish(em, &bmop, op, true)) {
                        return OPERATOR_CANCELLED;
                }
        }
@@ -2388,7 +2388,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
        count = totvert_orig - em->bm->totvert;
        BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -2490,16 +2490,16 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
        /* EDBM_flag_disable_all(em, BM_ELEM_SELECT); */
 
        /* select the output */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, true);
 
        /* finish the operator */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
        EDBM_selectmode_flush(em);
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        /* we succeeded */
        return OPERATOR_FINISHED;
@@ -2574,7 +2574,7 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op)
 
        shape_propagate(em, op);
 
-       EDBM_update_generic(em, FALSE, FALSE);
+       EDBM_update_generic(em, false, false);
 
        return OPERATOR_FINISHED;
 }
@@ -2645,7 +2645,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op)
                }
        }
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -2752,15 +2752,15 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
                                switch (mode) {
                                        case -1: /* aligned */
                                                if (fabsf(ev->co[axis] - value) < limit)
-                                                       BM_vert_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, true);
                                                break;
                                        case 0: /* neg */
                                                if (ev->co[axis] > value)
-                                                       BM_vert_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, true);
                                                break;
                                        case 1: /* pos */
                                                if (ev->co[axis] < value)
-                                                       BM_vert_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, true);
                                                break;
                                }
                        }
@@ -2823,19 +2823,19 @@ static int edbm_solidify_exec(bContext *C, wmOperator *op)
        /* deselect only the faces in the region to be solidified (leave wire
         * edges and loose verts selected, as there will be no corresponding
         * geometry selected below) */
-       BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, true);
 
        /* run the solidify operator */
        BMO_op_exec(bm, &bmop);
 
        /* select the newly generated faces */
-       BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, true);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3118,7 +3118,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
        /* store percentage of edge cut for KNIFE_EXACT here.*/
        slot_edge_percents = BMO_slot_get(bmop.slots_in, "edge_percents");
        for (be = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); be; be = BM_iter_step(&iter)) {
-               int is_cut = FALSE;
+               bool is_cut = false;
                if (BM_elem_flag_test(be, BM_ELEM_SELECT)) {
                        const float *sco_a = screen_vert_coords[BM_elem_index_get(be->v1)];
                        const float *sco_b = screen_vert_coords[BM_elem_index_get(be->v2)];
@@ -3150,17 +3150,17 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
        BMO_slot_int_set(bmop.slots_in, "cuts", numcuts);
 
        BMO_slot_int_set(bmop.slots_in, "quad_corner_type", SUBD_STRAIGHT_CUT);
-       BMO_slot_bool_set(bmop.slots_in, "use_single_edge", FALSE);
-       BMO_slot_bool_set(bmop.slots_in, "use_grid_fill", FALSE);
+       BMO_slot_bool_set(bmop.slots_in, "use_single_edge", false);
+       BMO_slot_bool_set(bmop.slots_in, "use_grid_fill", false);
 
        BMO_slot_float_set(bmop.slots_in, "radius", 0);
        
        BMO_op_exec(bm, &bmop);
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3225,25 +3225,25 @@ static int mesh_separate_tagged(Main *bmain, Scene *scene, Base *base_old, BMesh
        /* deselect loose data - this used to get deleted,
         * we could de-select edges and verts only, but this turns out to be less complicated
         * since de-selecting all skips selection flushing logic */
-       BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
+       BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
 
-       BM_mesh_normals_update(bm_new, FALSE);
+       BM_mesh_normals_update(bm_new, false);
 
-       BM_mesh_bm_to_me(bm_new, base_new->object->data, FALSE);
+       BM_mesh_bm_to_me(bm_new, base_new->object->data, false);
 
        BM_mesh_free(bm_new);
        ((Mesh *)base_new->object->data)->edit_btmesh = NULL;
        
-       return TRUE;
+       return true;
 }
 
-static int mesh_separate_selected(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
+static bool mesh_separate_selected(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
 {
        /* we may have tags from previous operators */
-       BM_mesh_elem_hflag_disable_all(bm_old, BM_FACE | BM_EDGE | BM_VERT, BM_ELEM_TAG, FALSE);
+       BM_mesh_elem_hflag_disable_all(bm_old, BM_FACE | BM_EDGE | BM_VERT, BM_ELEM_TAG, false);
 
        /* sel -> tag */
-       BM_mesh_elem_hflag_enable_test(bm_old, BM_FACE | BM_EDGE | BM_VERT, BM_ELEM_TAG, TRUE, BM_ELEM_SELECT);
+       BM_mesh_elem_hflag_enable_test(bm_old, BM_FACE | BM_EDGE | BM_VERT, BM_ELEM_TAG, true, BM_ELEM_SELECT);
 
        return mesh_separate_tagged(bmain, scene, base_old, bm_old);
 }
@@ -3259,7 +3259,7 @@ static void bm_mesh_hflag_flush_vert(BMesh *bm, const char hflag)
        BMIter eiter;
        BMIter fiter;
 
-       int ok;
+       bool ok;
 
        BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) {
                if (BM_elem_flag_test(e->v1, hflag) &&
@@ -3272,11 +3272,11 @@ static void bm_mesh_hflag_flush_vert(BMesh *bm, const char hflag)
                }
        }
        BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-               ok = TRUE;
+               ok = true;
                l_iter = l_first = BM_FACE_FIRST_LOOP(f);
                do {
                        if (!BM_elem_flag_test(l_iter->v, hflag)) {
-                               ok = FALSE;
+                               ok = false;
                                break;
                        }
                } while ((l_iter = l_iter->next) != l_first);
@@ -3285,17 +3285,17 @@ static void bm_mesh_hflag_flush_vert(BMesh *bm, const char hflag)
        }
 }
 
-static int mesh_separate_material(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
+static bool mesh_separate_material(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
 {
        BMFace *f_cmp, *f;
        BMIter iter;
-       int result = FALSE;
+       bool result = false;
 
        while ((f_cmp = BM_iter_at_index(bm_old, BM_FACES_OF_MESH, NULL, 0))) {
                const short mat_nr = f_cmp->mat_nr;
                int tot = 0;
 
-               BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, FALSE);
+               BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false);
 
                BM_ITER_MESH (f, &iter, bm_old, BM_FACES_OF_MESH) {
                        if (f->mat_nr == mat_nr) {
@@ -3325,17 +3325,17 @@ static int mesh_separate_material(Main *bmain, Scene *scene, Base *base_old, BMe
        return result;
 }
 
-static int mesh_separate_loose(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
+static bool mesh_separate_loose(Main *bmain, Scene *scene, Base *base_old, BMesh *bm_old)
 {
        int i;
        BMEdge *e;
        BMVert *v_seed;
        BMWalker walker;
-       int result = FALSE;
+       bool result = false;
        int max_iter = bm_old->totvert;
 
        /* Clear all selected vertices */
-       BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, FALSE);
+       BM_mesh_elem_hflag_disable_all(bm_old, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false);
 
        /* A "while (true)" loop should work here as each iteration should
         * select and remove at least one vertex and when all vertices
@@ -3411,7 +3411,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
                else                BLI_assert(0);
 
                if (retval) {
-                       EDBM_update_generic(em, TRUE, TRUE);
+                       EDBM_update_generic(em, true, true);
                }
        }
        else {
@@ -3432,14 +3432,14 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
 
                                        bm_old = BM_mesh_create(&bm_mesh_allocsize_default);
 
-                                       BM_mesh_bm_from_me(bm_old, me, FALSE, 0);
+                                       BM_mesh_bm_from_me(bm_old, me, false, 0);
 
                                        if      (type == 1) retval_iter = mesh_separate_material(bmain, scene, base_iter, bm_old);
                                        else if (type == 2) retval_iter = mesh_separate_loose(bmain, scene, base_iter, bm_old);
                                        else                BLI_assert(0);
 
                                        if (retval_iter) {
-                                               BM_mesh_bm_to_me(bm_old, me, FALSE);
+                                               BM_mesh_bm_to_me(bm_old, me, false);
 
                                                DAG_id_tag_update(&me->id, OB_RECALC_DATA);
                                                WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
@@ -3509,13 +3509,13 @@ static int edbm_fill_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
        
        /* select new geometry */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_FACE | BM_EDGE, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_FACE | BM_EDGE, BM_ELEM_SELECT, true);
        
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 
@@ -3546,7 +3546,7 @@ static int edbm_beautify_fill_exec(bContext *C, wmOperator *op)
        if (!EDBM_op_callf(em, op, "beautify_fill faces=%hf edges=ae", BM_ELEM_SELECT))
                return OPERATOR_CANCELLED;
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
        
        return OPERATOR_FINISHED;
 }
@@ -3585,11 +3585,11 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op)
                              &bmop, "faces.out", &bmop, "edges.out");
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3630,7 +3630,7 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3686,7 +3686,7 @@ static int edbm_dissolve_exec(bContext *C, wmOperator *op)
                        return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3758,7 +3758,7 @@ static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3792,18 +3792,18 @@ static int edbm_split_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = BMEdit_FromObject(ob);
        BMOperator bmop;
 
-       EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, FALSE);
+       EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, false);
        BMO_op_exec(em->bm, &bmop);
-       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
        /* Geometry has changed, need to recalc normals and looptris */
        EDBM_mesh_normals_update(em);
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3857,12 +3857,12 @@ static int edbm_spin_exec(bContext *C, wmOperator *op)
        }
        BMO_op_exec(bm, &spinop);
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-       BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
-       if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
+       BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
+       if (!EDBM_op_finish(em, &spinop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -3975,18 +3975,18 @@ static int edbm_screw_exec(bContext *C, wmOperator *op)
 
        if (!EDBM_op_init(em, &spinop, op,
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f use_duplicate=%b",
-                         BM_ELEM_SELECT, cent, axis, dvec, turns * steps, DEG2RADF(360.0f * turns), FALSE))
+                         BM_ELEM_SELECT, cent, axis, dvec, turns * steps, DEG2RADF(360.0f * turns), false))
        {
                return OPERATOR_CANCELLED;
        }
        BMO_op_exec(bm, &spinop);
        EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-       BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
-       if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
+       BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
+       if (!EDBM_op_finish(em, &spinop, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
-       EDBM_update_generic(em, TRUE, TRUE);
+       EDBM_update_generic(em, true, true);
 
        return OPERATOR_FINISHED;
 }
@@ -4060,12 +4060,12 @@ static int edbm_select_face_by_sides_exec(bContext *C, wmOperator *op)
                                break;
                        default:
                                BLI_assert(0);
-                               select = FALSE;
+                               select = false;
                                break;
                }
 
                if (select) {
-                       BM_face_select_set(em->bm, efa, TRUE);
+                       BM_face_select_set(em->bm, efa, true);
                }
        }
 
@@ -4100,7 +4100,7 @@ void MESH_OT_select_face_by_sides(wmOperatorType *ot)
        /* properties */
        RNA_def_int(ot->srna, "number", 4, 3, INT_MAX, "Number of Vertices", "", 3, INT_MAX);
        RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Type of comparison to make");
-       RNA_def_boolean(ot->srna, "extend", TRUE, "Extend", "Extend the selection");
+       RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend the selection");
 }
 
 static int edbm_select_loose_verts_exec(bContext *C, wmOperator *op)
@@ -4116,13 +4116,13 @@ static int edbm_select_loose_verts_exec(bContext *C, wmOperator *op)
 
        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (!eve->e) {
-                       BM_vert_select_set(em->bm, eve, TRUE);
+                       BM_vert_select_set(em->bm, eve, true);
                }
        }
 
        BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (!eed->l) {
-                       BM_edge_select_set(em->bm, eed, TRUE);
+                       BM_edge_select_set(em->bm, eed, true);
                }
        }
 
@@ -4154,7 +4154,7 @@ static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BMEdit_FromObject(obedit);
-       int extend = RNA_boolean_get(op->ptr, "extend");
+       bool extend = RNA_boolean_get(op->ptr, "extend");
 
        if (em->bm->totvert && em->bm->totvertsel) {
                EDBM_select_mirrored(obedit, em, extend);
@@ -4258,12 +4258,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                        float co[3];
                                        mul_v3_m4v3(co, mat, ve->co);
 
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[0]].org_idx = i;
                                        sb[affected[0]++].srt = co[coidx] * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4278,12 +4278,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                        mid_v3_v3v3(co, ed->v1->co, ed->v2->co);
                                        mul_m4_v3(mat, co);
 
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[1]].org_idx = i;
                                        sb[affected[1]++].srt = co[coidx] * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4298,12 +4298,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                        BM_face_calc_center_mean(fa, co);
                                        mul_m4_v3(mat, co);
 
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[2]].org_idx = i;
                                        sb[affected[2]++].srt = co[coidx] * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4327,12 +4327,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
                                if (BM_elem_flag_test(ve, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[0]].org_idx = i;
                                        sb[affected[0]++].srt = len_squared_v3v3(cur, ve->co) * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4346,12 +4346,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                        float co[3];
                                        mid_v3_v3v3(co, ed->v1->co, ed->v2->co);
 
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[1]].org_idx = i;
                                        sb[affected[1]++].srt = len_squared_v3v3(cur, co) * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4365,12 +4365,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                        float co[3];
                                        BM_face_calc_center_mean(fa, co);
 
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[2]].org_idx = i;
                                        sb[affected[2]++].srt = len_squared_v3v3(cur, co) * fact;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4386,14 +4386,14 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                                /* Reverse materials' order, not order of faces inside each mat! */
                                /* Note: cannot use totcol, as mat_nr may sometimes be greater... */
                                float srt = reverse ? (float)(MAXMAT - fa->mat_nr) : (float)fa->mat_nr;
-                               pb[i] = FALSE;
+                               pb[i] = false;
                                sb[affected[2]].org_idx = i;
                                /* Multiplying with totface and adding i ensures us we keep current order for all faces of same mat. */
                                sb[affected[2]++].srt = srt * ((float)totelem[2]) + ((float)i);
 /*                             printf("e: %d; srt: %f; final: %f\n", i, srt, srt * ((float)totface) + ((float)i));*/
                        }
                        else {
-                               pb[i] = TRUE;
+                               pb[i] = true;
                        }
                }
        }
@@ -4487,12 +4487,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
                                if (BM_elem_flag_test(ve, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[0]].org_idx = i;
                                        sb[affected[0]++].srt = BLI_frand();
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4504,12 +4504,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
                                if (BM_elem_flag_test(ed, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[1]].org_idx = i;
                                        sb[affected[1]++].srt = BLI_frand();
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4521,12 +4521,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
                                if (BM_elem_flag_test(fa, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[2]].org_idx = i;
                                        sb[affected[2]++].srt = BLI_frand();
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4539,12 +4539,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (ve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
                                if (BM_elem_flag_test(ve, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[0]].org_idx = i;
                                        sb[affected[0]++].srt = (float)-i;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4555,12 +4555,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (ed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
                                if (BM_elem_flag_test(ed, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[1]].org_idx = i;
                                        sb[affected[1]++].srt = (float)-i;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4571,12 +4571,12 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
 
                        BM_ITER_MESH_INDEX (fa, &iter, em->bm, BM_FACES_OF_MESH, i) {
                                if (BM_elem_flag_test(fa, flag)) {
-                                       pb[i] = FALSE;
+                                       pb[i] = false;
                                        sb[affected[2]].org_idx = i;
                                        sb[affected[2]++].srt = (float)-i;
                                }
                                else {
-                                       pb[i] = TRUE;
+                                       pb[i] = true;
                                }
                        }
                }
@@ -4679,7 +4679,7 @@ static int edbm_sort_elements_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int edbm_sort_elements_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
+static bool edbm_sort_elements_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
 {
        const char *prop_id = RNA_property_identifier(prop);
        int action = RNA_enum_get(ptr, "type");
@@ -4687,20 +4687,20 @@ static int edbm_sort_elements_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop
        /* Only show seed for randomize action! */
        if (STREQ(prop_id, "seed")) {
                if (action == SRT_RANDOMIZE)
-                       return TRUE;
+                       return true;
                else
-                       return FALSE;
+                       return false;
        }
 
        /* Hide seed for reverse and randomize actions! */
        if (STREQ(prop_id, "reverse")) {
                if (ELEM(action, SRT_RANDOMIZE, SRT_REVERSE))
-                       return FALSE;
+                       return false;
                else
-                       return TRUE;
+                       return true;
        }
 
-       return TRUE;
+       return true;
 }
 
 static void edbm_sort_elements_ui(bContext *C, wmOperator *op)
@@ -4759,7 +4759,7 @@ void MESH_OT_sort_elements(wmOperatorType *ot)
        ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Type of re-ordering operation to apply");
        RNA_def_enum_flag(ot->srna, "elements", elem_items, 0, "Elements",
                          "Which elements to affect (vertices, edges and/or faces)");
-       RNA_def_boolean(ot->srna, "reverse", FALSE, "Reverse", "Reverse the sorting effect");
+       RNA_def_boolean(ot->srna, "reverse", false, "Reverse", "Reverse the sorting effect");
        RNA_def_int(ot->srna, "seed", 0, 0, INT_MAX, "Seed", "Seed for random-based operations", 0, 255);
 }
 
@@ -4813,7 +4813,7 @@ static int edbm_noise_exec(bContext *C, wmOperator *op)
 
        EDBM_mesh_normals_update(em);
 
-       EDBM_update_generic(em, TRUE, FALSE);
+       EDBM_update_generic(em, true, false);
 
        return OPERATOR_FINISHED;
 }
@@ -4904,7 +4904,7 @@ static int edbm_bevel_calc(wmOperator *op)
 
        /* revert to original mesh */
        if (opdata->is_modal) {
-               EDBM_redo_state_restore(opdata->mesh_backup, em, FALSE);
+               EDBM_redo_state_restore(opdata->mesh_backup, em, false);
        }
 
        if (!EDBM_op_init(em, &bmop, op,
@@ -4920,16 +4920,16 @@ static int edbm_bevel_calc(wmOperator *op)
                /* not essential, but we may have some loose geometry that
                 * won't get bevel'd and better not leave it selected */
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
        }
 
        /* no need to de-select existing geometry */
-       if (!EDBM_op_finish(em, &bmop, op, TRUE))
+       if (!EDBM_op_finish(em, &bmop, op, true))
                return 0;
        
        EDBM_mesh_normals_update(opdata->em);
        
-       EDBM_update_generic(opdata->em, TRUE, TRUE);
+       EDBM_update_generic(opdata->em, true, true);
 
        return 1;
 }
@@ -4945,7 +4945,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
        }
 
        if (opdata->is_modal) {
-               EDBM_redo_state_free(&opdata->mesh_backup, NULL, FALSE);
+               EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
        }
        MEM_freeN(opdata);
        op->customdata = NULL;
@@ -4955,8 +4955,8 @@ static int edbm_bevel_cancel(bContext *C, wmOperator *op)
 {
        BevelData *opdata = op->customdata;
        if (opdata->is_modal) {
-               EDBM_redo_state_free(&opdata->mesh_backup, opdata->em, TRUE);
-               EDBM_update_generic(opdata->em, FALSE, TRUE);
+               EDBM_redo_state_free(&opdata->mesh_backup, opdata->em, true);
+               EDBM_update_generic(opdata->em, false, true);
        }
 
        edbm_bevel_exit(C, op);
@@ -4969,7 +4969,7 @@ static int edbm_bevel_cancel(bContext *C, wmOperator *op)
 /* bevel! yay!!*/
 static int edbm_bevel_exec(bContext *C, wmOperator *op)
 {
-       if (!edbm_bevel_init(C, op, FALSE)) {
+       if (!edbm_bevel_init(C, op, false)) {
                edbm_bevel_exit(C, op);
                return OPERATOR_CANCELLED;
        }
@@ -4992,7 +4992,7 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        float mlen[2];
        float center_3d[3];
 
-       if (!edbm_bevel_init(C, op, TRUE)) {
+       if (!edbm_bevel_init(C, op, true)) {
                return OPERATOR_CANCELLED;
        }
 
@@ -5024,7 +5024,7 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 static float edbm_bevel_mval_factor(wmOperator *op, const wmEvent *event)
 {
        BevelData *opdata = op->customdata;
-       int use_dist = TRUE;
+       int use_dist = true;
        float mdiff[2];
        float factor;
 
@@ -5146,7 +5146,7 @@ void MESH_OT_bevel(wmOperatorType *ot)
 
        RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Offset", "", 0.0f, 1.0f);
        RNA_def_int(ot->srna, "segments", 1, 1, 50, "Segments", "Segments for curved edge", 1, 8);
-       RNA_def_boolean(ot->srna, "vertex_only", FALSE, "Vertex only", "Bevel only vertices");
+       RNA_def_boolean(ot->srna, "vertex_only", false, "Vertex only", "Bevel only vertices");
 }
 
 static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op)
@@ -5164,17 +5164,17 @@ static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        /* when merge is used the edges are joined and remain selected */
-       if (use_merge == FALSE) {
+       if (use_merge == false) {
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
 
        }
        else {
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
                return OPERATOR_FINISHED;
        }
 }
@@ -5195,7 +5195,7 @@ void MESH_OT_bridge_edge_loops(wmOperatorType *ot)
        
        RNA_def_boolean(ot->srna, "inside", 0, "Inside", "");
 
-       RNA_def_boolean(ot->srna, "use_merge", FALSE, "Merge", "Merge rather than creating faces");
+       RNA_def_boolean(ot->srna, "use_merge", false, "Merge", "Merge rather than creating faces");
        RNA_def_float(ot->srna, "merge_factor", 0.5f, 0.0f, 1.0f, "Merge Factor", "", 0.0f, 1.0f);
 }
 
@@ -5255,8 +5255,8 @@ static int edbm_inset_init(bContext *C, wmOperator *op, int is_modal)
 
        opdata->old_thickness = 0.01;
        opdata->old_depth = 0.0;
-       opdata->modify_depth = FALSE;
-       opdata->shift = FALSE;
+       opdata->modify_depth = false;
+       opdata->shift = false;
        opdata->shift_amount = 0.0f;
        opdata->is_modal = is_modal;
        opdata->em = em;
@@ -5278,7 +5278,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
        opdata = op->customdata;
 
        if (opdata->is_modal)
-               EDBM_redo_state_free(&opdata->backup, NULL, FALSE);
+               EDBM_redo_state_free(&opdata->backup, NULL, false);
 
        if (sa) {
                ED_area_headerprint(sa, NULL);
@@ -5292,8 +5292,8 @@ static int edbm_inset_cancel(bContext *C, wmOperator *op)
 
        opdata = op->customdata;
        if (opdata->is_modal) {
-               EDBM_redo_state_free(&opdata->backup, opdata->em, TRUE);
-               EDBM_update_generic(opdata->em, FALSE, TRUE);
+               EDBM_redo_state_free(&opdata->backup, opdata->em, true);
+               EDBM_update_generic(opdata->em, false, true);
        }
 
        edbm_inset_exit(C, op);
@@ -5321,7 +5321,7 @@ static int edbm_inset_calc(wmOperator *op)
        em = opdata->em;
 
        if (opdata->is_modal) {
-               EDBM_redo_state_restore(opdata->backup, em, FALSE);
+               EDBM_redo_state_restore(opdata->backup, em, false);
        }
 
        EDBM_op_init(em, &bmop, op,
@@ -5335,27 +5335,27 @@ static int edbm_inset_calc(wmOperator *op)
        if (use_select_inset) {
                /* deselect original faces/verts */
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
        }
        else {
-               BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE, BM_ELEM_SELECT, FALSE);
-               BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, FALSE);
+               BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE, BM_ELEM_SELECT, false);
+               BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, false);
                /* re-select faces so the verts and edges get selected too */
-               BM_mesh_elem_hflag_enable_test(em->bm, BM_FACE, BM_ELEM_SELECT, TRUE, BM_ELEM_SELECT);
+               BM_mesh_elem_hflag_enable_test(em->bm, BM_FACE, BM_ELEM_SELECT, true, BM_ELEM_SELECT);
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return 0;
        }
        else {
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
                return 1;
        }
 }
 
 static int edbm_inset_exec(bContext *C, wmOperator *op)
 {
-       edbm_inset_init(C, op, FALSE);
+       edbm_inset_init(C, op, false);
 
        if (!edbm_inset_calc(op)) {
                edbm_inset_exit(C, op);
@@ -5373,7 +5373,7 @@ static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        float mlen[2];
        float center_3d[3];
 
-       edbm_inset_init(C, op, TRUE);
+       edbm_inset_init(C, op, true);
 
        opdata = op->customdata;
 
@@ -5475,11 +5475,11 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                        opdata->shift_amount = RNA_float_get(op->ptr, "depth");
                                else
                                        opdata->shift_amount = RNA_float_get(op->ptr, "thickness");
-                               opdata->shift = TRUE;
+                               opdata->shift = true;
                        }
                        else {
                                opdata->shift_amount = 0.0f;
-                               opdata->shift = FALSE;
+                               opdata->shift = false;
                        }
                        break;
 
@@ -5495,13 +5495,13 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                opdata->old_thickness = RNA_float_get(op->ptr, "thickness");
                                if (opdata->shift)
                                        opdata->shift_amount = opdata->old_thickness;
-                               opdata->modify_depth = TRUE;
+                               opdata->modify_depth = true;
                        }
                        else {
                                opdata->old_depth = RNA_float_get(op->ptr, "depth");
                                if (opdata->shift)
                                        opdata->shift_amount = opdata->old_depth;
-                               opdata->modify_depth = FALSE;
+                               opdata->modify_depth = false;
                        }
                        opdata->initial_length = len_v2(mlen);
 
@@ -5561,9 +5561,9 @@ void MESH_OT_inset(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_GRAB_POINTER | OPTYPE_BLOCKING;
 
        /* properties */
-       RNA_def_boolean(ot->srna, "use_boundary",        TRUE, "Boundary",  "Inset face boundaries");
-       RNA_def_boolean(ot->srna, "use_even_offset",     TRUE, "Offset Even",      "Scale the offset to give more even thickness");
-       RNA_def_boolean(ot->srna, "use_relative_offset", FALSE, "Offset Relative", "Scale the offset by surrounding geometry");
+       RNA_def_boolean(ot->srna, "use_boundary",        true, "Boundary",  "Inset face boundaries");
+       RNA_def_boolean(ot->srna, "use_even_offset",     true, "Offset Even",      "Scale the offset to give more even thickness");
+       RNA_def_boolean(ot->srna, "use_relative_offset", false, "Offset Relative", "Scale the offset by surrounding geometry");
 
        prop = RNA_def_float(ot->srna, "thickness", 0.01f, 0.0f, FLT_MAX, "Thickness", "", 0.0f, 10.0f);
        /* use 1 rather then 10 for max else dragging the button moves too far */
@@ -5571,8 +5571,8 @@ void MESH_OT_inset(wmOperatorType *ot)
        prop = RNA_def_float(ot->srna, "depth", 0.0f, -FLT_MAX, FLT_MAX, "Depth", "", -10.0f, 10.0f);
        RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.01, 4);
 
-       RNA_def_boolean(ot->srna, "use_outset", FALSE, "Outset", "Outset rather than inset");
-       RNA_def_boolean(ot->srna, "use_select_inset", TRUE, "Select Outer", "Select the new inset faces");
+       RNA_def_boolean(ot->srna, "use_outset", false, "Outset", "Outset rather than inset");
+       RNA_def_boolean(ot->srna, "use_select_inset", true, "Select Outer", "Select the new inset faces");
 }
 
 static int edbm_wireframe_exec(bContext *C, wmOperator *op)
@@ -5596,22 +5596,22 @@ static int edbm_wireframe_exec(bContext *C, wmOperator *op)
        BMO_op_exec(em->bm, &bmop);
 
        if (use_replace) {
-               BM_mesh_elem_hflag_disable_all(em->bm, BM_FACE, BM_ELEM_TAG, FALSE);
-               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_in, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+               BM_mesh_elem_hflag_disable_all(em->bm, BM_FACE, BM_ELEM_TAG, false);
+               BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_in, "faces", BM_FACE, BM_ELEM_TAG, false);
 
                BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
                             "delete geom=%hvef context=%i",
                             BM_ELEM_TAG, DEL_FACES);
        }
 
-       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
        else {
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
                return OPERATOR_FINISHED;
        }
 }
@@ -5633,17 +5633,17 @@ void MESH_OT_wireframe(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
-       RNA_def_boolean(ot->srna, "use_boundary",        TRUE,  "Boundary",        "Inset face boundaries");
-       RNA_def_boolean(ot->srna, "use_even_offset",     TRUE,  "Offset Even",     "Scale the offset to give more even thickness");
-       RNA_def_boolean(ot->srna, "use_relative_offset", FALSE, "Offset Relative", "Scale the offset by surrounding geometry");
-       RNA_def_boolean(ot->srna, "use_crease",          FALSE, "Crease",          "Crease hub edges for improved subsurf");
+       RNA_def_boolean(ot->srna, "use_boundary",        true,  "Boundary",        "Inset face boundaries");
+       RNA_def_boolean(ot->srna, "use_even_offset",     true,  "Offset Even",     "Scale the offset to give more even thickness");
+       RNA_def_boolean(ot->srna, "use_relative_offset", false, "Offset Relative", "Scale the offset by surrounding geometry");
+       RNA_def_boolean(ot->srna, "use_crease",          false, "Crease",          "Crease hub edges for improved subsurf");
 
        prop = RNA_def_float(ot->srna, "thickness", 0.01f, 0.0f, FLT_MAX, "Thickness", "", 0.0f, 10.0f);
        /* use 1 rather then 10 for max else dragging the button moves too far */
        RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
 
 
-       RNA_def_boolean(ot->srna, "use_replace",         TRUE, "Replace", "Remove original faces");
+       RNA_def_boolean(ot->srna, "use_replace",         true, "Replace", "Remove original faces");
 }
 
 #ifdef WITH_BULLET
@@ -5661,7 +5661,7 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
 
        /* Hull fails if input is coplanar */
        if (BMO_error_occurred(em->bm)) {
-               EDBM_op_finish(em, &bmop, op, TRUE);
+               EDBM_op_finish(em, &bmop, op, true);
                return OPERATOR_CANCELLED;
        }
 
@@ -5671,7 +5671,7 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
                if (!EDBM_op_callf(em, op, "delete geom=%S context=%i",
                                   &bmop, "geom_unused.out", DEL_ONLYTAGGED))
                {
-                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       EDBM_op_finish(em, &bmop, op, true);
                        return OPERATOR_CANCELLED;
                }
        }
@@ -5681,7 +5681,7 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
                if (!EDBM_op_callf(em, op, "delete geom=%S context=%i",
                                   &bmop, "geom_holes.out", DEL_ONLYTAGGED))
                {
-                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       EDBM_op_finish(em, &bmop, op, true);
                        return OPERATOR_CANCELLED;
                }
        }
@@ -5692,16 +5692,16 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
                                   &bmop, "geom.out",
                                   RNA_float_get(op->ptr, "limit")))
                {
-                       EDBM_op_finish(em, &bmop, op, TRUE);
+                       EDBM_op_finish(em, &bmop, op, true);
                        return OPERATOR_CANCELLED;
                }
        }
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
        else {
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
                EDBM_selectmode_flush(em);
                return OPERATOR_FINISHED;
        }
@@ -5722,19 +5722,19 @@ void MESH_OT_convex_hull(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* props */
-       RNA_def_boolean(ot->srna, "delete_unused", TRUE,
+       RNA_def_boolean(ot->srna, "delete_unused", true,
                        "Delete Unused",
                        "Delete selected elements that are not used by the hull");
 
-       RNA_def_boolean(ot->srna, "use_existing_faces", TRUE,
+       RNA_def_boolean(ot->srna, "use_existing_faces", true,
                        "Use Existing Faces",
                        "Skip hull triangles that are covered by a pre-existing face");
 
-       RNA_def_boolean(ot->srna, "make_holes", FALSE,
+       RNA_def_boolean(ot->srna, "make_holes", false,
                        "Make Holes",
                        "Delete selected faces that are used by the hull");
 
-       RNA_def_boolean(ot->srna, "join_triangles", TRUE,
+       RNA_def_boolean(ot->srna, "join_triangles", true,
                        "Join Triangles",
                        "Merge adjacent triangles into quads");
 
@@ -5752,11 +5752,11 @@ static int mesh_symmetrize_exec(bContext *C, wmOperator *op)
                     BM_ELEM_SELECT, RNA_enum_get(op->ptr, "direction"));
        BMO_op_exec(em->bm, &bmop);
 
-       if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+       if (!EDBM_op_finish(em, &bmop, op, true)) {
                return OPERATOR_CANCELLED;
        }
        else {
-               EDBM_update_generic(em, TRUE, TRUE);
+               EDBM_update_generic(em, true, true);
                EDBM_selectmode_flush(em);
                return OPERATOR_FINISHED;
        }
index fd90246f791b052e569ad19fd06dbdb058bfb1c9..cb15fdef88042ee6f42efddf5feedacbdf5cb5c5 100644 (file)
@@ -114,7 +114,7 @@ void EDBM_mesh_ensure_valid_dm_hack(Scene *scene, BMEditMesh *em)
 
 void EDBM_mesh_normals_update(BMEditMesh *em)
 {
-       BM_mesh_normals_update(em->bm, TRUE);
+       BM_mesh_normals_update(em->bm, true);
 }
 
 void EDBM_mesh_clear(BMEditMesh *em)
@@ -169,7 +169,7 @@ void EDBM_stats_update(BMEditMesh *em)
        }
 }
 
-int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
+bool EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
 {
        BMesh *bm = em->bm;
        va_list list;
@@ -179,7 +179,7 @@ int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
        if (!BMO_op_vinitf(bm, bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
-               return 0;
+               return false;
        }
        
        if (!em->emcopy)
@@ -188,12 +188,12 @@ int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
 
        va_end(list);
 
-       return 1;
+       return true;
 }
 
 
 /* returns 0 on error, 1 on success.  executes and finishes a bmesh operator */
-int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int report)
+bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool do_report)
 {
        const char *errmsg;
        
@@ -202,7 +202,7 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
        if (BMO_error_get(em->bm, &errmsg, NULL)) {
                BMEditMesh *emcopy = em->emcopy;
 
-               if (report) {
+               if (do_report) {
                        BKE_report(op->reports, RPT_ERROR, errmsg);
                }
 
@@ -219,7 +219,7 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
                        BMEdit_RecalcTessellation(em);
                }
 
-               return FALSE;
+               return false;
        }
        else {
                em->emcopyusers--;
@@ -233,11 +233,11 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
                        em->emcopy = NULL;
                }
 
-               return TRUE;
+               return true;
        }
 }
 
-int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
+bool EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
 {
        BMesh *bm = em->bm;
        BMOperator bmop;
@@ -248,7 +248,7 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
        if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
-               return 0;
+               return false;
        }
 
        if (!em->emcopy)
@@ -258,10 +258,10 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
        BMO_op_exec(bm, &bmop);
 
        va_end(list);
-       return EDBM_op_finish(em, &bmop, op, TRUE);
+       return EDBM_op_finish(em, &bmop, op, true);
 }
 
-int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const char *fmt, ...)
+bool EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const char *fmt, ...)
 {
        BMOpSlot *slot_select_out;
        BMesh *bm = em->bm;
@@ -274,7 +274,7 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_
        if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
-               return 0;
+               return false;
        }
 
        if (!em->emcopy)
@@ -286,15 +286,15 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_
        slot_select_out = BMO_slot_get(bmop.slots_out, select_slot_out);
        hflag = slot_select_out->slot_subtype.elem & BM_ALL_NOLOOP;
 
-       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
 
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, hflag, BM_ELEM_SELECT, TRUE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, hflag, BM_ELEM_SELECT, true);
 
        va_end(list);
-       return EDBM_op_finish(em, &bmop, op, TRUE);
+       return EDBM_op_finish(em, &bmop, op, true);
 }
 
-int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
+bool EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
 {
        BMesh *bm = em->bm;
        BMOperator bmop;
@@ -304,7 +304,7 @@ int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
 
        if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                va_end(list);
-               return 0;
+               return false;
        }
 
        if (!em->emcopy)
@@ -314,7 +314,7 @@ int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
        BMO_op_exec(bm, &bmop);
 
        va_end(list);
-       return EDBM_op_finish(em, &bmop, NULL, FALSE);
+       return EDBM_op_finish(em, &bmop, NULL, false);
 }
 
 void EDBM_selectmode_to_scene(bContext *C)
@@ -352,9 +352,9 @@ void EDBM_mesh_make(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
        /* currently executing operators re-tessellates, so we can avoid doing here
         * but at some point it may need to be added back. */
 #if 0
-       me->edit_btmesh = BMEdit_Create(bm, TRUE);
+       me->edit_btmesh = BMEdit_Create(bm, true);
 #else
-       me->edit_btmesh = BMEdit_Create(bm, FALSE);
+       me->edit_btmesh = BMEdit_Create(bm, false);
 #endif
 
        me->edit_btmesh->selectmode = me->edit_btmesh->bm->selectmode = ts->selectmode;
@@ -368,7 +368,7 @@ void EDBM_mesh_load(Object *ob)
        Mesh *me = ob->data;
        BMesh *bm = me->edit_btmesh->bm;
 
-       BM_mesh_bm_to_me(bm, me, FALSE);
+       BM_mesh_bm_to_me(bm, me, false);
 
 #ifdef USE_TESSFACE_DEFAULT
        BKE_mesh_tessface_calc(me);
@@ -400,7 +400,7 @@ void EDBM_index_arrays_ensure(BMEditMesh *em, const char htype)
        BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
 
        /* in debug mode double check we didn't need to recalculate */
-       BLI_assert(EDBM_index_arrays_check(em) == TRUE);
+       BLI_assert(EDBM_index_arrays_check(em) == true);
 
        if (htype_needed & BM_VERT) {
                em->vert_index = MEM_mallocN(sizeof(void **) * em->bm->totvert, "em->vert_index");
@@ -465,7 +465,7 @@ void EDBM_index_arrays_free(BMEditMesh *em)
 
 /* debug check only - no need to optimize */
 #ifndef NDEBUG
-int EDBM_index_arrays_check(BMEditMesh *em)
+bool EDBM_index_arrays_check(BMEditMesh *em)
 {
        BMIter iter;
        BMElem *ele;
@@ -474,7 +474,7 @@ int EDBM_index_arrays_check(BMEditMesh *em)
        if (em->vert_index) {
                BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_VERTS_OF_MESH, i) {
                        if (ele != (BMElem *)em->vert_index[i]) {
-                               return FALSE;
+                               return false;
                        }
                }
        }
@@ -482,7 +482,7 @@ int EDBM_index_arrays_check(BMEditMesh *em)
        if (em->edge_index) {
                BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_EDGES_OF_MESH, i) {
                        if (ele != (BMElem *)em->edge_index[i]) {
-                               return FALSE;
+                               return false;
                        }
                }
        }
@@ -490,12 +490,12 @@ int EDBM_index_arrays_check(BMEditMesh *em)
        if (em->face_index) {
                BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_FACES_OF_MESH, i) {
                        if (ele != (BMElem *)em->face_index[i]) {
-                               return FALSE;
+                               return false;
                        }
                }
        }
 
-       return TRUE;
+       return true;
 }
 #endif
 
@@ -546,10 +546,10 @@ void EDBM_select_more(BMEditMesh *em)
 
        BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
                     "region_extend geom=%hvef use_constrict=%b use_faces=%b",
-                    BM_ELEM_SELECT, FALSE, use_faces);
+                    BM_ELEM_SELECT, false, use_faces);
        BMO_op_exec(em->bm, &bmop);
        /* don't flush selection in edge/vertex mode  */
-       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
+       BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? true : false);
        BMO_op_finish(em->bm, &bmop);
 
        EDBM_selectmode_flush(em);
@@ -562,10 +562,10 @@ void EDBM_select_less(BMEditMesh *em)
 
        BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
                     "region_extend geom=%hvef use_constrict=%b use_faces=%b",
-                    BM_ELEM_SELECT, TRUE, use_faces);
+                    BM_ELEM_SELECT, true, use_faces);
        BMO_op_exec(em->bm, &bmop);
        /* don't flush selection in edge/vertex mode  */
-       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
+       BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? true : false);
        BMO_op_finish(em->bm, &bmop);
 
        EDBM_selectmode_flush(em);
@@ -573,12 +573,12 @@ void EDBM_select_less(BMEditMesh *em)
 
 void EDBM_flag_disable_all(BMEditMesh *em, const char hflag)
 {
-       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, FALSE);
+       BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, false);
 }
 
 void EDBM_flag_enable_all(BMEditMesh *em, const char hflag)
 {
-       BM_mesh_elem_hflag_enable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, TRUE);
+       BM_mesh_elem_hflag_enable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, true);
 }
 
 /**************-------------- Undo ------------*****************/
@@ -623,7 +623,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
 
        /* BM_mesh_validate(em->bm); */ /* for troubleshooting */
 
-       BM_mesh_bm_to_me(em->bm, &um->me, FALSE);
+       BM_mesh_bm_to_me(em->bm, &um->me, false);
 
        um->selectmode = em->selectmode;
        um->shapenr = em->bm->shapenr;
@@ -644,12 +644,12 @@ static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata))
 
        bm = BM_mesh_create(&bm_mesh_allocsize_default);
 
-       BM_mesh_bm_from_me(bm, &um->me, FALSE, ob->shapenr);
+       BM_mesh_bm_from_me(bm, &um->me, false, ob->shapenr);
 
        /* face normals need recalculation since we are not calling through an operator */
-       BM_mesh_normals_update(bm, TRUE);
+       BM_mesh_normals_update(bm, true);
 
-       em_tmp = BMEdit_Create(bm, TRUE);
+       em_tmp = BMEdit_Create(bm, true);
        *em = *em_tmp;
        
        em->selectmode = um->selectmode;
@@ -667,7 +667,7 @@ static void free_undo(void *me_v)
                MEM_freeN(me->key);
        }
 
-       BKE_mesh_free(me, FALSE);
+       BKE_mesh_free(me, false);
        MEM_freeN(me);
 }
 
@@ -1133,7 +1133,7 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index)
  * preference */
 #define BM_SEARCH_MAXDIST_MIRR 0.00002f
 #define BM_CD_LAYER_ID "__mirror_index"
-void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select)
+void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const bool use_select)
 {
        Mesh *me = (Mesh *)em->ob->data;
        BMesh *bm = em->bm;
@@ -1162,7 +1162,7 @@ void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select)
        BM_mesh_elem_index_ensure(bm, BM_VERT);
 
        if (topo) {
-               ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, TRUE);
+               ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, true);
        }
        else {
                tree = BMBVH_NewBVH(em, 0, NULL, NULL);
@@ -1283,7 +1283,7 @@ void EDBM_mesh_hide(BMEditMesh *em, int swap)
 
        BM_ITER_MESH (ele, &iter, em->bm, itermode) {
                if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap)
-                       BM_elem_hide_set(em->bm, ele, TRUE);
+                       BM_elem_hide_set(em->bm, ele, true);
        }
 
        EDBM_selectmode_flush(em);
@@ -1335,7 +1335,7 @@ void EDBM_mesh_reveal(BMEditMesh *em)
 
                BM_ITER_MESH (ele, &iter, em->bm, iter_types[i]) {
                        if (BM_elem_flag_test(ele, BM_ELEM_TAG)) {
-                               BM_elem_select_set(em->bm, ele, TRUE);
+                               BM_elem_select_set(em->bm, ele, true);
                        }
                }
        }
@@ -1364,6 +1364,6 @@ void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_d
        }
        else {
                /* in debug mode double check we didn't need to recalculate */
-               BLI_assert(EDBM_index_arrays_check(em) == TRUE);
+               BLI_assert(EDBM_index_arrays_check(em) == true);
        }
 }
index 68e93fa22f79a21ebd607a3ed82b63caca719df6..b6b2550bd45a614359bc14f42d8d2832bae39dea 100644 (file)
@@ -349,7 +349,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
        BMEditMesh *em;
        int layernum_dst;
 
-       short is_init = FALSE;
+       bool is_init = false;
 
        if (me->edit_btmesh) {
                em = me->edit_btmesh;
@@ -376,7 +376,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
                        const int layernum_src = CustomData_get_active_layer(&em->bm->ldata, CD_MLOOPUV);
                        BM_data_layer_copy(em->bm, &em->bm->ldata, CD_MLOOPUV, layernum_src, layernum_dst);
 
-                       is_init = TRUE;
+                       is_init = true;
                }
                if (active_set || layernum_dst == 0) {
                        CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPUV, layernum_dst);
@@ -391,7 +391,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
                        CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DUPLICATE, me->mtpoly, me->totpoly, name);
                        CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DUPLICATE, me->mloopuv, me->totloop, name);
                        CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface, name);
-                       is_init = TRUE;
+                       is_init = true;
                }
                else {
                        CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DEFAULT, NULL, me->totpoly, name);
@@ -410,7 +410,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
        }
 
        /* don't overwrite our copied coords */
-       if (is_init == FALSE) {
+       if (is_init == false) {
                ED_mesh_uv_loop_reset_ex(me, layernum_dst);
        }
 
@@ -550,7 +550,7 @@ static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
        Object *ob = ED_object_context(C);
        Mesh *me = ob->data;
 
-       if (ED_mesh_uv_texture_add(C, me, NULL, TRUE) == -1)
+       if (ED_mesh_uv_texture_add(C, me, NULL, true) == -1)
                return OPERATOR_CANCELLED;
 
        return OPERATOR_FINISHED;
@@ -699,7 +699,7 @@ static int mesh_vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
        Object *ob = ED_object_context(C);
        Mesh *me = ob->data;
 
-       if (ED_mesh_color_add(C, scene, ob, me, NULL, TRUE) == -1)
+       if (ED_mesh_color_add(C, scene, ob, me, NULL, true) == -1)
                return OPERATOR_CANCELLED;
 
        return OPERATOR_FINISHED;
@@ -757,7 +757,7 @@ static int mesh_customdata_clear_exec__internal(bContext *C,
        int tot;
        CustomData *data = mesh_customdata_get_type(me, htype, &tot);
 
-       BLI_assert(CustomData_layertype_is_singleton(type) == TRUE);
+       BLI_assert(CustomData_layertype_is_singleton(type) == true);
 
        if (CustomData_has_layer(data, type)) {
                if (me->edit_btmesh) {
@@ -786,21 +786,21 @@ static int mesh_customdata_clear_mask_poll(bContext *C)
 
                /* special case - can't run this if we're in sculpt mode */
                if (ob->mode & OB_MODE_SCULPT) {
-                       return FALSE;
+                       return false;
                }
 
                if (me->id.lib == NULL) {
                        CustomData *data = GET_CD_DATA(me, vdata);
                        if (CustomData_has_layer(data, CD_PAINT_MASK)) {
-                               return TRUE;
+                               return true;
                        }
                        data = GET_CD_DATA(me, ldata);
                        if (CustomData_has_layer(data, CD_GRID_PAINT_MASK)) {
-                               return TRUE;
+                               return true;
                        }
                }
        }
-       return FALSE;
+       return false;
 }
 static int mesh_customdata_clear_mask_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -843,11 +843,11 @@ static int mesh_customdata_clear_skin_poll(bContext *C)
                if (me->id.lib == NULL) {
                        CustomData *data = GET_CD_DATA(me, vdata);
                        if (CustomData_has_layer(data, CD_MVERT_SKIN)) {
-                               return TRUE;
+                               return true;
                        }
                }
        }
-       return FALSE;
+       return false;
 }
 static int mesh_customdata_clear_skin_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -875,20 +875,20 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
 {
        int *polyindex = NULL;
        float (*face_nors)[3];
-       int tessface_input = FALSE;
+       bool tessface_input = false;
 
        if (mesh->totface > 0 && mesh->totpoly == 0) {
                BKE_mesh_convert_mfaces_to_mpolys(mesh);
 
                /* would only be converting back again, don't bother */
-               tessface_input = TRUE;
+               tessface_input = true;
        }
 
        if (calc_edges || ((mesh->totpoly || mesh->totface) && mesh->totedge == 0))
                BKE_mesh_calc_edges(mesh, calc_edges, true);
 
        if (calc_tessface) {
-               if (tessface_input == FALSE) {
+               if (tessface_input == false) {
                        BKE_mesh_tessface_calc(mesh);
                }
        }
@@ -911,7 +911,7 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
                                         mesh->totloop, mesh->totpoly,
                                         NULL /* polyNors_r */,
                                         mesh->mface, mesh->totface,
-                                        polyindex, face_nors, FALSE);
+                                        polyindex, face_nors, false);
 #else
        BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
                              mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
@@ -1239,7 +1239,7 @@ void ED_mesh_calc_normals(Mesh *mesh)
 #ifdef USE_BMESH_MPOLY_NORMALS
        BKE_mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
                                         mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
-                                        NULL, NULL, 0, NULL, NULL, FALSE);
+                                        NULL, NULL, 0, NULL, NULL, false);
 #else
        BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
                              mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
index e12d128eb76116d11f6a864ade789d2c796d76fb..2013335dac663c2a8efcbf67dfc11ec753f38eb0 100644 (file)
@@ -59,24 +59,24 @@ struct LinkNode;
  */
 
 /*calls a bmesh op, reporting errors to the user, etc*/
-int EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
+bool EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
 
-int EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
-                             const char *selectslot, const char *fmt, ...);
+bool EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
+                              const char *selectslot, const char *fmt, ...);
 
 /* same as above, but doesn't report errors.*/
-int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
+bool EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
 
 /* these next two functions are the split version of EDBM_op_callf, so you can
  * do stuff with a bmesh operator, after initializing it but before executing
  * it.
  *
  * execute the operator with BM_Exec_Op */
-int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
-                 struct wmOperator *op, const char *fmt, ...);
+bool EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
+                  struct wmOperator *op, const char *fmt, ...);
 /*cleans up after a bmesh operator*/
-int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
-                   struct wmOperator *op, const int report);
+bool EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
+                    struct wmOperator *op, const bool do_report);
 
 void EDBM_stats_update(struct BMEditMesh *em);
 
index 8d5bfe624fd41afac327bdebea505a17165495b5..d85fc420e14416bf021c50f4e3ccfcd9d92533be 100644 (file)
@@ -320,7 +320,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
 
        if (createob) {
                /* create new object */
-               obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, lay);
+               obedit = ED_object_add_type(C, OB_MESH, co, rot, false, lay);
        }
        else {
                obedit = base->object;
@@ -401,7 +401,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
                                                          EDBM_vert_at_index(em, face[0]),
                                                          EDBM_vert_at_index(em, face[2]),
                                                          EDBM_vert_at_index(em, face[1]), NULL,
-                                                         NULL, FALSE);
+                                                         NULL, false);
 
                        /* set navigation polygon idx to the custom layer */
                        polygonIdx = (int *)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
@@ -500,7 +500,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = BMEdit_FromObject(obedit);
 
        /* do work here */
-       BMFace *efa_act = BM_active_face_get(em->bm, FALSE, FALSE);
+       BMFace *efa_act = BM_active_face_get(em->bm, false, false);
 
        if (efa_act) {
                if (CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
@@ -633,16 +633,16 @@ static int navmesh_obmode_data_poll(bContext *C)
                Mesh *me = ob->data;
                return CustomData_has_layer(&me->pdata, CD_RECAST);
        }
-       return FALSE;
+       return false;
 }
 
 static int navmesh_obmode_poll(bContext *C)
 {
        Object *ob = ED_object_active_context(C);
        if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
-               return TRUE;
+               return true;
        }
-       return FALSE;
+       return false;
 }
 
 static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
index 4c6c9ba0757a9acc0952acad3bb8262c46cfec53..8a22a5533873a6de5c119286a5abdf2f1138e13e 100644 (file)
@@ -206,52 +206,52 @@ void ED_operatormacros_mesh(void)
        WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", "Rip polygons and move the result",
                                          OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip");
-       RNA_boolean_set(otmacro->ptr, "use_fill", FALSE);
+       RNA_boolean_set(otmacro->ptr, "use_fill", false);
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        /* annoying we can't pass 'use_fill' through the macro */
        ot = WM_operatortype_append_macro("MESH_OT_rip_move_fill", "Rip Fill", "Rip-fill polygons and move the result",
                                          OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip");
-       RNA_boolean_set(otmacro->ptr, "use_fill", TRUE);
+       RNA_boolean_set(otmacro->ptr, "use_fill", true);
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move",
                                          "Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move",
                                          "Extrude faces and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move",
                                          "Extrude edges and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 
        ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move",
                                          "Extrude vertices and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
        otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
        otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
-       RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
+       RNA_boolean_set(otmacro->ptr, "mirror", false);
 }
 
 /* note mesh keymap also for other space? */
@@ -268,29 +268,29 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "MESH_OT_inset", IKEY, KM_PRESS, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "vertex_only", FALSE);
+       RNA_boolean_set(kmi->ptr, "vertex_only", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "vertex_only", TRUE);
+       RNA_boolean_set(kmi->ptr, "vertex_only", true);
 
        /* selecting */
        /* standard mouse selection goes via space_view3d */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       RNA_boolean_set(kmi->ptr, "deselect", FALSE);
-       RNA_boolean_set(kmi->ptr, "toggle", FALSE);
+       RNA_boolean_set(kmi->ptr, "extend", false);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
+       RNA_boolean_set(kmi->ptr, "toggle", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       RNA_boolean_set(kmi->ptr, "deselect", FALSE);
-       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
+       RNA_boolean_set(kmi->ptr, "extend", false);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
+       RNA_boolean_set(kmi->ptr, "toggle", true);
 
        kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       RNA_boolean_set(kmi->ptr, "deselect", FALSE);
-       RNA_boolean_set(kmi->ptr, "toggle", FALSE);
+       RNA_boolean_set(kmi->ptr, "extend", false);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
+       RNA_boolean_set(kmi->ptr, "toggle", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT | KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       RNA_boolean_set(kmi->ptr, "deselect", FALSE);
-       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
+       RNA_boolean_set(kmi->ptr, "extend", false);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
+       RNA_boolean_set(kmi->ptr, "toggle", true);
 
        WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
 
@@ -305,9 +305,9 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(kmi->ptr, "deselect", FALSE);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "deselect", TRUE);
+       RNA_boolean_set(kmi->ptr, "deselect", true);
        
        WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
 
@@ -318,16 +318,16 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        
        /* hide */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+       RNA_boolean_set(kmi->ptr, "unselected", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+       RNA_boolean_set(kmi->ptr, "unselected", true);
        WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
 
        /* tools */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "inside", FALSE);
+       RNA_boolean_set(kmi->ptr, "inside", false);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "inside", TRUE);
+       RNA_boolean_set(kmi->ptr, "inside", true);
        
        WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, KM_ALT, 0);
@@ -340,9 +340,9 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
 
        kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "use_beauty", TRUE);
+       RNA_boolean_set(kmi->ptr, "use_beauty", true);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "use_beauty", FALSE);
+       RNA_boolean_set(kmi->ptr, "use_beauty", false);
 
        WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
 
@@ -368,20 +368,20 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "TRANSFORM_OT_vert_slide", VKEY, KM_PRESS, KM_SHIFT, 0);
        /* use KM_CLICK because same key is used for tweaks */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "rotate_source", TRUE);
+       RNA_boolean_set(kmi->ptr, "rotate_source", true);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT | KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "rotate_source", FALSE);
+       RNA_boolean_set(kmi->ptr, "rotate_source", false);
 
        WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", DELKEY, KM_PRESS, 0, 0);
        
        kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(kmi->ptr, "use_occlude_geometry", TRUE);
-       RNA_boolean_set(kmi->ptr, "only_selected",          FALSE);
+       RNA_boolean_set(kmi->ptr, "use_occlude_geometry", true);
+       RNA_boolean_set(kmi->ptr, "only_selected",          false);
 
        kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "use_occlude_geometry", FALSE);
-       RNA_boolean_set(kmi->ptr, "only_selected",          TRUE);
+       RNA_boolean_set(kmi->ptr, "use_occlude_geometry", false);
+       RNA_boolean_set(kmi->ptr, "only_selected",          true);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
 
@@ -401,7 +401,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        }
        
        ED_keymap_proportional_cycle(keyconf, keymap);
-       ED_keymap_proportional_editmode(keyconf, keymap, TRUE);
+       ED_keymap_proportional_editmode(keyconf, keymap, true);
 
        knifetool_modal_keymap(keyconf);
 }
index e8f55edddaba07e2bec4a904d69817deb0088ee1..89fee2cdc4fdebe78c1190dd4b69f1b415e26277 100644 (file)
@@ -430,8 +430,8 @@ int join_mesh_exec(bContext *C, wmOperator *op)
 
                                        multiresModifier_prepare_join(scene, base->object, ob);
 
-                                       if ((mmd = get_multires_modifier(scene, base->object, TRUE))) {
-                                               ED_object_iter_other(bmain, base->object, TRUE,
+                                       if ((mmd = get_multires_modifier(scene, base->object, true))) {
+                                               ED_object_iter_other(bmain, base->object, true,
                                                                     ED_object_multires_update_totlevels_cb,
                                                                     &mmd->totlvl);
                                        }
@@ -724,9 +724,9 @@ static void mesh_octree_add_nodes(MocNode **basetable, const float co[3], const
        float fx, fy, fz;
        int vx, vy, vz;
        
-       if ((finite(co[0]) == FALSE) ||
-           (finite(co[1]) == FALSE) ||
-           (finite(co[2]) == FALSE))
+       if ((finite(co[0]) == false) ||
+           (finite(co[1]) == false) ||
+           (finite(co[2]) == false))
        {
                return;
        }
@@ -910,7 +910,7 @@ int mesh_mirrtopo_table(Object *ob, char mode)
                }
        }
        else if (mode == 's') { /* start table */
-               ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, FALSE);
+               ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, false);
        }
        else if (mode == 'e') { /* end table */
                ED_mesh_mirrtopo_free(&mesh_topo_store);
@@ -957,9 +957,9 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
        intptr_t poinval;
        
        /* ignore nan verts */
-       if ((finite(co[0]) == FALSE) ||
-           (finite(co[1]) == FALSE) ||
-           (finite(co[2]) == FALSE))
+       if ((finite(co[0]) == false) ||
+           (finite(co[1]) == false) ||
+           (finite(co[2]) == false))
        {
                return NULL;
        }
@@ -1174,9 +1174,9 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
  * Face selection in object mode,
  * currently only weight-paint and vertex-paint use this.
  *
- * \return boolean TRUE == Found
+ * \return boolean true == Found
  */
-int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
+bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
 {
        ViewContext vc;
        Mesh *me = ob->data;
@@ -1184,7 +1184,7 @@ int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *
        BLI_assert(me && GS(me->id.name) == ID_ME);
 
        if (!me || me->totpoly == 0)
-               return 0;
+               return false;
 
        view3d_set_viewcontext(C, &vc);
 
@@ -1201,17 +1201,17 @@ int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *
        }
 
        if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly)
-               return 0;
+               return false;
 
        (*index)--;
 
-       return 1;
+       return true;
 }
 /**
  * Use when the back buffer stores face index values. but we want a vert.
  * This gets the face then finds the closest vertex to mval.
  */
-int ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
+bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
 {
        unsigned int poly_index;
        Mesh *me = ob->data;
@@ -1257,18 +1257,18 @@ int ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned
 
                if (v_idx_best != -1) {
                        *index = v_idx_best;
-                       return 1;
+                       return true;
                }
        }
 
-       return 0;
+       return false;
 }
 
 /**
  * Vertex selection in object mode,
  * currently only weight paint uses this.
  *
- * \return boolean TRUE == Found
+ * \return boolean true == Found
  */
 typedef struct VertPickData {
        const MVert *mvert;
@@ -1296,7 +1296,7 @@ static void ed_mesh_pick_vert__mapFunc(void *userData, int index, const float co
                }
        }
 }
-int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size, int use_zbuf)
+bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf)
 {
        ViewContext vc;
        Mesh *me = ob->data;
@@ -1304,7 +1304,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
        BLI_assert(me && GS(me->id.name) == ID_ME);
 
        if (!me || me->totvert == 0)
-               return 0;
+               return false;
 
        view3d_set_viewcontext(C, &vc);
 
@@ -1322,7 +1322,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
                }
 
                if ((*index) <= 0 || (*index) > (unsigned int)me->totvert)
-                       return 0;
+                       return false;
 
                (*index)--;
        }
@@ -1341,7 +1341,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
                ED_view3d_init_mats_rv3d(ob, rv3d);
 
                if (dm == NULL) {
-                       return 0;
+                       return false;
                }
 
                /* setup data */
@@ -1356,11 +1356,11 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
                dm->release(dm);
 
                if (data.v_idx_best == -1) {
-                       return 0;
+                       return false;
                }
 
                *index = data.v_idx_best;
        }
 
-       return 1;
+       return true;
 }
index 6781624aec6e1948e9e5066d0dfd79c149e93ff9..3fe8b93ada303a62658dd6b4415ade5bf05cbd47 100644 (file)
@@ -411,7 +411,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
 
 /* Select MetaElement with mouse click (user can select radius circle or
  * stiffness circle) */
-int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int toggle)
+bool mouse_mball(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        static MetaElem *startelem = NULL;
        Object *obedit = CTX_data_edit_object(C);
@@ -487,11 +487,11 @@ int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int to
                        
                        WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);
 
-                       return 1;
+                       return true;
                }
        }
 
-       return 0;
+       return false;
 }
 
 
index 053f1ffabd0596af4216f2f918a6f3688eb3fb46..9d3b2b7272d4c9c995efbc94374a97c5b5fbcf05 100644 (file)
@@ -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 *************************/
index c9070dc620531a41b13f37390a7062b11a9a26ea..2239148ca1c96dfa67d0a2509e4410113e91674b 100644 (file)
@@ -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)
 {
index 6039ff6d34b64343f58a8dfa8a27be4fc4f4100c..34a6d359f6ba5cf08d3f4887e936102c6f5cf7c5 100644 (file)
@@ -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)
index baa0199baf7e9944f01a13657167f24bd576e882..58e51fa0603353a5feb0fda0957760296c3eefc7 100644 (file)
@@ -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);
index 329f1f67c4a5f2d475fa6ed87cdfc521a22518a9..e972b7d66207f8101a6c71e79e381e1ba2e71dc1 100644 (file)
@@ -1403,7 +1403,7 @@ void PARTICLE_OT_select_all(wmOperatorType *ot)
 
 /************************ pick select operator ************************/
 
-int PE_mouse_particles(bContext *C, const int mval[2], int extend, int deselect, int toggle)
+int PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        PEData data;
        Scene *scene= CTX_data_scene(C);
@@ -1584,7 +1584,7 @@ void PE_deselect_all_visible(PTCacheEdit *edit)
        }
 }
 
-int PE_border_select(bContext *C, rcti *rect, int select, int extend)
+int PE_border_select(bContext *C, rcti *rect, bool select, bool extend)
 {
        Scene *scene= CTX_data_scene(C);
        Object *ob= CTX_data_active_object(C);
@@ -1636,7 +1636,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
 
 /************************ lasso select operator ************************/
 
-int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short extend, short select)
+int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, bool extend, bool select)
 {
        Scene *scene= CTX_data_scene(C);
        Object *ob= CTX_data_active_object(C);
index c9e6dc90515d598d79560d91e3a93ed87ac33a1a..79b715711de7f12bc121a212a82b4a31df504368 100644 (file)
  *  \ingroup edrend
  */
 
-
 #include <stdlib.h>
 
-
-#include "WM_api.h"
+#include "BLI_utildefines.h"
 
 #include "ED_render.h"
 
+#include "WM_api.h"
+
 #include "render_intern.h" // own include
 
 #if (defined(WITH_QUICKTIME) && !defined(USE_QTKIT))
index 0fbb4c25e78e3e9b9a5aa8408df4c79195381aa7..20edd3d32e798d9cd00038b9d40552d02c738491 100644 (file)
@@ -232,11 +232,11 @@ static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
        return OPERATOR_CANCELLED;
 }
 
-static int screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
+static bool screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
 {
        const char *prop_id = RNA_property_identifier(prop);
 
-       return !(strcmp(prop_id, "filepath") == 0);
+       return !(STREQ(prop_id, "filepath"));
 }
 
 static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
index 3aee9a5e31e2efc9f33829fd461093ad6c978fd7..0cb0a3d6e5cd37a721d94dbdfc9d8edfb1dcb904 100644 (file)
@@ -449,7 +449,7 @@ static int sound_mixdown_invoke(bContext *C, wmOperator *op, const wmEvent *even