rename define BM_INLINE -> BLI_INLINE to avoid confusion with bmesh defines.

This commit is contained in:
Campbell Barton 2012-03-20 08:42:26 +00:00
parent a0ea68a584
commit 9dd0c4c232
16 changed files with 66 additions and 66 deletions

@ -2854,12 +2854,12 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
*/
BM_INLINE int navmesh_bit(int a, int b)
BLI_INLINE int navmesh_bit(int a, int b)
{
return (a & (1 << b)) >> b;
}
BM_INLINE void navmesh_intToCol(int i, float col[3])
BLI_INLINE void navmesh_intToCol(int i, float col[3])
{
int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1;
int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1;

@ -437,7 +437,7 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob)
BLI_uniquename_cb(defgroup_unique_check, &data, "Group", '.', dg->name, sizeof(dg->name));
}
BM_INLINE int is_char_sep(const char c)
BLI_INLINE int is_char_sep(const char c)
{
return ELEM4(c, '.', ' ', '-', '_');
}

@ -44,12 +44,12 @@
#include "recast-capi.h"
BM_INLINE float area2(const float* a, const float* b, const float* c)
BLI_INLINE float area2(const float* a, const float* b, const float* c)
{
return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]);
}
BM_INLINE int left(const float* a, const float* b, const float* c)
BLI_INLINE int left(const float* a, const float* b, const float* c)
{
return area2(a, b, c) < 0;
}

@ -251,12 +251,12 @@
/*little macro so inline keyword works*/
#if defined(_MSC_VER)
# define BM_INLINE static __forceinline
# define BLI_INLINE static __forceinline
#elif defined(__GNUC__)
# define BM_INLINE static inline __attribute((always_inline))
# define BLI_INLINE static inline __attribute((always_inline))
#else
/* #warning "MSC/GNUC defines not found, inline non-functional" */
# define BM_INLINE static
# define BLI_INLINE static
#endif

@ -35,7 +35,7 @@
BM_INLINE float D(float *data, const int res[3], int x, int y, int z)
BLI_INLINE float D(float *data, const int res[3], int x, int y, int z)
{
CLAMP(x, 0, res[0]-1);
CLAMP(y, 0, res[1]-1);
@ -57,7 +57,7 @@ float voxel_sample_nearest(float *data, const int res[3], const float co[3])
}
// returns highest integer <= x as integer (slightly faster than floor())
BM_INLINE int FLOORI(float x)
BLI_INLINE int FLOORI(float x)
{
const int r = (int)x;
return ((x >= 0.f) || (float)r == x) ? r : (r - 1);
@ -65,7 +65,7 @@ BM_INLINE int FLOORI(float x)
// clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2
// this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't)
BM_INLINE int _clamp(int a, int b, int c)
BLI_INLINE int _clamp(int a, int b, int c)
{
return (a < b) ? b : ((a > c) ? c : a);
}

@ -219,12 +219,12 @@ extern "C" {
#define BM_elem_flag_toggle( ele, hflag) _bm_elem_flag_toggle (&(ele)->head, hflag)
#define BM_elem_flag_merge( ele_a, ele_b) _bm_elem_flag_merge (&(ele_a)->head, &(ele_b)->head)
BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag);
BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag);
BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag);
BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val);
BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag);
BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b);
BLI_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag);
BLI_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag);
BLI_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag);
BLI_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val);
BLI_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag);
BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b);
/* notes on BM_elem_index_set(...) usage,
* Set index is sometimes abused as temp storage, other times we cant be
@ -257,8 +257,8 @@ BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b);
#define BM_elem_index_get(ele) _bm_elem_index_get(&(ele)->head)
#define BM_elem_index_set(ele, index) _bm_elem_index_set(&(ele)->head, index)
BM_INLINE int _bm_elem_index_get(const BMHeader *ele);
BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index);
BLI_INLINE int _bm_elem_index_get(const BMHeader *ele);
BLI_INLINE void _bm_elem_index_set(BMHeader *ele, const int index);
#ifdef USE_BMESH_HOLES
# define BM_FACE_FIRST_LOOP(p) (((BMLoopList *)((p)->loops.first))->first)

@ -81,11 +81,11 @@ struct GHashIterator;
#define BMO_elem_flag_set( bm, ele, oflag, val) _bmo_elem_flag_set (bm, (ele)->oflags, oflag, val)
#define BMO_elem_flag_toggle( bm, ele, oflag) _bmo_elem_flag_toggle (bm, (ele)->oflags, oflag)
BM_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BM_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BM_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BM_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val);
BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val);
BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag);
/* slot type arrays are terminated by the last member
* having a slot type of 0.*/

