[Bf-blender-cvs] [0a249f9] master: Cleanup: arg names

Campbell Barton noreply at git.blender.org
Thu Jul 23 07:22:43 CEST 2015


Commit: 0a249f98534e20928d2d52c4585bff5d96ea9000
Author: Campbell Barton
Date:   Thu Jul 23 15:17:26 2015 +1000
Branches: master
https://developer.blender.org/rB0a249f98534e20928d2d52c4585bff5d96ea9000

Cleanup: arg names

===================================================================

M	source/blender/blenkernel/BKE_DerivedMesh.h
M	source/blender/blenkernel/BKE_bvhutils.h
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/bvhutils.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 369bd51..32baa45 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -795,16 +795,16 @@ BLI_INLINE int DM_origindex_mface_mpoly(
 	return (j != ORIGINDEX_NONE) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : ORIGINDEX_NONE;
 }
 
-struct MVert *DM_get_vert_array(struct DerivedMesh *dm, bool *allocated);
-struct MEdge *DM_get_edge_array(struct DerivedMesh *dm, bool *allocated);
-struct MLoop *DM_get_loop_array(struct DerivedMesh *dm, bool *allocated);
-struct MPoly *DM_get_poly_array(struct DerivedMesh *dm, bool *allocated);
-struct MFace *DM_get_tessface_array(struct DerivedMesh *dm, bool *allocated);
+struct MVert *DM_get_vert_array(struct DerivedMesh *dm, bool *r_allocated);
+struct MEdge *DM_get_edge_array(struct DerivedMesh *dm, bool *r_allocated);
+struct MLoop *DM_get_loop_array(struct DerivedMesh *dm, bool *r_allocated);
+struct MPoly *DM_get_poly_array(struct DerivedMesh *dm, bool *r_allocated);
+struct MFace *DM_get_tessface_array(struct DerivedMesh *dm, bool *r_allocated);
 const MLoopTri *DM_get_looptri_array(
         DerivedMesh *dm,
         const MVert *mvert,
         const MPoly *mpoly, int mpoly_len,
         const MLoop *mloop, int mloop_len,
-        bool *allocated);
+        bool *r_allocated);
 
 #endif  /* __BKE_DERIVEDMESH_H__ */
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 9220082..52a659b 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -110,8 +110,8 @@ BVHTree *bvhtree_from_mesh_looptri_ex(
         struct BVHTreeFromMesh *data,
         const struct MVert *vert, const bool vert_allocated,
         const struct MLoop *mloop, const bool loop_allocated,
-        const struct MLoopTri *looptri, const int numFaces, const bool face_allocated,
-        BLI_bitmap *mask, int numFaces_active,
+        const struct MLoopTri *looptri, const int looptri_num, const bool face_allocated,
+        BLI_bitmap *mask, int looptri_num_active,
         float epsilon, int tree_type, int axis);
 
 /**
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 60a681d..2b4a0f4 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -3838,41 +3838,41 @@ MEdge *DM_get_edge_array(DerivedMesh *dm, bool *allocated)
 	return medge;
 }
 
-MLoop *DM_get_loop_array(DerivedMesh *dm, bool *allocated)
+MLoop *DM_get_loop_array(DerivedMesh *dm, bool *r_allocated)
 {
 	CustomData *loop_data = dm->getEdgeDataLayout(dm);
 	MLoop *mloop = CustomData_get_layer(loop_data, CD_MLOOP);
-	*allocated = false;
+	*r_allocated = false;
 
 	if (mloop == NULL) {
 		mloop = MEM_mallocN(sizeof(MLoop) * dm->getNumLoops(dm), "dm loop data array");
 		dm->copyLoopArray(dm, mloop);
-		*allocated = true;
+		*r_allocated = true;
 	}
 
 	return mloop;
 }
 
-MPoly *DM_get_poly_array(DerivedMesh *dm, bool *allocated)
+MPoly *DM_get_poly_array(DerivedMesh *dm, bool *r_allocated)
 {
 	CustomData *poly_data = dm->getPolyDataLayout(dm);
 	MPoly *mpoly = CustomData_get_layer(poly_data, CD_MPOLY);
-	*allocated = false;
+	*r_allocated = false;
 
 	if (mpoly == NULL) {
 		mpoly = MEM_mallocN(sizeof(MPoly) * dm->getNumPolys(dm), "dm poly data array");
 		dm->copyPolyArray(dm, mpoly);
-		*allocated = true;
+		*r_allocated = true;
 	}
 
 	return mpoly;
 }
 
-MFace *DM_get_tessface_array(DerivedMesh *dm, bool *allocated)
+MFace *DM_get_tessface_array(DerivedMesh *dm, bool *r_allocated)
 {
 	CustomData *tessface_data = dm->getTessFaceDataLayout(dm);
 	MFace *mface = CustomData_get_layer(tessface_data, CD_MFACE);
-	*allocated = false;
+	*r_allocated = false;
 
 	if (mface == NULL) {
 		int numTessFaces = dm->getNumTessFaces(dm);
@@ -3880,7 +3880,7 @@ MFace *DM_get_tessface_array(DerivedMesh *dm, bool *allocated)
 		if (numTessFaces > 0) {
 			mface = MEM_mallocN(sizeof(MFace) * numTessFaces, "bvh mface data array");
 			dm->copyTessFaceArray(dm, mface);
-			*allocated = true;
+			*r_allocated = true;
 		}
 	}
 
@@ -3892,10 +3892,10 @@ const MLoopTri *DM_get_looptri_array(
         const MVert *mvert,
         const MPoly *mpoly, int mpoly_len,
         const MLoop *mloop, int mloop_len,
-        bool *allocated)
+        bool *r_allocated)
 {
 	const MLoopTri *looptri = dm->getLoopTriArray(dm);
-	*allocated = false;
+	*r_allocated = false;
 
 	if (looptri == NULL) {
 		if (mpoly_len > 0) {
@@ -3912,7 +3912,7 @@ const MLoopTri *DM_get_looptri_array(
 
 			looptri = looptri_data;
 
-			*allocated = true;
+			*r_allocated = true;
 		}
 	}
 
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 517d060..a7a9dc1 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -832,28 +832,28 @@ BVHTree *bvhtree_from_mesh_faces_ex(
 
 static BVHTree *bvhtree_from_mesh_looptri_create_tree(
         float epsilon, int tree_type, int axis,
-        BMEditMesh *em, const MVert *vert, const MLoop *mloop, const MLoopTri *looptri, const int numFaces,
-        BLI_bitmap *mask, int numFaces_active)
+        BMEditMesh *em, const MVert *vert, const MLoop *mloop, const MLoopTri *looptri, const int looptri_num,
+        BLI_bitmap *mask, int looptri_num_active)
 {
 	BVHTree *tree = NULL;
 	int i;
 
-	if (numFaces) {
-		if (mask && numFaces_active < 0) {
-			numFaces_active = 0;
-			for (i = 0; i < numFaces; i++) {
+	if (looptri_num) {
+		if (mask && looptri_num_active < 0) {
+			looptri_num_active = 0;
+			for (i = 0; i < looptri_num; i++) {
 				if (BLI_BITMAP_TEST_BOOL(mask, i)) {
-					numFaces_active++;
+					looptri_num_active++;
 				}
 			}
 		}
 		else if (!mask) {
-			numFaces_active = numFaces;
+			looptri_num_active = looptri_num;
 		}
 
 		/* Create a bvh-tree of the given target */
 		/* printf("%s: building BVH, total=%d\n", __func__, numFaces); */
