[Bf-blender-cvs] [b2c9fdfe871] master: Cleanup: rename BMesh count_ex -> count_at_most

Campbell Barton noreply at git.blender.org
Tue Apr 3 17:07:16 CEST 2018


Commit: b2c9fdfe871e2f1eaa6be30d67ad9df12c2f0d01
Author: Campbell Barton
Date:   Tue Apr 3 17:06:36 2018 +0200
Branches: master
https://developer.blender.org/rBb2c9fdfe871e2f1eaa6be30d67ad9df12c2f0d01

Cleanup: rename BMesh count_ex -> count_at_most

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

M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/bmesh/intern/bmesh_core.c
M	source/blender/bmesh/intern/bmesh_mods.c
M	source/blender/bmesh/intern/bmesh_private.h
M	source/blender/bmesh/intern/bmesh_queries.c
M	source/blender/bmesh/intern/bmesh_queries.h
M	source/blender/bmesh/intern/bmesh_structure.c
M	source/blender/bmesh/intern/bmesh_structure.h
M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 6b6f2605dc3..e32a5d0681e 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -555,9 +555,9 @@ static int pbvh_bmesh_node_vert_use_count(PBVH *bvh, PBVHNode *node, BMVert *v)
 #endif
 
 #define pbvh_bmesh_node_vert_use_count_is_equal(bvh, node, v, n) \
-	(pbvh_bmesh_node_vert_use_count_ex(bvh, node, v, (n) + 1) == n)
+	(pbvh_bmesh_node_vert_use_count_at_most(bvh, node, v, (n) + 1) == n)
 
-static int pbvh_bmesh_node_vert_use_count_ex(PBVH *bvh, PBVHNode *node, BMVert *v, const int count_max)
+static int pbvh_bmesh_node_vert_use_count_at_most(PBVH *bvh, PBVHNode *node, BMVert *v, const int count_max)
 {
 	int count = 0;
 	BMFace *f;
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index c4b29e91fb4..7e35866887d 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -685,7 +685,7 @@ int bmesh_elem_check(void *element, const char htype)
 						err |= IS_FACE_LOOP_WRONG_RADIAL_LENGTH;
 					}
 
-					if (bmesh_disk_count_ex(l_iter->v, 2) < 2) {
+					if (bmesh_disk_count_at_most(l_iter->v, 2) < 2) {
 						err |= IS_FACE_LOOP_WRONG_DISK_LENGTH;
 					}
 				}
@@ -1785,7 +1785,7 @@ BMEdge *bmesh_kernel_join_edge_kill_vert(
 		return NULL;
 	}
 	
