[Bf-blender-cvs] [9269574] master: Quiet warnings w/ USE_VERIFY define

Campbell Barton noreply at git.blender.org
Mon Jul 4 06:59:37 CEST 2016


Commit: 9269574089a742130f02c0a1184a19d94f0e665d
Author: Campbell Barton
Date:   Mon Jul 4 14:55:29 2016 +1000
Branches: master
https://developer.blender.org/rB9269574089a742130f02c0a1184a19d94f0e665d

Quiet warnings w/ USE_VERIFY define

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

M	source/blender/blenkernel/intern/pbvh_bmesh.c

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

diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 88dc63d..87d22d0 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1909,17 +1909,22 @@ static void pbvh_bmesh_verify(PBVH *bvh)
 {
 	/* build list of faces & verts to lookup */
 	GSet *faces_all = BLI_gset_ptr_new_ex(__func__, bvh->bm->totface);
-	BMFace *f;
 	BMIter iter;
-	BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
-		BLI_gset_insert(faces_all, f);
+
+	{
+		BMFace *f;
+		BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
+			BLI_gset_insert(faces_all, f);
+		}
 	}
 
 	GSet *verts_all = BLI_gset_ptr_new_ex(__func__, bvh->bm->totvert);
-	BMVert *v;
-	BM_ITER_MESH(v, &iter, bvh->bm, BM_VERTS_OF_MESH) {
-		if (BM_ELEM_CD_GET_INT(v, bvh->cd_vert_node_offset) != DYNTOPO_NODE_NONE) {
-			BLI_gset_insert(verts_all, v);
+	{
+		BMVert *v;
+		BM_ITER_MESH(v, &iter, bvh->bm, BM_VERTS_OF_MESH) {
+			if (BM_ELEM_CD_GET_INT(v, bvh->cd_vert_node_offset) != DYNTOPO_NODE_NONE) {
+				BLI_gset_insert(verts_all, v);
+			}
 		}
 	}
 
@@ -1936,76 +1941,83 @@ static void pbvh_bmesh_verify(PBVH *bvh)
 		BLI_assert(totvert == BLI_gset_size(verts_all));
 	}
 
-	BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
-		BMIter bm_iter;
-		BMVert *v;
-		PBVHNode *n = pbvh_bmesh_node_lookup(bvh, f);
+	{
+		BMFace *f;
+		BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
+			BMIter bm_iter;
+			BMVert *v;
+			PBVHNode *n = pbvh_bmesh_node_lookup(bvh, f);
 
-		/* Check that the face's node is a leaf */
-		BLI_assert(n->flag & PBVH_Leaf);
+			/* Check that the face's node is a leaf */
+			BLI_assert(n->flag & PBVH_Leaf);
 
-		/* Check that the face's node knows it owns the face */
-		BLI_assert(BLI_gset_haskey(n->bm_faces, f));
+			/* Check that the face's node knows it owns the face */
+			BLI_assert(BLI_gset_haskey(n->bm_faces, f));
 
-		/* Check the face's vertices... */
-		BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
-			PBVHNode *nv;
+			/* Check the face's vertices... */
+			BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) {
+				PBVHNode *nv;
 
-			/* Check that the vertex is in the node */
-			BLI_assert(BLI_gset_haskey(n->bm_unique_verts, v) ^
-			           BLI_gset_haskey(n->bm_other_verts, v));
+				/* Check that the vertex is in the node */
+				BLI_assert(BLI_gset_haskey(n->bm_unique_verts, v) ^
+				           BLI_gset_haskey(n->bm_other_verts, v));
 
-			/* Check that the vertex has a node owner */
-			nv = pbvh_bmesh_node_lookup(bvh, v);
+				/* Check that the vertex has a node owner */
+				nv = pbvh_bmesh_node_lookup(bvh, v);
 
-			/* Check that the vertex's node knows it owns the vert */
-			BLI_assert(BLI_gset_haskey(nv->bm_unique_verts, v));
+				/* Check that the vertex's node knows it owns the vert */
+				BLI_assert(BLI_gset_haskey(nv->bm_unique_verts, v));
 
-			/* Check that the vertex isn't duplicated as an 'other' vert */
-			BLI_assert(!BLI_gset_haskey(nv->bm_other_verts, v));
+				/* Check that the vertex isn't duplicated as an 'other' vert */
+				BLI_assert(!BLI_gset_haskey(nv->bm_other_verts, v));
+			}
 		}
 	}
 
 	/* Check verts */
