[Bf-blender-cvs] [89120cd2417] master: bmesh: use 'uint' instead of 'unsigned int'

Campbell Barton noreply at git.blender.org
Sat May 6 14:43:41 CEST 2017


Commit: 89120cd2417e2f6f39fa63ae18300bba0aefcfbd
Author: Campbell Barton
Date:   Sat May 6 14:18:31 2017 +1000
Branches: master
https://developer.blender.org/rB89120cd2417e2f6f39fa63ae18300bba0aefcfbd

bmesh: use 'uint' instead of 'unsigned int'

no functional changes.

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

M	source/blender/bmesh/bmesh_class.h
M	source/blender/bmesh/intern/bmesh_callback_generic.c
M	source/blender/bmesh/intern/bmesh_construct.c
M	source/blender/bmesh/intern/bmesh_edgeloop.c
M	source/blender/bmesh/intern/bmesh_iterators.h
M	source/blender/bmesh/intern/bmesh_log.c
M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/bmesh/intern/bmesh_mesh.h
M	source/blender/bmesh/intern/bmesh_mesh_conv.h
M	source/blender/bmesh/intern/bmesh_operators.c
M	source/blender/bmesh/intern/bmesh_operators.h
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/bmesh/intern/bmesh_polygon.h
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.h
M	source/blender/bmesh/intern/bmesh_private.h
M	source/blender/bmesh/intern/bmesh_queries.c
M	source/blender/bmesh/operators/bmo_connect.c
M	source/blender/bmesh/operators/bmo_connect_nonplanar.c
M	source/blender/bmesh/operators/bmo_dissolve.c
M	source/blender/bmesh/operators/bmo_dupe.c
M	source/blender/bmesh/operators/bmo_fill_attribute.c
M	source/blender/bmesh/operators/bmo_fill_grid.c
M	source/blender/bmesh/operators/bmo_fill_holes.c
M	source/blender/bmesh/operators/bmo_inset.c
M	source/blender/bmesh/operators/bmo_join_triangles.c
M	source/blender/bmesh/operators/bmo_primitive.c
M	source/blender/bmesh/operators/bmo_removedoubles.c
M	source/blender/bmesh/operators/bmo_smooth_laplacian.c
M	source/blender/bmesh/operators/bmo_subdivide_edgering.c
M	source/blender/bmesh/operators/bmo_triangulate.c
M	source/blender/bmesh/tools/bmesh_beautify.c
M	source/blender/bmesh/tools/bmesh_bisect_plane.c
M	source/blender/bmesh/tools/bmesh_decimate_collapse.c
M	source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
M	source/blender/bmesh/tools/bmesh_edgenet.c
M	source/blender/bmesh/tools/bmesh_edgesplit.c
M	source/blender/bmesh/tools/bmesh_intersect.c
M	source/blender/bmesh/tools/bmesh_path.h
M	source/blender/bmesh/tools/bmesh_region_match.c
M	source/blender/bmesh/tools/bmesh_region_match.h
M	source/blender/bmesh/tools/bmesh_separate.c

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

diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index 104df625ee6..64a5cad812a 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -225,7 +225,7 @@ typedef struct BMesh {
 	/* operator api stuff (must be all NULL or all alloc'd) */
 	struct BLI_mempool *vtoolflagpool, *etoolflagpool, *ftoolflagpool;
 
-	unsigned int use_toolflags : 1;
+	uint use_toolflags : 1;
 
 	int toolflag_index;
 	struct BMOperator *currentop;
@@ -382,7 +382,7 @@ typedef bool (*BMLoopFilterFunc)(const BMLoop *, void *user_data);
 	(assert(offset != -1), *((float *)((char *)(ele)->head.data + (offset))))
 
 #define BM_ELEM_CD_GET_FLOAT_AS_UCHAR(ele, offset) \
-	(assert(offset != -1), (unsigned char)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f))
+	(assert(offset != -1), (uchar)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f))
 
 /*forward declarations*/
 