@ -240,7 +240,7 @@ BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short co
* only create the face, since this calloc's the length is initialized to 0,
* leave adding loops to the caller.
*/
BM_INLINE BMFace *bm_face_create__internal(BMesh *bm)
BLI_INLINE BMFace *bm_face_create__internal(BMesh *bm)
{
BMFace *f;

@ -31,44 +31,44 @@
#include "bmesh.h"
BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
BLI_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
{
return head->hflag & hflag;
}
BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag)
BLI_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag)
{
head->hflag |= hflag;
}
BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag)
BLI_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag)
{
head->hflag &= ~hflag;
}
BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val)
BLI_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val)
{
if (val) _bm_elem_flag_enable(head, hflag);
else _bm_elem_flag_disable(head, hflag);
}
BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag)
BLI_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag)
{
head->hflag ^= hflag;
}
BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b)
BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b)
{
head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag;
}
BM_INLINE void _bm_elem_index_set(BMHeader *head, const int index)
BLI_INLINE void _bm_elem_index_set(BMHeader *head, const int index)
{
head->index = index;
}
BM_INLINE int _bm_elem_index_get(const BMHeader *head)
BLI_INLINE int _bm_elem_index_get(const BMHeader *head)
{
return head->index;
}

@ -39,7 +39,7 @@
*
* Calls an iterators step fucntion to return the next element.
*/
BM_INLINE void *BM_iter_step(BMIter *iter)
BLI_INLINE void *BM_iter_step(BMIter *iter)
{
return iter->step(iter);
}
@ -52,7 +52,7 @@ BM_INLINE void *BM_iter_step(BMIter *iter)
* it with the appropriate function pointers based
* upon its type.
*/
BM_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
{
/* int argtype; */
iter->itype = itype;
@ -179,7 +179,7 @@ BM_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data
* to return the first element of the iterator.
*
*/
BM_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *data)
BLI_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *data)
{
if (LIKELY(BM_iter_init(iter, bm, itype, data))) {
return BM_iter_step(iter);

@ -407,7 +407,7 @@ static BMVert **bm_to_mesh_vertex_map(BMesh *bm, int ototvert)
return vertMap;
}
BM_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
BLI_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
{
/* this is a cheap way to set the edge draw, its not precise and will
* pick the first 2 faces an edge uses */

@ -41,39 +41,39 @@
* ghash or a mapping slot to do it. */
/* flags 15 and 16 (1 << 14 and 1 << 15) are reserved for bmesh api use */
BM_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag)
BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
return oflags[bm->stackdepth - 1].f & oflag;
}
BM_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f |= oflag;
}
BM_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f &= ~oflag;
}
BM_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
{
if (val) oflags[bm->stackdepth - 1].f |= oflag;
else oflags[bm->stackdepth - 1].f &= ~oflag;
}
BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f ^= oflag;
}
BM_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slotname,
void *element, int val)
{
BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(int));
}
BM_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slotname,
void *element, float val)
{
BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(float));
@ -85,13 +85,13 @@ BM_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *
* do NOT use these for non-operator-api-allocated memory! instead
* use BMO_slot_map_data_get and BMO_slot_map_insert, which copies the data. */
BM_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slotname,
void *element, void *val)
{
BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(void *));
}
BM_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element)
BLI_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING);
@ -102,7 +102,7 @@ BM_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const cha
return BLI_ghash_haskey(slot->data.ghash, element);
}
BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
BLI_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
void *element)
{
BMOElemMapping *mapping;
@ -119,7 +119,7 @@ BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const c
return mapping + 1;
}
BM_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slotname,
void *element)
{
float *val = (float *) BMO_slot_map_data_get(bm, op, slotname, element);
@ -128,7 +128,7 @@ BM_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *sl
return 0.0f;
}
BM_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotname,
void *element)
{
int *val = (int *) BMO_slot_map_data_get(bm, op, slotname, element);
@ -137,7 +137,7 @@ BM_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotna
return 0;
}
BM_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slotname,
BLI_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slotname,
void *element)
{
void **val = (void **) BMO_slot_map_data_get(bm, op, slotname, element);

@ -76,7 +76,7 @@ static int count_edge_faces(BMesh *bm, BMEdge *e);
/**** rotation system code * */
BM_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data)
BLI_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data)
{
return v == ((BMEdge *)e)->v1 ? &(((EdgeData *)e_data)->v1_disk_link) :
&(((EdgeData *)e_data)->v2_disk_link) ;
@ -866,7 +866,7 @@ static int count_edge_faces(BMesh *bm, BMEdge *e)
return i;
}
BM_INLINE void vote_on_winding(BMEdge *edge, EPathNode *node, unsigned int winding[2])
BLI_INLINE void vote_on_winding(BMEdge *edge, EPathNode *node, unsigned int winding[2])
{
BMVert *test_v1, *test_v2;
/* we want to use the reverse winding to the existing order */

@ -589,7 +589,7 @@ void vpaint_dogamma(Scene *scene)
}
#endif
BM_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int mfac;
@ -617,7 +617,7 @@ BM_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
return col;
}
BM_INLINE unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int temp;
@ -642,7 +642,7 @@ BM_INLINE unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
return col;
}
BM_INLINE unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int temp;
@ -667,7 +667,7 @@ BM_INLINE unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
return col;
}
BM_INLINE unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int mfac;
@ -692,7 +692,7 @@ BM_INLINE unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
return col;
}
BM_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int mfac;
@ -725,7 +725,7 @@ BM_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fa
return col;
}
BM_INLINE unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
BLI_INLINE unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
{
unsigned char *cp1, *cp2, *cp;
int mfac;
@ -904,27 +904,27 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc,
}
BM_INLINE float wval_blend(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_blend(const float weight, const float paintval, const float alpha)
{
return (paintval * alpha) + (weight * (1.0f - alpha));
}
BM_INLINE float wval_add(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_add(const float weight, const float paintval, const float alpha)
{
return weight + (paintval * alpha);
}
BM_INLINE float wval_sub(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_sub(const float weight, const float paintval, const float alpha)
{
return weight - (paintval * alpha);
}
BM_INLINE float wval_mul(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_mul(const float weight, const float paintval, const float alpha)
{ /* first mul, then blend the fac */
return ((1.0f - alpha) + (alpha * paintval)) * weight;
}
BM_INLINE float wval_lighten(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_lighten(const float weight, const float paintval, const float alpha)
{
return (weight < paintval) ? wval_blend(weight, paintval, alpha) : weight;
}
BM_INLINE float wval_darken(const float weight, const float paintval, const float alpha)
BLI_INLINE float wval_darken(const float weight, const float paintval, const float alpha)
{
return (weight > paintval) ? wval_blend(weight, paintval, alpha) : weight;
}

@ -74,7 +74,7 @@
/************************ poll ***************************/
BM_INLINE int text_pixel_x_to_index(SpaceText *st, const int x)
BLI_INLINE int text_pixel_x_to_index(SpaceText *st, const int x)
{
/* add half the char width so mouse cursor selection is inbetween letters */
return (x + (st->cwidth / 2)) / st->cwidth;

@ -69,7 +69,7 @@ extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* luminance rec. 709 */
BM_INLINE float luminance(const float col[3])
BLI_INLINE float luminance(const float col[3])
{
return (0.212671f*col[0] + 0.71516f*col[1] + 0.072169f*col[2]);
}