-	if (bmesh_disk_count_ex(v_kill, 3) == 2) {
+	if (bmesh_disk_count_at_most(v_kill, 3) == 2) {
 #ifndef NDEBUG
 		int valence1, valence2;
 		BMLoop *l;
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 961cc458784..4290f94bba1 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -65,7 +65,7 @@
 bool BM_vert_dissolve(BMesh *bm, BMVert *v)
 {
 	/* logic for 3 or more is identical */
-	const int len = BM_vert_edge_count_ex(v, 3);
+	const int len = BM_vert_edge_count_at_most(v, 3);
 	
 	if (len == 1) {
 		BM_vert_kill(bm, v); /* will kill edges too */
diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h
index 4dcf97e3f35..daee22ffe76 100644
--- a/source/blender/bmesh/intern/bmesh_private.h
+++ b/source/blender/bmesh/intern/bmesh_private.h
@@ -55,7 +55,7 @@ int bmesh_elem_check(void *element, const char htype);
 #endif
 
 int bmesh_radial_length(const BMLoop *l);
-int bmesh_disk_count_ex(const BMVert *v, const int count_max);
+int bmesh_disk_count_at_most(const BMVert *v, const int count_max);
 int bmesh_disk_count(const BMVert *v);
 
 /**
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index 3a76f4ca271..ab2f017d103 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -799,9 +799,9 @@ int BM_vert_edge_count(const BMVert *v)
 	return bmesh_disk_count(v);
 }
 
-int BM_vert_edge_count_ex(const BMVert *v, const int count_max)
+int BM_vert_edge_count_at_most(const BMVert *v, const int count_max)
 {
-	return bmesh_disk_count_ex(v, count_max);
+	return bmesh_disk_count_at_most(v, count_max);
 }
 
 int BM_vert_edge_count_nonwire(const BMVert *v)
@@ -835,7 +835,7 @@ int BM_edge_face_count(const BMEdge *e)
 	return count;
 }
 
-int BM_edge_face_count_ex(const BMEdge *e, const int count_max)
+int BM_edge_face_count_at_most(const BMEdge *e, const int count_max)
 {
 	int count = 0;
 
@@ -863,9 +863,9 @@ int BM_vert_face_count(const BMVert *v)
 	return bmesh_disk_facevert_count(v);
 }
 
-int BM_vert_face_count_ex(const BMVert *v, int count_max)
+int BM_vert_face_count_at_most(const BMVert *v, int count_max)
 {
-	return bmesh_disk_facevert_count_ex(v, count_max);
+	return bmesh_disk_facevert_count_at_most(v, count_max);
 }
 
 /**
@@ -1044,7 +1044,7 @@ static int bm_loop_region_count__clear(BMLoop *l)
 /**
  * The number of loops connected to this loop (not including disconnected regions).
  */
-int BM_loop_region_loops_count_ex(BMLoop *l, int *r_loop_total)
+int BM_loop_region_loops_count_at_most(BMLoop *l, int *r_loop_total)
 {
 	const int count       = bm_loop_region_count__recursive(l->e, l->v);
 	const int count_total = bm_loop_region_count__clear(l);
@@ -1059,7 +1059,7 @@ int BM_loop_region_loops_count_ex(BMLoop *l, int *r_loop_total)
 
 int BM_loop_region_loops_count(BMLoop *l)
 {
-	return BM_loop_region_loops_count_ex(l, NULL);
+	return BM_loop_region_loops_count_at_most(l, NULL);
 }
 
 /**
@@ -1071,7 +1071,7 @@ bool BM_vert_is_manifold_region(const BMVert *v)
 	BMLoop *l_first = BM_vert_find_first_loop((BMVert *)v);
 	if (l_first) {
 		int count, count_total;
-		count = BM_loop_region_loops_count_ex(l_first, &count_total);
+		count = BM_loop_region_loops_count_at_most(l_first, &count_total);
 		return (count == count_total);
 	}
 	return true;
diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h
index c9fce96c798..e602c63da94 100644
--- a/source/blender/bmesh/intern/bmesh_queries.h
+++ b/source/blender/bmesh/intern/bmesh_queries.h
@@ -70,17 +70,17 @@ BMFace *BM_edge_pair_share_face_by_len(
         const bool allow_adjacent) ATTR_NONNULL();
 
 int     BM_vert_edge_count_nonwire(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-#define BM_vert_edge_count_is_equal(v, n) (BM_vert_edge_count_ex(v, (n) + 1) == n)
-#define BM_vert_edge_count_is_over(v, n) (BM_vert_edge_count_ex(v, (n) + 1) == (n) + 1)
-int     BM_vert_edge_count_ex(const BMVert *v, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+#define BM_vert_edge_count_is_equal(v, n) (BM_vert_edge_count_at_most(v, (n) + 1) == n)
+#define BM_vert_edge_count_is_over(v, n) (BM_vert_edge_count_at_most(v, (n) + 1) == (n) + 1)
+int     BM_vert_edge_count_at_most(const BMVert *v, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 int     BM_vert_edge_count(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-#define BM_edge_face_count_is_equal(e, n) (BM_edge_face_count_ex(e, (n) + 1) == n)
-#define BM_edge_face_count_is_over(e, n) (BM_edge_face_count_ex(e, (n) + 1) == (n) + 1)
-int     BM_edge_face_count_ex(const BMEdge *e, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+#define BM_edge_face_count_is_equal(e, n) (BM_edge_face_count_at_most(e, (n) + 1) == n)
+#define BM_edge_face_count_is_over(e, n) (BM_edge_face_count_at_most(e, (n) + 1) == (n) + 1)
+int     BM_edge_face_count_at_most(const BMEdge *e, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 int     BM_edge_face_count(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-#define BM_vert_face_count_is_equal(v, n) (BM_vert_face_count_ex(v, (n) + 1) == n)
-#define BM_vert_face_count_is_over(v, n) (BM_vert_face_count_ex(v, (n) + 1) == (n) + 1)
-int     BM_vert_face_count_ex(const BMVert *v, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+#define BM_vert_face_count_is_equal(v, n) (BM_vert_face_count_at_most(v, (n) + 1) == n)
+#define BM_vert_face_count_is_over(v, n) (BM_vert_face_count_at_most(v, (n) + 1) == (n) + 1)
+int     BM_vert_face_count_at_most(const BMVert *v, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 int     BM_vert_face_count(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
@@ -103,7 +103,7 @@ bool    BM_edge_is_contiguous_loop_cd(
         const int cd_loop_type, const int cd_loop_offset)
         ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
-int     BM_loop_region_loops_count_ex(BMLoop *l, int *r_loop_total) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+int     BM_loop_region_loops_count_at_most(BMLoop *l, int *r_loop_total) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
 int     BM_loop_region_loops_count(BMLoop *l) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
 bool    BM_loop_is_convex(const BMLoop *l) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index 8e484841568..8aa9502c0f7 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -244,7 +244,7 @@ int bmesh_disk_count(const BMVert *v)
 	return count;
 }
 
-int bmesh_disk_count_ex(const BMVert *v, const int count_max)
+int bmesh_disk_count_at_most(const BMVert *v, const int count_max)
 {
 	int count = 0;
 	if (v->e) {
@@ -267,7 +267,7 @@ bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v)
 	if (!BM_vert_in_edge(e, v)) {
 		return false;
 	}
-	if (len == 0 || bmesh_disk_count_ex(v, len + 1) != len) {
+	if (len == 0 || bmesh_disk_count_at_most(v, len + 1) != len) {
 		return false;
 	}
 
@@ -307,7 +307,7 @@ int bmesh_disk_facevert_count(const BMVert *v)
 	return count;
 }
 
-int bmesh_disk_facevert_count_ex(const BMVert *v, const int count_max)
+int bmesh_disk_facevert_count_at_most(const BMVert *v, const int count_max)
 {
 	/* is there an edge on this vert at all */
 	int count = 0;
@@ -318,7 +318,7 @@ int bmesh_disk_facevert_count_ex(const BMVert *v, const int count_max)
 		e_first = e_iter = v->e;
 		do {
 			if (e_iter->l) {
-				count += bmesh_radial_facevert_count_ex(e_iter->l, v, count_max - count);
+				count += bmesh_radial_facevert_count_at_most(e_iter->l, v, count_max - count);
 				if (count == count_max) {
 					break;
 				}
@@ -560,7 +560,7 @@ int bmesh_radial_facevert_count(const BMLoop *l, const BMVert *v)
 	return count;
 }
 
-int bmesh_radial_facevert_count_ex(const BMLoop *l, const BMVert *v, const int count_max)
+int bmesh_radial_facevert_count_at_most(const BMLoop *l, const BMVert *v, const int count_max)
 {
 	const BMLoop *l_iter;
 	int count = 0;
diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h
index 0efb25da37c..974b276f8b3 100644
--- a/source/blender/bmesh/intern/bmesh_structure.h
+++ b/source/blender/bmesh/intern/bmesh_structure.h
@@ -49,7 +49,7 @@ BLI_INLINE BMEdge *bmesh_disk_edge_next_safe(const BMEdge *e, const BMVert *v) A
 BLI_INLINE BMEdge *bmesh_d

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list