-	BM_ITER_MESH(v, &iter, bvh->bm, BM_VERTS_OF_MESH) {
-		/* vertex isn't tracked */
-		if (BM_ELEM_CD_GET_INT(v, bvh->cd_vert_node_offset) == DYNTOPO_NODE_NONE) {
-			continue;
-		}
+	{
+		BMVert *v;
+		BM_ITER_MESH(v, &iter, bvh->bm, BM_VERTS_OF_MESH) {
+			/* vertex isn't tracked */
+			if (BM_ELEM_CD_GET_INT(v, bvh->cd_vert_node_offset) == DYNTOPO_NODE_NONE) {
+				continue;
+			}
 
-		PBVHNode *n = pbvh_bmesh_node_lookup(bvh, v);
+			PBVHNode *n = pbvh_bmesh_node_lookup(bvh, v);
 
-		/* Check that the vert's node is a leaf */
-		BLI_assert(n->flag & PBVH_Leaf);
+			/* Check that the vert's node is a leaf */
+			BLI_assert(n->flag & PBVH_Leaf);
 
-		/* Check that the vert's node knows it owns the vert */
-		BLI_assert(BLI_gset_haskey(n->bm_unique_verts, v));
+			/* Check that the vert's node knows it owns the vert */
+			BLI_assert(BLI_gset_haskey(n->bm_unique_verts, v));
 
-		/* Check that the vertex isn't duplicated as an 'other' vert */
-		BLI_assert(!BLI_gset_haskey(n->bm_other_verts, v));
+			/* Check that the vertex isn't duplicated as an 'other' vert */
+			BLI_assert(!BLI_gset_haskey(n->bm_other_verts, v));
 
-		/* Check that the vert's node also contains one of the vert's
-		 * adjacent faces */
-		bool found = false;
-		BMIter bm_iter;
-		BM_ITER_ELEM (f, &bm_iter, v, BM_FACES_OF_VERT) {
-			if (pbvh_bmesh_node_lookup(bvh, f) == n) {
-				found = true;
-				break;
+			/* Check that the vert's node also contains one of the vert's
+			 * adjacent faces */
+			bool found = false;
+			BMIter bm_iter;
+			BMFace *f;
+			BM_ITER_ELEM (f, &bm_iter, v, BM_FACES_OF_VERT) {
+				if (pbvh_bmesh_node_lookup(bvh, f) == n) {
+					found = true;
+					break;
+				}
 			}
-		}
-		BLI_assert(found);
+			BLI_assert(found);
 
 #if 1
-		/* total freak stuff, check if node exists somewhere else */
-		/* Slow */
-		for (int i = 0; i < bvh->totnode; i++) {
-			PBVHNode *n_other = &bvh->nodes[i];
-			if ((n != n_other) && (n_other->bm_unique_verts)) {
-				BLI_assert(!BLI_gset_haskey(n_other->bm_unique_verts, v));
+			/* total freak stuff, check if node exists somewhere else */
+			/* Slow */
+			for (int i = 0; i < bvh->totnode; i++) {
+				PBVHNode *n_other = &bvh->nodes[i];
+				if ((n != n_other) && (n_other->bm_unique_verts)) {
+					BLI_assert(!BLI_gset_haskey(n_other->bm_unique_verts, v));
+				}
 			}
-		}
 #endif
+		}
 	}
 
 #if 0




More information about the Bf-blender-cvs mailing list