move alloca define into its own header since its not related to BLI_array
authorCampbell Barton <ideasman42@gmail.com>
Sun, 28 Jul 2013 10:38:25 +0000 (10:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 28 Jul 2013 10:38:25 +0000 (10:38 +0000)
31 files changed:
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifiers_bmesh.c
source/blender/blenlib/BLI_array.h
source/blender/blenlib/CMakeLists.txt
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_core.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/operators/bmo_connect.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_fill_holes.c
source/blender/bmesh/operators/bmo_subdivide_edgering.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_triangulate.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/modifiers/intern/MOD_mirror.c

index 7a7d4c7d24ac4a940985654ab30d21f90edb2cba..3422f783eeb017d14e25ab5050692cefcabc6ee8 100644 (file)
@@ -46,7 +46,6 @@
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 #include "BLI_memarena.h"
-#include "BLI_array.h"
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
 
index 001964087b8ba12a0581b8f38993fd07b6fac79b..4b05b0800a50c4ec6b3446d0a6101f72514d83bf 100644 (file)
@@ -39,8 +39,8 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
-#include "BLI_array.h"
 #include "BLI_blenlib.h"
+#include "BLI_alloca.h"
 #include "BLI_dynstr.h"
 
 #include "BLF_translation.h"
index 0e294f388386891b08e697558303dfc6bc412894..60f6bb0a7360a74cad179daeaf404d62e3bbc46c 100644 (file)
@@ -40,7 +40,6 @@
 #include "BLI_blenlib.h"
 #include "BLI_edgehash.h"
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_smallhash.h"
 #include "BLI_utildefines.h"
 #include "BLI_scanfill.h"
index 439965420f7352bbde6c21c840eeef4ab4285faa..095957b40d5a83788f08544922ffda35674c1823 100644 (file)
@@ -51,6 +51,7 @@
 #include "BLI_bitmap.h"
 #include "BLI_scanfill.h"
 #include "BLI_array.h"
+#include "BLI_alloca.h"
 
 #include "BKE_animsys.h"
 #include "BKE_main.h"
index a94daed11e3fbc190f3290f32160c52cff983d0b..290b0684e4047ea0656df99b7782e05399ea13ed 100644 (file)
  *  \ingroup bke
  */
 
-#include "BLI_math.h"
-
 #include "MEM_guardedalloc.h"
 
+#include "BLI_math.h"
+#include "BLI_alloca.h"
+
 #include "DNA_object_types.h"
 
-#include "BLI_array.h"
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_editmesh.h"
index 252b37d9aae1025ce5560e679e7f18399f1d10ea..c7b8521f9fa6bec63c14369a8c9555c8fd9b5831 100644 (file)
@@ -173,31 +173,4 @@ void _bli_array_grow_func(void **arr_p, const void *arr_static,
                MEM_freeN(arr);                                                       \
        } (void)0
 
-
-/* alloca */
-#ifdef _MSC_VER
-#  define alloca _alloca
-#endif
-
-#if defined(__MINGW32__)
-#  include <malloc.h>  /* mingw needs for alloca() */
-#endif
-
-#if defined(__GNUC__) || defined(__clang__)
-#define BLI_array_alloca(arr, realsize) \
-       (typeof(arr))alloca(sizeof(*arr) * (realsize))
-
-#define BLI_array_alloca_and_count(arr, realsize) \
-       (typeof(arr))alloca(sizeof(*arr) * (realsize));  \
-       const int _##arr##_count = (realsize)
-
-#else
-#define BLI_array_alloca(arr, realsize) \
-       alloca(sizeof(*arr) * (realsize))
-
-#define BLI_array_alloca_and_count(arr, realsize) \
-       alloca(sizeof(*arr) * (realsize));  \
-       const int _##arr##_count = (realsize)
-#endif
-
 #endif  /* __BLI_ARRAY_H__ */
index 1d94ca9afbca3a7cbfc9b5deaaa6476efd662266..b6b69116e67778b21880bcb10a5acebbb262151b 100644 (file)
@@ -99,6 +99,7 @@ set(SRC
        intern/winstuff.c
 
        BLI_args.h
+       BLI_alloca.h
        BLI_array.h
        BLI_bitmap.h
        BLI_blenlib.h
index 4d3653b1a82edd44170e3142aca157b5db7aa553..1f7ace1ba6dbf9aa20ae46e25f0241f200bb0f19 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 
 #include "BKE_customdata.h"
index eac4b304b12600af8772a50961ef905a8a7788db..f9e711a0dc3bf13f0fa3220e3d170111203878e3 100644 (file)
@@ -30,6 +30,7 @@
 #include "BLI_math_vector.h"
 #include "BLI_listbase.h"
 #include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_smallhash.h"
 
 #include "BLF_translation.h"
@@ -594,7 +595,7 @@ static void bm_kill_only_loop(BMesh *bm, BMLoop *l)
  */
 void BM_face_edges_kill(BMesh *bm, BMFace *f)
 {
-       BMEdge **edges = BLI_array_alloca_and_count(edges, f->len);
+       BMEdge **edges = BLI_array_alloca(edges, f->len);
        BMLoop *l_iter;
        BMLoop *l_first;
        int i = 0;
@@ -604,7 +605,7 @@ void BM_face_edges_kill(BMesh *bm, BMFace *f)
                edges[i++] = l_iter->e;
        } while ((l_iter = l_iter->next) != l_first);
        
-       for (i = 0; i < BLI_array_count(edges); i++) {
+       for (i = 0; i < f->len; i++) {
                BM_edge_kill(bm, edges[i]);
        }
 }
@@ -615,7 +616,7 @@ void BM_face_edges_kill(BMesh *bm, BMFace *f)
  */
 void BM_face_verts_kill(BMesh *bm, BMFace *f)
 {
-       BMVert **verts = BLI_array_alloca_and_count(verts, f->len);
+       BMVert **verts = BLI_array_alloca(verts, f->len);
        BMLoop *l_iter;
        BMLoop *l_first;
        int i = 0;
@@ -625,7 +626,7 @@ void BM_face_verts_kill(BMesh *bm, BMFace *f)
                verts[i++] = l_iter->v;
        } while ((l_iter = l_iter->next) != l_first);
        
-       for (i = 0; i < BLI_array_count(verts); i++) {
+       for (i = 0; i < f->len; i++) {
                BM_vert_kill(bm, verts[i]);
        }
 }
index 446d32de5d2805cafff575ab50691651456dc8d4..3e8a49a01fcdf4e53b27226c0cd3fd6bc97f6c42 100644 (file)
@@ -36,7 +36,7 @@
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 
 #include "BKE_customdata.h"
index 184fed59f011204e14f7854c537ae637b9018416..81d4aad0fdfd58c5f2515fff14c8be3e7b610db4 100644 (file)
@@ -84,7 +84,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_listbase.h"
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math_vector.h"
 
 #include "BKE_mesh.h"
index e0268d6b504fc3c05a94cb404461dd0ef810f0fa..269501e1f02182cea052a7db80e4bccf87b46338 100644 (file)
@@ -34,7 +34,6 @@
 #include "BLI_memarena.h"
 #include "BLI_mempool.h"
 #include "BLI_listbase.h"
-#include "BLI_array.h"
 
 #include "BLF_translation.h"
 
index 1ecb3c2b9acfcf10a044b78c05261ede491dc931..297458eb1d698b925b51459544eb88c9a0906794 100644 (file)
@@ -32,8 +32,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_alloca.h"
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_scanfill.h"
 #include "BLI_listbase.h"
 
index 9dc5ae61d6136b1c251135167d00a938c3f60989..de601b1905267bf12eb8c4726bd33ce2737023fb 100644 (file)
@@ -33,8 +33,8 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_array.h"
 #include "BLI_math.h"
+#include "BLI_alloca.h"
 
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
index 50588ad70a921659ee7a3a38fd7f4d1444cb9e4a..c718cac4bd6f8edaa799be29c200ae6b19c1360c 100644 (file)
@@ -29,8 +29,8 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_utildefines.h"
+#include "BLI_alloca.h"
 
 #include "bmesh.h"
 
index 59e018eccf136c22a7fd086fe79eae5649b50920..f9ff308b706d6ac3204c0b24879a3e96a6eb8975 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_array.h"
 #include "BLI_math.h"
+#include "BLI_alloca.h"
 
 #include "bmesh.h"
 
index dca864452196de58a3093a23395a9c09c8a688ea..40a682e790d7c14d85b174888142e4f21031b34b 100644 (file)
@@ -29,7 +29,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_listbase.h"
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 
 #include "bmesh.h"
index f69d2f27346ea8b2261588921cf7051d87a0d22a..9cc418d61ede6d3d1539b3fccd031aebdeb20e5b 100644 (file)
@@ -40,7 +40,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 #include "BLI_listbase.h"
 
index 85bd8a853765e900b8438bbcf8cb2d3d88b1bdbc..fb1e8ec6a1730e2776432dfa2355a5d693024944 100644 (file)
@@ -32,8 +32,8 @@
 #include "DNA_meshdata_types.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_heap.h"
+#include "BLI_alloca.h"
 
 #include "BKE_customdata.h"
 
index 6431b6b7cf5f64b89bec70e21f1198791d8ae8d7..02f0251bff23fe0757367b9bdf5ff021c7b00e68 100644 (file)
@@ -34,6 +34,7 @@
 #include "DNA_meshdata_types.h"
 
 #include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 #include "BLI_memarena.h"
 
index 79f6c76afc70337594d985aeab1e3eb2ee14cc47..2eacf62d68ab5bf563b590d4721dde4382131cf2 100644 (file)
@@ -30,7 +30,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 
 #include "bmesh.h"
 
index 9440a67c7f4aadee9e12aa752e2d0353dbe5aac9..d61f6712a8f6a06d3c6d85b9064142139bdb6cde 100644 (file)
@@ -38,6 +38,7 @@
 #include "BLI_listbase.h"
 #include "BLI_string.h"
 #include "BLI_array.h"
+#include "BLI_alloca.h"
 #include "BLI_linklist.h"
 #include "BLI_math.h"
 #include "BLI_smallhash.h"
index 3a3a734eef03201c169ce9907234a2d0016016e9..44cc89cb23cf62948cd083d10ab30e3b0d8eb03a 100644 (file)
@@ -35,7 +35,7 @@
 #include "DNA_object_types.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
+#include "BLI_alloca.h"
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_context.h"
index 52a8ccc4aabc9607fd7134519d499d47d32d66b2..e8cbf0926d4da902b95793ae48917b0b42df6c5c 100644 (file)
@@ -37,8 +37,8 @@
 #include "DNA_view3d_types.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_alloca.h"
 #include "BLI_path_util.h"
-#include "BLI_array.h"
 #include "BLI_math.h"
 
 #include "BKE_context.h"
index e44b9620b6f927bb0187f4bb8bfd8789da25e717..c2ca8cd46b6b04bfaa7f788e90b56b176198c1b7 100644 (file)
@@ -59,7 +59,6 @@
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_array.h"
 #include "BLI_utildefines.h"
 #include "BLI_smallhash.h"
 
index ef22f4a484cb66eb0ed2e96811f118b5a71643e4..a873702b5b8de19b8ec09894d0f9348288cb5d34 100644 (file)
@@ -49,7 +49,6 @@
 #include "BKE_mesh.h"
 #include "BKE_editmesh.h"
 
-#include "BLI_array.h"
 #include "BLI_buffer.h"
 
 #include "BIF_gl.h"
index 0f7caf126d333a8ab160ad5d4e6a6cf26fcaf64c..0b514e3f6fd00c3853f87712066ba0738426ce69 100644 (file)
 #include "DNA_space_types.h"
 #include "DNA_scene_types.h"
 
+#include "BLI_utildefines.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 #include "BLI_lasso.h"
 #include "BLI_blenlib.h"
 #include "BLI_array.h"
-#include "BLI_utildefines.h"
 
 #include "BKE_context.h"
 #include "BKE_customdata.h"
index 18f4e8cafaf0ee9b10c690cdce98b0c829070dcf..7851eebe269115f4bd4359546ac3252e4f6ab151 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_array.h"
+#include "BLI_utildefines.h"
+#include "BLI_alloca.h"
 #include "BLI_memarena.h"
 #include "BLI_math.h"
 #include "BLI_rand.h"
 #include "BLI_heap.h"
 #include "BLI_boxpack2d.h"
-#include "BLI_utildefines.h"
-
-
 
 #include "ONL_opennl.h"
 
index a100757980c23f8e4520284b61f481df685352a4..af6689e3f6d5f3476ce38852ad3fbf62197369f8 100644 (file)
@@ -44,6 +44,7 @@
 #include "DNA_modifier_types.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_alloca.h"
 #include "BLI_math.h"
 #include "BLI_edgehash.h"
 #include "BLI_uvproject.h"
@@ -65,7 +66,6 @@
 #include "BLI_math.h"
 #include "BLI_edgehash.h"
 #include "BLI_scanfill.h"
-#include "BLI_array.h"
 #include "BLI_uvproject.h"
 
 #include "PIL_time.h"
index 51aad755e77eec2031e4d69dcb5b655bfbf7590f..35d8a0fb43378e505291e1d0a94d4b1ef92cc966 100644 (file)
@@ -37,7 +37,6 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 
-#include "BLI_array.h"
 #include "BLI_math_base.h"
 #include "BLI_math_rotation.h"
 #include "BLI_utildefines.h"
index d50e69217f6e9859263d3115c14765ef055efc3a..1b9fcd9f34ec327866204b88c48d8443b4d57966 100644 (file)
@@ -37,7 +37,6 @@
 #include "DNA_object_types.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_mesh.h"