mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-10 09:41:09 +00:00
mathlib.h (max, min): The min and max were declared as inline but
were never defined. Moved them from mathlib.c to here as static inline functions q_min and q_max. Define min and max as q_min and q_max. mathlib.c (max, min): Moved to mathlib.h as q_max and q_min static inlines. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@175 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
1ec6c1b340
commit
12e4aa6caa
2 changed files with 14 additions and 23 deletions
|
@ -33,27 +33,6 @@ int nanmask = 255<<23;
|
||||||
//#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
|
//#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
|
||||||
#define DEG2RAD( a ) ( (a) * M_PI_DIV_180 ) //johnfitz
|
#define DEG2RAD( a ) ( (a) * M_PI_DIV_180 ) //johnfitz
|
||||||
|
|
||||||
// kristian - missing math functions
|
|
||||||
#ifndef max
|
|
||||||
int max (int x, int y)
|
|
||||||
{
|
|
||||||
if (x > y)
|
|
||||||
return x;
|
|
||||||
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifndef min
|
|
||||||
int min (int x, int y)
|
|
||||||
{
|
|
||||||
if (x < y)
|
|
||||||
return x;
|
|
||||||
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// kristian
|
|
||||||
|
|
||||||
void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
|
void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
|
@ -71,10 +71,22 @@ extern int nanmask;
|
||||||
|
|
||||||
// kristian - missing math functions
|
// kristian - missing math functions
|
||||||
#if !defined(max)
|
#if !defined(max)
|
||||||
inline int max (int x, int y);
|
#define max q_max
|
||||||
|
static inline int q_max (int x, int y)
|
||||||
|
{
|
||||||
|
if (x > y)
|
||||||
|
return x;
|
||||||
|
return y;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(min)
|
#if !defined(min)
|
||||||
inline int min (int x, int y);
|
#define min q_min
|
||||||
|
static inline int q_min (int x, int y)
|
||||||
|
{
|
||||||
|
if (x < y)
|
||||||
|
return x;
|
||||||
|
return y;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
// kristian
|
// kristian
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue