summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alu.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-16 18:33:10 -0700
committerChris Robinson <[email protected]>2011-08-16 18:33:10 -0700
commit04dad28228a694e681d722826615245466a3aa16 (patch)
tree54860fb951339bb4af88df4c620383323427a5fd /OpenAL32/Include/alu.h
parenta96f8177387818d3ef69778e3f78a9ed251326c1 (diff)
Use mini/maxi/clampi and minu/maxu/clampu to replace min/max calls
Diffstat (limited to 'OpenAL32/Include/alu.h')
-rw-r--r--OpenAL32/Include/alu.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 65d8d3a7..45eb09c5 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -134,6 +134,20 @@ static __inline ALfloat maxF(ALfloat a, ALfloat b)
static __inline ALfloat clampF(ALfloat val, ALfloat mn, ALfloat mx)
{ return minF(mx, maxF(mn, val)); }
+static __inline ALuint minu(ALuint a, ALuint b)
+{ return ((a > b) ? b : a); }
+static __inline ALuint maxu(ALuint a, ALuint b)
+{ return ((a > b) ? a : b); }
+static __inline ALuint clampu(ALuint val, ALuint min, ALuint max)
+{ return minu(max, maxu(min, val)); }
+
+static __inline ALint mini(ALint a, ALint b)
+{ return ((a > b) ? b : a); }
+static __inline ALint maxi(ALint a, ALint b)
+{ return ((a > b) ? a : b); }
+static __inline ALint clampi(ALint val, ALint min, ALint max)
+{ return mini(max, maxi(min, val)); }
+
static __inline ALdouble lerp(ALdouble val1, ALdouble val2, ALdouble mu)
{