Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 12 Jul 2014 06:48:52 +0000 (16:48 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 12 Jul 2014 06:48:52 +0000 (16:48 +1000)
source/blender/blenkernel/intern/mesh_evaluate.c
source/blender/blenlib/BLI_linklist_stack.h
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/screen/area.c

index a9462aefa25153ff5d0b0e65bdef9931b31b3d1b..83b6d6c61d6838ea117f5fef8e26dcb6a28fa849 100644 (file)
@@ -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);
 
index 84e7130a9620527815d1b895fd147fa0cda8be77..17d40e068b3c4ef332743c6c4dcacd0e04ced11c 100644 (file)
 #  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
        _##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)) \
        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__ */
index c996a5bb6a850fca91faa383a9bf878ea8f0fe92..a9e6dad7fd09ea3ec7bbef1fa021ef2df621772b 100644 (file)
@@ -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 */
index ccc3e2e8278b0e5c13c6985344c7ee1adb9d0e55..9d27cf2419738a12437d7f6be4bb23d9acb2e0cd 100644 (file)
@@ -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) {
index 1727f38c4b3ff34cdee09b5eacf3614bf5c45498..400dd6fc28ecb0c36b24820e0f9900ae80c12a57 100644 (file)
@@ -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 */