Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true...
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Jan 2014 13:50:50 +0000 (14:50 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Jan 2014 13:52:46 +0000 (14:52 +0100)
17 files changed:
source/blender/blenkernel/BKE_cdderivedmesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/constraint.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/modifiers/intern/MOD_triangulate.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index db06d190b731da10fed1ce8beb14e7ba7d7009fc..4e6d69503c0a371dea01fbe665c2710105201f24 100644 (file)
@@ -52,10 +52,10 @@ struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces,
  * data to not overwrite the original */
 struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh);
 
-struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, int use_mdisps);
+struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps);
 
 /* creates a CDDerivedMesh from the given BMEditMesh */
-DerivedMesh *CDDM_from_editbmesh(struct BMEditMesh *em, int use_mdisps, int use_tessface);
+DerivedMesh *CDDM_from_editbmesh(struct BMEditMesh *em, const bool use_mdisps, const bool use_tessface);
 
 /* merge verts  */
 DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int tot_vtargetmap);
@@ -95,7 +95,7 @@ void CDDM_apply_vert_normals(struct DerivedMesh *cddm, short (*vertNormals)[3]);
 
 /* recalculates vertex and face normals for a CDDerivedMesh
  */
-void CDDM_calc_normals_mapping_ex(struct DerivedMesh *dm, const short only_face_normals);
+void CDDM_calc_normals_mapping_ex(struct DerivedMesh *dm, const bool only_face_normals);
 void CDDM_calc_normals_mapping(struct DerivedMesh *dm);
 void CDDM_calc_normals(struct DerivedMesh *dm);
 void CDDM_calc_normals_tessface(struct DerivedMesh *dm);
@@ -112,7 +112,7 @@ void CDDM_calc_edges(struct DerivedMesh *dm);
 
 /* reconstitute face triangulation */
 void CDDM_recalc_tessellation(struct DerivedMesh *dm);
-void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy);
+void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const bool do_face_nor_cpy);
 
 /* lowers the number of vertices/edges/faces in a CDDerivedMesh
  * the layer data stays the same size
index 49147db33234d9332470c45d88d8b8898f7eac14..cc0e80c81e98603fb457e3733f81e3bd34c44adb 100644 (file)
@@ -949,7 +949,7 @@ static DerivedMesh *create_orco_dm(Object *ob, Mesh *me, BMEditMesh *em, int lay
        float (*orco)[3];
        int free;
 
-       if (em) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+       if (em) dm = CDDM_from_editbmesh(em, false, false);
        else dm = CDDM_from_mesh(me);
 
        orco = get_orco_coords_dm(ob, em, layer, &free);
@@ -2062,7 +2062,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
 
                        }
                        else {
-                               dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+                               dm = CDDM_from_editbmesh(em, false, false);
                                ASSERT_IS_VALID_DM(dm);
 
                                if (deformedVerts) {
index a34b6803413865247a3e20a54d651ebf5e51f92d..a646f102f285495bb79528c3f3ff7b8d569b8a38 100644 (file)
@@ -1665,7 +1665,7 @@ static void cdDM_foreachMappedFaceCenter(
 
 }
 
-void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
+void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const bool do_face_nor_cpy)
 {
        CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
 
@@ -1683,7 +1683,7 @@ void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
 
 void CDDM_recalc_tessellation(DerivedMesh *dm)
 {
-       CDDM_recalc_tessellation_ex(dm, TRUE);
+       CDDM_recalc_tessellation_ex(dm, true);
 }
 
 static void cdDM_free_internal(CDDerivedMesh *cddm)
@@ -1945,9 +1945,9 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
 }
 
 /* used for both editbmesh and bmesh */
-static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, int use_mdisps,
+static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, const bool use_mdisps,
                                        /* EditBMesh vars for use_tessface */
-                                       int use_tessface,
+                                       const bool use_tessface,
                                        const int em_tottri, const BMLoop *(*em_looptris)[3]
                                        )
 {
@@ -2110,14 +2110,14 @@ static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, int use_mdisps,
        return dm;
 }
 
-struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, int use_mdisps)
+struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps)
 {
-       return cddm_from_bmesh_ex(bm, use_mdisps, FALSE,
+       return cddm_from_bmesh_ex(bm, use_mdisps, false,
                                  /* these vars are for editmesh only */
                                  0, NULL);
 }
 
-DerivedMesh *CDDM_from_editbmesh(BMEditMesh *em, int use_mdisps, int use_tessface)
+DerivedMesh *CDDM_from_editbmesh(BMEditMesh *em, const bool use_mdisps, const bool use_tessface)
 {
        return cddm_from_bmesh_ex(em->bm, use_mdisps,
                                  /* editmesh */
@@ -2254,7 +2254,7 @@ void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
        cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
 }
 
-void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals)
+void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const bool only_face_normals)
 {
        CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
        float (*face_nors)[3] = NULL;
@@ -2280,7 +2280,7 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
                 * Important not to update face normals from polys since it
                 * interferes with assigning the new normal layer in the following code.
                 */
-               CDDM_recalc_tessellation_ex(dm, FALSE);
+               CDDM_recalc_tessellation_ex(dm, false);
        }
        else {
                /* A tessellation already exists, it should always have a CD_ORIGINDEX */
@@ -2306,7 +2306,7 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
 void CDDM_calc_normals_mapping(DerivedMesh *dm)
 {
        /* use this to skip calculating normals on original vert's, this may need to be changed */
-       const short only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
+       const bool only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
 
        CDDM_calc_normals_mapping_ex(dm, only_face_normals);
 }
index 50f987b03c0c04bbe522cc517c663fc0c0ab2e5e..b7850c0030ece8e6f82bf0e275ce91bb8bfa3aa7 100644 (file)
@@ -366,7 +366,7 @@ static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[
        /* get DerivedMesh */
        if (em) {
                /* target is in editmode, so get a special derived mesh */
-               dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+               dm = CDDM_from_editbmesh(em, false, false);
                freeDM = 1;
        }
        else {
index ebfef08c28404353cd73a6b3cad2aaec68c9a117..8a05b33d10562d05d12fe3f4e465275254e8f434 100644 (file)
@@ -399,7 +399,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, Object *ob, B
        smd.levels = smd_real->levels;
        smd.subdivType = smd_real->subdivType;
                
-       initialDerived = CDDM_from_editbmesh(em, FALSE, FALSE);
+       initialDerived = CDDM_from_editbmesh(em, false, false);
        derivedMesh = subsurf_make_derived_from_derived(initialDerived, &smd,
                                                        NULL, SUBSURF_IN_EDIT_MODE);
 
index e81fc44f2383fb00992ca205a13d4810edd256d5..a4248df5ea199381e9d155301b04e82f55f8c3a3 100644 (file)
@@ -141,7 +141,7 @@ static void deformVertsEM(
        ArmatureModifierData *amd = (ArmatureModifierData *) md;
        DerivedMesh *dm = derivedData;
 
-       if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+       if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
 
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
 
@@ -165,7 +165,7 @@ static void deformMatricesEM(
        ArmatureModifierData *amd = (ArmatureModifierData *) md;
        DerivedMesh *dm = derivedData;
 
-       if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+       if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
 
        armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
                              amd->deformflag, NULL, amd->defgrp_name);
index 77fa7d8c3f08f18e56b5f890be87436690423332..ec5fc4e43b4aeec96e1b6dc1d575ef5cb0b1b2ef 100644 (file)
@@ -549,7 +549,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
        /* Bump the stack level back down to match the adjustment up above */
        BMO_pop(bm);
 
-       result = CDDM_from_bmesh(bm, FALSE);
+       result = CDDM_from_bmesh(bm, false);
 
        if ((dm->dirty & DM_DIRTY_NORMALS) ||
            ((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)))
index 0a0f97fdcbeb9bdbffedf1a6b387d257e578d1e8..25577a41f581b4bc048d5d9c8de082ec8c582a86 100644 (file)
@@ -165,7 +165,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
                      vertex_only, bmd->lim_flags & MOD_BEVEL_WEIGHT, do_clamp,
                      dvert, vgroup);
 
-       result = CDDM_from_bmesh(bm, TRUE);
+       result = CDDM_from_bmesh(bm, true);
 
        BLI_assert(bm->vtoolflagpool == NULL &&
                   bm->etoolflagpool == NULL &&
index a6ea9920e782f9cfd0f543dc246b18f375e1dd2c..760fa8ffbe8e961eb2871565785cec10248a74f5 100644 (file)
@@ -130,7 +130,7 @@ static void deformVertsEM(
 {
        DerivedMesh *dm = derivedData;
 
-       if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+       if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0);
 
index 155ccf034d70580d37aecb4cec129e8967f991c0..b844b9e3bde6802c49a5127bc313c7cce3086132 100644 (file)
@@ -191,7 +191,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 
        /* update for display only */
        dmd->face_count = bm->totface;
-       result = CDDM_from_bmesh(bm, FALSE);
+       result = CDDM_from_bmesh(bm, false);
        BLI_assert(bm->vtoolflagpool == NULL &&
                   bm->etoolflagpool == NULL &&
                   bm->ftoolflagpool == NULL);  /* make sure we never alloc'd these */
index 609d37a13275cf0d9341c3d3b35a861222e07f31..fa29921b3250d65845ac8fb68ac13c007a476e36 100644 (file)
@@ -95,7 +95,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd)
 
        /* BM_mesh_validate(bm); */ /* for troubleshooting */
 
-       result = CDDM_from_bmesh(bm, TRUE);
+       result = CDDM_from_bmesh(bm, true);
        BM_mesh_free(bm);
 
        result->dirty |= DM_DIRTY_NORMALS;
index 76db877c229fdc866c108716c8ef0f90c04f33f5..e4a359a93e2ee10180433d1aef3dfcb6c81c4fc3 100644 (file)
@@ -128,7 +128,7 @@ static void deformVertsEM(
 {
        DerivedMesh *dm = derivedData;
 
-       if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+       if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0);
 
index 73297c000847704db5401e7b04bc81be9f4cb610..1d9f590378d79492780fc0aca5b2a105dc64736f 100644 (file)
@@ -1787,7 +1787,7 @@ static DerivedMesh *base_skin(DerivedMesh *origdm,
        if (!bm)
                return NULL;
        
-       result = CDDM_from_bmesh(bm, FALSE);
+       result = CDDM_from_bmesh(bm, false);
        BM_mesh_free(bm);
 
        CDDM_calc_edges(result);
index 182c339abfd0b5961c6be02f4d5efd6928610f17..4cae3d662db2a70aa41e47d4bad073c455823ab5 100644 (file)
@@ -47,7 +47,7 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int quad_method, const
 
        BM_mesh_triangulate(bm, quad_method, ngon_method, false, NULL, NULL);
 
-       result = CDDM_from_bmesh(bm, FALSE);
+       result = CDDM_from_bmesh(bm, false);
        BM_mesh_free(bm);
 
        total_edges = result->getNumEdges(result);
index e205cd6b12ddc0456af6b9c3153b814497079166..feae95bf777fa33a969d8d496da4c85803b48ebb 100644 (file)
@@ -183,7 +183,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
                /* pass */
        }
        else if (ob->type == OB_MESH) {
-               if (em) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+               if (em) dm = CDDM_from_editbmesh(em, false, false);
                else dm = CDDM_from_mesh((struct Mesh *)(ob->data));
 
                if (vertexCos) {
index e6d6c6296810daa466e6df5f6ed74124947b5888..93be31bcad794f1649749c0d3f82d889a1882ff7 100644 (file)
@@ -334,7 +334,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *em,
 
        if (use_dm) {
                if (!derivedData)
-                       dm = CDDM_from_editbmesh(em, FALSE, FALSE);
+                       dm = CDDM_from_editbmesh(em, false, false);
        }
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0);
index ecb99974472fb46cbb339dac2b1ae9c6dba81a55..4ee8494496dedb5f9ddf271f386b95c7a893b4bd 100644 (file)
@@ -471,7 +471,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                else if (obr->type == OB_MESH) {
                                        Mesh *me = (Mesh *)obr->data;
                                        if (me->edit_btmesh)
-                                               target_dm = CDDM_from_editbmesh(me->edit_btmesh, FALSE, FALSE);
+                                               target_dm = CDDM_from_editbmesh(me->edit_btmesh, false, false);
                                        else
                                                target_dm = CDDM_from_mesh(me);
                                }