[Bf-blender-cvs] [c04f301] master: Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc)

Campbell Barton noreply at git.blender.org
Sat Jul 12 08:49:59 CEST 2014


Commit: c04f301fc3bf5a21413bb0962c199f8eb49fbdaf
Author: Campbell Barton
Date:   Sat Jul 12 16:48:52 2014 +1000
https://developer.blender.org/rBc04f301fc3bf5a21413bb0962c199f8eb49fbdaf

Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc)

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

M	source/blender/blenkernel/intern/mesh_evaluate.c
M	source/blender/blenlib/BLI_linklist_stack.h
M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/screen/area.c

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

diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index a9462ae..83b6d6c 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -578,8 +578,6 @@ void BKE_mesh_normals_loop_split(MVert *mverts, const int UNUSED(numVerts), MEdg
 		}
 	}
 
-	BLI_SMALLSTACK_FREE(normal);
-
 	MEM_freeN(edge_to_loops);
 	MEM_freeN(loop_to_poly);
 
diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h
index 84e7130..17d40e0 100644
--- a/source/blender/blenlib/BLI_linklist_stack.h
+++ b/source/blender/blenlib/BLI_linklist_stack.h
@@ -116,6 +116,9 @@
 #  define _BLI_SMALLSTACK_CAST(var)
 #endif
 
+#define _BLI_SMALLSTACK_FAKEUSER(var) \
+	(void)(&(_##var##_type))
+
 #define BLI_SMALLSTACK_DECLARE(var, type) \
 	LinkNode *_##var##_stack = NULL, *_##var##_free = NULL, *_##var##_temp = NULL; \
 	type _##var##_type
@@ -133,11 +136,14 @@
 	_##var##_temp->next = _##var##_stack; \
 	_##var##_temp->link = data; \
 	_##var##_stack = _##var##_temp; \
+	_BLI_SMALLSTACK_FAKEUSER(var); \
 } (void)0
 
 /* internal use, no null check */
 #define _BLI_SMALLSTACK_DEL_EX(var_src, var_dst) \
-	(void)((_##var_src##_temp = _##var_src##_stack->next), \
+	(void)(_BLI_SMALLSTACK_FAKEUSER(var_src), \
+	       _BLI_SMALLSTACK_FAKEUSER(var_dst), \
+	       (_##var_src##_temp = _##var_src##_stack->next), \
 	       (_##var_src##_stack->next = _##var_dst##_free), \
 	       (_##var_dst##_free = _##var_src##_stack), \
 	       (_##var_src##_stack = _##var_src##_temp)) \
@@ -180,10 +186,6 @@
 	SWAP(LinkNode *, _##var_a##_free, _##var_b##_free); \
 } (void)0
 
-#define BLI_SMALLSTACK_FREE(var)  { \
-	(void)&(_##var##_type); \
-} (void)0
-
 /** \} */
 
 #endif  /* __BLI_LINKLIST_STACK_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index c996a5b..a9e6dad 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -648,8 +648,6 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*vcos)[3], const
 			}
 		} while ((l_curr = l_curr->next) != l_first);
 	}
-
-	BLI_SMALLSTACK_FREE(normal);
 }
 
 #if 0  /* Unused currently */
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index ccc3e2e..9d27cf2 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -2301,7 +2301,6 @@ static void vgroup_blend_subset(Object *ob, const bool *vgroup_validmap, const i
 
 	if (dvert_array)
 		MEM_freeN(dvert_array);
-	BLI_SMALLSTACK_FREE(dv_stack);
 
 	/* not so efficient to get 'dvert_array' again just so unselected verts are NULL'd */
 	if (use_mirror) {
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 1727f38..400dd6f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1766,9 +1766,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
 			break;
 		}
 	}
-	
-	BLI_SMALLSTACK_FREE(pt_stack);
-	
+
 	/* clear */
 	if (ar->overlap) {
 		/* view should be in pixelspace */




More information about the Bf-blender-cvs mailing list