diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/pbvh.c | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9a2b94b2c7e..2b3c314131b 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -648,7 +648,7 @@ static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index // This functions returns the number of branches needed to have the requested number of leafs. static int implicit_needed_branches(int tree_type, int leafs) { - return MAX2(1, (leafs + tree_type - 3) / (tree_type - 1) ); + return maxi(1, (leafs + tree_type - 3) / (tree_type - 1) ); } /* diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index b2d5392c596..97fc431d8fa 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -143,12 +143,20 @@ MINLINE float minf(float a, float b) { return (a < b) ? a : b; } - MINLINE float maxf(float a, float b) { return (a > b) ? a : b; } +MINLINE int mini(int a, int b) +{ + return (a < b) ? a : b; +} +MINLINE int maxi(int a, int b) +{ + return (b < a) ? a : b; +} + MINLINE float signf(float f) { return (f < 0.f) ? -1.f : 1.f; diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 9b05f0fc976..b4b546d9167 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -663,7 +663,7 @@ void BLI_pbvh_build_grids(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, bvh->totgrid = totgrid; bvh->gridkey = *key; bvh->grid_hidden = grid_hidden; - bvh->leaf_limit = MAX2(LEAF_LIMIT / ((gridsize - 1) * (gridsize - 1)), 1); + bvh->leaf_limit = maxi(LEAF_LIMIT / ((gridsize - 1) * (gridsize - 1)), 1); BB_reset(&cb); |