-		tree = BLI_bvhtree_new(numFaces_active, epsilon, tree_type, axis);
+		tree = BLI_bvhtree_new(looptri_num_active, epsilon, tree_type, axis);
 		if (tree) {
 			if (em) {
 				const struct BMLoop *(*looptris)[3] = (void *)em->looptris;
@@ -871,7 +871,7 @@ static BVHTree *bvhtree_from_mesh_looptri_create_tree(
 				 * and/or selected. Even if the faces themselves are not selected for the snapped
 				 * transform, having a vertex selected means the face (and thus it's tessellated
 				 * triangles) will be moving and will not be a good snap targets. */
-				for (i = 0; i < numFaces; i++) {
+				for (i = 0; i < looptri_num; i++) {
 					const BMLoop **ltri = looptris[i];
 					BMFace *f = ltri[0]->f;
 					bool insert = mask ? BLI_BITMAP_TEST_BOOL(mask, i) : true;
@@ -915,7 +915,7 @@ static BVHTree *bvhtree_from_mesh_looptri_create_tree(
 			}
 			else {
 				if (vert && looptri) {
-					for (i = 0; i < numFaces; i++) {
+					for (i = 0; i < looptri_num; i++) {
 						float co[4][3];
 						if (mask && !BLI_BITMAP_TEST_BOOL(mask, i)) {
 							continue;
@@ -1070,12 +1070,12 @@ BVHTree *bvhtree_from_mesh_looptri_ex(
         const struct MVert *vert, const bool vert_allocated,
         const struct MLoop *mloop, const bool loop_allocated,
         const struct MLoopTri *looptri, const int looptri_num, const bool looptri_allocated,
-        BLI_bitmap *mask, int numFaces_active,
+        BLI_bitmap *mask, int looptri_num_active,
         float epsilon, int tree_type, int axis)
 {
 	BVHTree *tree = bvhtree_from_mesh_looptri_create_tree(
 	        epsilon, tree_type, axis, NULL, vert, mloop, looptri, looptri_num,
-	        mask, numFaces_active);
+	        mask, looptri_num_active);
 
 	/* Setup BVHTreeFromMesh */
 	bvhtree_from_mesh_looptri_setup_data(




More information about the Bf-blender-cvs mailing list