diff options
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 4f841f75d3a..7555d3d7daf 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -114,6 +114,23 @@ MINLINE float sasqrt(float fac); MINLINE float interpf(float a, float b, float t); MINLINE double interpd(double a, double b, double t); +/* NOTE: Compilers will upcast all types smaller than int to int when performing arithmetic + * operation. */ +MINLINE int square_s(short a); +MINLINE int square_uchar(unsigned char a); +MINLINE int cube_s(short a); +MINLINE int cube_uchar(unsigned char a); + +MINLINE int square_i(int a); +MINLINE unsigned int square_uint(unsigned int a); +MINLINE float square_f(float a); +MINLINE double square_d(double a); + +MINLINE int cube_i(int a); +MINLINE unsigned int cube_uint(unsigned int a); +MINLINE float cube_f(float a); +MINLINE double cube_d(double a); + MINLINE float min_ff(float a, float b); MINLINE float max_ff(float a, float b); MINLINE float min_fff(float a, float b, float c); |