diff --git a/source/blender/bmesh/intern/bmesh_callback_generic.c b/source/blender/bmesh/intern/bmesh_callback_generic.c
index 913255bfb33..e9304e8536f 100644
--- a/source/blender/bmesh/intern/bmesh_callback_generic.c
+++ b/source/blender/bmesh/intern/bmesh_callback_generic.c
@@ -32,7 +32,7 @@
 
 bool BM_elem_cb_check_hflag_ex(BMElem *ele, void *user_data)
 {
-	const unsigned int hflag_pair = GET_INT_FROM_POINTER(user_data);
+	const uint hflag_pair = GET_INT_FROM_POINTER(user_data);
 	const char hflag_p = (hflag_pair & 0xff);
 	const char hflag_n = (hflag_pair >> 8);
 
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index e46a31cb2e9..f8ecbe1756b 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -154,7 +154,7 @@ void BM_face_copy_shared(
 		if (l_other && l_other != l_iter) {
 			BMLoop *l_src[2];
 			BMLoop *l_dst[2] = {l_iter, l_iter->next};
-			unsigned int j;
+			uint j;
 
 			if (l_other->v == l_iter->v) {
 				l_src[0] = l_other;
@@ -311,7 +311,7 @@ BMFace *BM_face_create_ngon_verts(
         const bool calc_winding, const bool create_edges)
 {
 	BMEdge **edge_arr = BLI_array_alloca(edge_arr, len);
-	unsigned int winding[2] = {0, 0};
+	uint winding[2] = {0, 0};
 	int i, i_prev = len - 1;
 	BMVert *v_winding[2] = {vert_arr[i_prev], vert_arr[0]};
 
diff --git a/source/blender/bmesh/intern/bmesh_edgeloop.c b/source/blender/bmesh/intern/bmesh_edgeloop.c
index 5e1d9c3a98d..5780dc57d78 100644
--- a/source/blender/bmesh/intern/bmesh_edgeloop.c
+++ b/source/blender/bmesh/intern/bmesh_edgeloop.c
@@ -58,7 +58,7 @@ static int bm_vert_other_tag(
 {
 	BMIter iter;
 	BMEdge *e, *e_next = NULL;
-	unsigned int count = 0;
+	uint count = 0;
 
 	BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
 		if (BM_elem_flag_test(e, BM_ELEM_INTERNAL_TAG)) {
diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h
index 0551d824131..ab066682081 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.h
+++ b/source/blender/bmesh/intern/bmesh_iterators.h
@@ -211,12 +211,12 @@ void    *BMO_iter_as_arrayN(
 
 int BM_iter_mesh_bitmap_from_filter(
         const char itype, BMesh *bm,
-        unsigned int *bitmap,
+        uint *bitmap,
         bool (*test_fn)(BMElem *, void *user_data),
         void *user_data);
 int BM_iter_mesh_bitmap_from_filter_tessface(
         BMesh *bm,
-        unsigned int *bitmap,
+        uint *bitmap,
         bool (*test_fn)(BMFace *, void *user_data),
         void *user_data);
 
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index 2591c33fc73..1d16dbc1836 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -88,7 +88,7 @@ struct BMLog {
 
 	/* Mapping from unique IDs to vertices and faces
 	 *
-	 * Each vertex and face in the log gets a unique unsigned integer
+	 * Each vertex and face in the log gets a unique uinteger
 	 * assigned. That ID is taken from the set managed by the
 	 * unused_ids range tree.
 	 *
@@ -120,7 +120,7 @@ typedef struct {
 } BMLogVert;
 
 typedef struct {
-	unsigned int v_ids[3];
+	uint v_ids[3];
 	char hflag;
 } BMLogFace;
 
@@ -131,14 +131,14 @@ typedef struct {
 #define logkey_cmp BLI_ghashutil_intcmp
 
 /* Get the vertex's unique ID from the log */
-static unsigned int bm_log_vert_id_get(BMLog *log, BMVert *v)
+static uint bm_log_vert_id_get(BMLog *log, BMVert *v)
 {
 	BLI_assert(BLI_ghash_haskey(log->elem_to_id, v));
 	return GET_UINT_FROM_POINTER(BLI_ghash_lookup(log->elem_to_id, v));
 }
 
 /* Set the vertex's unique ID in the log */
-static void bm_log_vert_id_set(BMLog *log, BMVert *v, unsigned int id)
+static void bm_log_vert_id_set(BMLog *log, BMVert *v, uint id)
 {
 	void *vid = SET_UINT_IN_POINTER(id);
 	
@@ -147,7 +147,7 @@ static void bm_log_vert_id_set(BMLog *log, BMVert *v, unsigned int id)
 }
 
 /* Get a vertex from its unique ID */
-static BMVert *bm_log_vert_from_id(BMLog *log, unsigned int id)
+static BMVert *bm_log_vert_from_id(BMLog *log, uint id)
 {
 	void *key = SET_UINT_IN_POINTER(id);
 	BLI_assert(BLI_ghash_haskey(log->id_to_elem, key));
@@ -155,14 +155,14 @@ static BMVert *bm_log_vert_from_id(BMLog *log, unsigned int id)
 }
 
 /* Get the face's unique ID from the log */
-static unsigned int bm_log_face_id_get(BMLog *log, BMFace *f)
+static uint bm_log_face_id_get(BMLog *log, BMFace *f)
 {
 	BLI_assert(BLI_ghash_haskey(log->elem_to_id, f));
 	return GET_UINT_FROM_POINTER(BLI_ghash_lookup(log->elem_to_id, f));
 }
 
 /* Set the face's unique ID in the log */
-static void bm_log_face_id_set(BMLog *log, BMFace *f, unsigned int id)
+static void bm_log_face_id_set(BMLog *log, BMFace *f, uint id)
 {
 	void *fid = SET_UINT_IN_POINTER(id);
 
@@ -171,7 +171,7 @@ static void bm_log_face_id_set(BMLog *log, BMFace *f, unsigned int id)
 }
 
 /* Get a face from its unique ID */
-static BMFace *bm_log_face_from_id(BMLog *log, unsigned int id)
+static BMFace *bm_log_face_from_id(BMLog *log, uint id)
 {
 	void *key = SET_UINT_IN_POINTER(id);
 	BLI_assert(BLI_ghash_haskey(log->id_to_elem, key));
@@ -255,7 +255,7 @@ static void bm_log_verts_unmake(BMesh *bm, BMLog *log, GHash *verts)
 	GHASH_ITER (gh_iter, verts) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
 		BMLogVert *lv = BLI_ghashIterator_getValue(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 		BMVert *v = bm_log_vert_from_id(log, id);
 
 		/* Ensure the log has the final values of the vertex before
@@ -271,7 +271,7 @@ static void bm_log_faces_unmake(BMesh *bm, BMLog *log, GHash *faces)
 	GHashIterator gh_iter;
 	GHASH_ITER (gh_iter, faces) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 		BMFace *f = bm_log_face_from_id(log, id);
 		BMEdge *e_tri[3];
 		BMLoop *l_iter;
@@ -333,7 +333,7 @@ static void bm_log_vert_values_swap(BMesh *bm, BMLog *log, GHash *verts)
 	GHASH_ITER (gh_iter, verts) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
 		BMLogVert *lv = BLI_ghashIterator_getValue(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 		BMVert *v = bm_log_vert_from_id(log, id);
 		float mask;
 		short normal[3];
@@ -355,7 +355,7 @@ static void bm_log_face_values_swap(BMLog *log, GHash *faces)
 	GHASH_ITER (gh_iter, faces) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
 		BMLogFace *lf = BLI_ghashIterator_getValue(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 		BMFace *f = bm_log_face_from_id(log, id);
 
 		SWAP(char, f->head.hflag, lf->hflag);
@@ -374,13 +374,13 @@ static void bm_log_assign_ids(BMesh *bm, BMLog *log)
 
 	/* Generate vertex IDs */
 	BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
-		unsigned int id = range_tree_uint_take_any(log->unused_ids);
+		uint id = range_tree_uint_take_any(log->unused_ids);
 		bm_log_vert_id_set(log, v, id);
 	}
 
 	/* Generate face IDs */
 	BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
-		unsigned int id = range_tree_uint_take_any(log->unused_ids);
+		uint id = range_tree_uint_take_any(log->unused_ids);
 		bm_log_face_id_set(log, f, id);
 	}
 }
@@ -425,7 +425,7 @@ static void bm_log_id_ghash_retake(RangeTreeUInt *unused_ids, GHash *id_ghash)
 
 	GHASH_ITER (gh_iter, id_ghash) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 
 		range_tree_uint_retake(unused_ids, id);
 	}
@@ -433,8 +433,8 @@ static void bm_log_id_ghash_retake(RangeTreeUInt *unused_ids, GHash *id_ghash)
 
 static int uint_compare(const void *a_v, const void *b_v)
 {
-	const unsigned int *a = a_v;
-	const unsigned int *b = b_v;
+	const uint *a = a_v;
+	const uint *b = b_v;
 	return (*a) < (*b);
 }
 
@@ -446,10 +446,10 @@ static int uint_compare(const void *a_v, const void *b_v)
  *   10 -> 3
  *    3 -> 1
  */
-static GHash *bm_log_compress_ids_to_indices(unsigned int *ids, unsigned int totid)
+static GHash *bm_log_compress_ids_to_indices(uint *ids, uint totid)
 {
 	GHash *map = BLI_ghash_int_new_ex(__func__, totid);
-	unsigned int i;
+	uint i;
 
 	qsort(ids, totid, sizeof(*ids), uint_compare);
 
@@ -469,7 +469,7 @@ static void bm_log_id_ghash_release(BMLog *log, GHash *id_ghash)
 
 	GHASH_ITER (gh_iter, id_ghash) {
 		void *key = BLI_ghashIterator_getKey(&gh_iter);
-		unsigned int id = GET_UINT_FROM_POINTER(key);
+		uint id = GET_UINT_FROM_POINTER(key);
 		range_tree_uint_release(log->unused_ids, id);
 	}
 }
@@ -480,7 +480,7 @@ static void bm_log_id_ghash_release(BMLog *log, GHash *id_ghash)
 BMLog *BM_log_create(BMesh *bm)
 {
 	BMLog *log = MEM_callocN(sizeof(*log), __func__);
-	const unsigned int reserve_num = (unsigned int)(bm->totvert + bm->totface);
+	const uint reserve_num = (uint)(bm->totvert + bm->totface);
 
 	log->unused_ids = range_tree_uint_alloc(0, (unsigned)-1);
 	log->id_to_elem = BLI_ghash_new_ex(logkey_hash, logkey_cmp, __func__, reserve_num);
@@ -593,8 +593,8 @@ int BM_log_length(const BMLog *log)
 /* Apply a consistent ordering to BMesh vertices */
 void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log)
 {
-	un

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list