code cleanup: move bmesh inline funcs to headers (avoids compiling the C files).
authorCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 01:24:58 +0000 (01:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 01:24:58 +0000 (01:24 +0000)
28 files changed:
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenlib/BLI_math_inline.h
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/bmesh.h
source/blender/bmesh/intern/bmesh_inline.h [moved from source/blender/bmesh/intern/bmesh_inline.c with 96% similarity]
source/blender/bmesh/intern/bmesh_iterators.c
source/blender/bmesh/intern/bmesh_iterators.h
source/blender/bmesh/intern/bmesh_iterators_inline.h [moved from source/blender/bmesh/intern/bmesh_iterators_inline.c with 95% similarity]
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mesh_validate.c
source/blender/bmesh/intern/bmesh_opdefines.c
source/blender/bmesh/intern/bmesh_operator_api_inline.h [moved from source/blender/bmesh/intern/bmesh_operator_api_inline.c with 95% similarity]
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/intern/bmesh_structure.c
source/blender/bmesh/intern/bmesh_walkers.c
source/blender/bmesh/intern/bmesh_walkers_impl.c
source/blender/bmesh/operators/bmo_connect.c
source/blender/bmesh/operators/bmo_edgesplit.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/util/crazyspace.c
source/blender/makesrna/intern/rna_object.c
source/blender/python/bmesh/bmesh_py_api.c
source/blender/python/bmesh/bmesh_py_types_select.c
source/blender/python/bmesh/bmesh_py_utils.c

index 3fef781..7b0baf6 100644 (file)
 
 #include "GL/glew.h"
 
-#include "BKE_cdderivedmesh.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_paint.h"
-#include "BKE_utildefines.h"
-#include "BKE_tessmesh.h"
-
 #include "BLI_scanfill.h"
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
@@ -57,7 +50,8 @@
 #include "BKE_global.h"
 #include "BKE_mesh.h"
 #include "BKE_paint.h"
-
+#include "BKE_utildefines.h"
+#include "BKE_tessmesh.h"
 
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
index fcc5fb7..ce43d5f 100644 (file)
@@ -38,21 +38,21 @@ extern "C" {
 #define __BLI_MATH_INLINE_H__
 
 #ifdef __BLI_MATH_INLINE_H__
-#ifdef _MSC_VER
-#define MINLINE static __forceinline
-#define MALWAYS_INLINE MINLINE
+#  ifdef _MSC_VER
+#    define MINLINE static __forceinline
+#    define MALWAYS_INLINE MINLINE
+#  else
+#    define MINLINE static inline
+#    if (defined(__APPLE__) && defined(__ppc__))
+       /* static inline __attribute__ here breaks osx ppc gcc42 build */
+#      define MALWAYS_INLINE static __attribute__((always_inline))
+#    else
+#      define MALWAYS_INLINE static inline __attribute__((always_inline))
+#    endif
+#  endif
 #else
-#define MINLINE static inline
-#if (defined(__APPLE__) && defined(__ppc__))
-/* static inline __attribute__ here breaks osx ppc gcc42 build */
-#define MALWAYS_INLINE static __attribute__((always_inline))
-#else
-#define MALWAYS_INLINE static inline __attribute__((always_inline))
-#endif
-#endif
-#else
-#define MINLINE
-#define MALWAYS_INLINE
+#  define MINLINE
+#  define MALWAYS_INLINE
 #endif
 
 #ifdef __cplusplus
@@ -60,4 +60,3 @@ extern "C" {
 #endif
 
 #endif /* __BLI_MATH_INLINE_H__ */
-
index eaa0df4..3dc10c5 100644 (file)
@@ -56,12 +56,12 @@ set(SRC
        intern/bmesh_construct.h
        intern/bmesh_core.c
        intern/bmesh_core.h
-       intern/bmesh_inline.c
+       intern/bmesh_inline.h
        intern/bmesh_interp.c
        intern/bmesh_interp.h
        intern/bmesh_iterators.c
        intern/bmesh_iterators.h
-       intern/bmesh_iterators_inline.c
+       intern/bmesh_iterators_inline.h
        intern/bmesh_marking.c
        intern/bmesh_marking.h
        intern/bmesh_mesh.c
@@ -73,7 +73,7 @@ set(SRC
        intern/bmesh_mods.c
        intern/bmesh_mods.h
        intern/bmesh_opdefines.c
-       intern/bmesh_operator_api_inline.c
+       intern/bmesh_operator_api_inline.h
        intern/bmesh_operators.c
        intern/bmesh_operators.h
        intern/bmesh_operators_private.h
index a7f66bb..81bd164 100644 (file)
 extern "C" {
 #endif
 
-#include "DNA_listBase.h"
-#include "DNA_customdata_types.h"
+#include "DNA_listBase.h" /* selection history uses */
+#include "DNA_customdata_types.h" /* BMesh struct in bmesh_class.h uses */
 
 #include <stdlib.h>
-#include "BLI_utildefines.h"
+// #include "BLI_utildefines.h"
 
 #include "bmesh_class.h"
 
@@ -224,8 +224,7 @@ extern "C" {
 #include "intern/bmesh_queries.h"
 #include "intern/bmesh_walkers.h"
 
-#include "intern/bmesh_inline.c"
-#include "intern/bmesh_operator_api_inline.c"
+#include "intern/bmesh_inline.h"
 
 #ifdef __cplusplus
 }
similarity index 96%
rename from source/blender/bmesh/intern/bmesh_inline.c
rename to source/blender/bmesh/intern/bmesh_inline.h
index c9e4875..6b52932 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/bmesh/intern/bmesh_inline.c
+/** \file blender/bmesh/intern/bmesh_inline.h
  *  \ingroup bmesh
  *
  * BM Inline functions.
  */
 
-#ifndef __BMESH_INLINE_C__
-#define __BMESH_INLINE_C__
-
-#include "bmesh.h"
+#ifndef __BMESH_INLINE_H__
+#define __BMESH_INLINE_H__
 
 /* stuff for dealing with header flags */
 #define BM_elem_flag_test(   ele, hflag)      _bm_elem_flag_test    (&(ele)->head, hflag)
@@ -113,4 +111,4 @@ BLI_INLINE int _bm_elem_index_get(const BMHeader *head)
        return head->index;
 }
 
-#endif /* __BMESH_INLINE_C__ */
+#endif /* __BMESH_INLINE_H__ */
index e58e989..b53896a 100644 (file)
@@ -28,6 +28,7 @@
  * See: bmesh_iterators_inlin.c too, some functions are here for speed reasons.
  */
 
+#include "BLI_utildefines.h"
 
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
index 7b13d2d..d3566d8 100644 (file)
@@ -143,6 +143,6 @@ void *bmiter__edge_of_face_step(struct BMIter *iter);
 void  bmiter__loop_of_face_begin(struct BMIter *iter);
 void *bmiter__loop_of_face_step(struct BMIter *iter);
 
-#include "intern/bmesh_iterators_inline.c"
+#include "intern/bmesh_iterators_inline.h"
 
 #endif /* __BMESH_ITERATORS_H__ */
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/bmesh/intern/bmesh_iterators_inline.c
+/** \file blender/bmesh/intern/bmesh_iterators_inline.h
  *  \ingroup bmesh
  *
  * BMesh inline iterator functions.
  */
 
-#ifndef __BMESH_ITERATORS_INLINE_C__
-#define __BMESH_ITERATORS_INLINE_C__
-
-#include "bmesh.h"
+#ifndef __BMESH_ITERATORS_INLINE_H__
+#define __BMESH_ITERATORS_INLINE_H__
 
 /* inline here optimizes out the switch statement when called with
  * constant values (which is very common), nicer for loop-in-loop situations */
@@ -189,4 +187,4 @@ BLI_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *da
        }
 }
 
-#endif /* __BMESH_ITERATORS_INLINE_C__ */
+#endif /* __BMESH_ITERATORS_INLINE_H__ */
index 16214d5..1e478b9 100644 (file)
  * BM mesh conversion functions.
  */
 
-
-#include "bmesh.h"
-#include "intern/bmesh_private.h" /* for element checking */
-
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_key_types.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "BLI_listbase.h"
 #include "BLI_array.h"
 #include "BLI_math_vector.h"
@@ -46,7 +44,8 @@
 #include "BKE_global.h" /* ugh - for looping over all objects */
 #include "BKE_main.h"
 
-#include "MEM_guardedalloc.h"
+#include "bmesh.h"
+#include "intern/bmesh_private.h" /* for element checking */
 
 /* Mesh -> BMesh */
 void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
index aa49a84..0ec13f1 100644 (file)
@@ -32,6 +32,8 @@
 /* debug builds only */
 #ifdef DEBUG
 
+#include "BLI_utildefines.h"
+
 #include "bmesh.h"
 
 #include "bmesh_mesh_validate.h"
index cf114d3..5162932 100644 (file)
@@ -54,6 +54,8 @@
  *
  */
 
+#include "BLI_utildefines.h"
+
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/bmesh/intern/bmesh_operator_api_inline.c
+/** \file blender/bmesh/intern/bmesh_operator_api_inline.h
  *  \ingroup bmesh
  *
  * BMesh inline operator functions.
  */
 
-#ifndef __BMESH_OPERATOR_API_INLINE_C__
-#define __BMESH_OPERATOR_API_INLINE_C__
-
-#include "bmesh.h"
-
+#ifndef __BMESH_OPERATOR_API_INLINE_H__
+#define __BMESH_OPERATOR_API_INLINE_H__
 
 /* tool flag API. never, ever ever should tool code put junk in
  * header flags (element->head.flag), nor should they use
@@ -146,4 +143,4 @@ BLI_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slo
        return NULL;
 }
 
-#endif /* __BMESH_OPERATOR_API_INLINE_C__ */
+#endif /* __BMESH_OPERATOR_API_INLINE_H__ */
index 52525da..af62e4d 100644 (file)
@@ -94,4 +94,6 @@ void BM_mesh_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float sm
                             float fractal, int beauty, int numcuts, int seltype,
                             int cornertype, int singleedge, int gridfill, int seed);
 
+#include "intern/bmesh_operator_api_inline.h"
+
 #endif /* __BMESH_OPERATORS_H__ */
index eca90e8..2781555 100644 (file)
  * Low level routines for manipulating the BM structure.
  */
 
+#include "BLI_utildefines.h"
+
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
-#include <stdlib.h>
-
 /**
  *     MISC utility functions.
  */
index bf64682..69ab7a9 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <string.h> /* for memcpy */
 
+#include "BLI_utildefines.h"
 #include "BLI_listbase.h"
 
 #include "bmesh.h"
index b361a0d..d996d75 100644 (file)
  * BMesh Walker Code.
  */
 
+#include "BLI_utildefines.h"
+
 #include "BKE_customdata.h"
 
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
-#include "bmesh_walkers_private.h"
+#include "intern/bmesh_walkers_private.h"
 
 /**
  * Shell Walker:
index 708fe2f..e135473 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-
-#include "bmesh.h"
-
 #include "BLI_math.h"
 #include "BLI_array.h"
+#include "BLI_utildefines.h"
+
+#include "bmesh.h"
 
 #define VERT_INPUT     1
 #define EDGE_OUT       1
index b21082c..0da44dc 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_utildefines.h"
+
 #include "bmesh.h"
 
 #include "intern/bmesh_operators_private.h" /* own include */
index 139176e..78d02ee 100644 (file)
 #include "DNA_meshdata_types.h"
 #include "DNA_mesh_types.h"
 
-#include "BKE_utildefines.h"
-#include "BKE_tessmesh.h"
-#include "BKE_bmesh.h"
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_ghash.h"
 #include "BLI_memarena.h"
 
+#include "BKE_utildefines.h"
+#include "BKE_tessmesh.h"
+#include "BKE_bmesh.h"
+
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
index 20a5194..1c1fea9 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_array.h"
+#include "BLI_utildefines.h"
+#include "BLI_smallhash.h"
+
 #include "BKE_DerivedMesh.h"
 #include "BKE_action.h"
 #include "BKE_armature.h"
 
 #include "UI_view2d.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_array.h"
-#include "BLI_utildefines.h"
-#include "BLI_smallhash.h"
-
 #include "RNA_access.h"
 
 #include "transform.h"
index fa0c088..350d236 100644 (file)
 #include "DNA_modifier_types.h"
 #include "DNA_movieclip_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_utildefines.h"
+
 #include "RNA_access.h"
 
 //#include "BIF_screen.h"
 
 //#include "BDR_unwrapper.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_utildefines.h"
-
 #include "WM_types.h"
 #include "WM_api.h"
 
index c9dfd34..6eba3d7 100644 (file)
@@ -52,6 +52,9 @@
 #include "DNA_scene_types.h"
 #include "DNA_view3d_types.h"
 
+#include "BLI_math.h"
+#include "BLI_utildefines.h"
+
 #include "RNA_access.h"
 
 #include "BKE_action.h"
@@ -63,9 +66,6 @@
 #include "BKE_pointcache.h"
 #include "BKE_tessmesh.h"
 
-#include "BLI_math.h"
-#include "BLI_utildefines.h"
-
 #include "BIF_gl.h"
 
 #include "WM_api.h"
index 10f1e34..6b68042 100644 (file)
@@ -38,6 +38,9 @@
 #include "DNA_screen_types.h"
 #include "DNA_view3d_types.h"
 
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
 
 #include "BKE_armature.h"
 #include "BKE_curve.h"
 #include "BKE_tessmesh.h"
 #include "BKE_report.h"
 
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
-
 #include "BLF_translation.h"
 
 //#include "BIF_editmesh.h"
index 0630929..544a1c7 100644 (file)
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+
 #include "BKE_DerivedMesh.h"
 #include "BKE_modifier.h"
 #include "BKE_multires.h"
 #include "BKE_mesh.h"
 #include "BKE_tessmesh.h"
 
-#include "BLI_utildefines.h"
-#include "BLI_math.h"
-
 #include "ED_util.h"
 
 typedef struct {
index f334179..0e7df0d 100644 (file)
@@ -46,6 +46,8 @@
 #include "DNA_scene_types.h"
 #include "DNA_meta_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_tessmesh.h"
 #include "BKE_group.h" /* needed for object_in_group() */
 
index 23a3f6e..77276df 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <Python.h>
 
+#include "BLI_utildefines.h"
+
 #include "bmesh.h"
 
 #include "bmesh_py_types.h"
@@ -40,8 +42,6 @@
 
 #include "bmesh_py_utils.h"
 
-#include "BLI_utildefines.h"
-
 #include "BKE_tessmesh.h"
 
 #include "DNA_mesh_types.h"
index bf0e70c..4f35019 100644 (file)
 
 #include <Python.h>
 
+#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
+
 #include "bmesh.h"
 
 #include "bmesh_py_types.h"
 #include "bmesh_py_types_select.h"
 
-#include "BLI_utildefines.h"
-#include "BLI_listbase.h"
-
 #include "BKE_tessmesh.h"
 
 #include "DNA_mesh_types.h"
index 736802c..bbec871 100644 (file)
 
 #include <Python.h>
 
-#include "bmesh.h"
-
-#include "bmesh_py_types.h"
-
 #include "BLI_utildefines.h"
 
 #include "MEM_guardedalloc.h"
 
+#include "bmesh.h"
+
+#include "bmesh_py_types.h"
+
 #include "bmesh_py_utils.h" /* own include */