summaryrefslogtreecommitdiff
path: root/indra/llcommon/lldefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lldefs.h')
-rw-r--r--indra/llcommon/lldefs.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h
index cd8c79a84d..96b2ab169b 100644
--- a/indra/llcommon/lldefs.h
+++ b/indra/llcommon/lldefs.h
@@ -183,7 +183,15 @@ template <class LLDATATYPE>
inline LLDATATYPE llmax(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3)
{
LLDATATYPE r = llmax(d1,d2);
- return (r > d3 ? r : d3);
+ return llmax(r, d3);
+}
+
+template <class LLDATATYPE>
+inline LLDATATYPE llmax(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3, const LLDATATYPE& d4)
+{
+ LLDATATYPE r1 = llmax(d1,d2);
+ LLDATATYPE r2 = llmax(d3,d4);
+ return llmax(r1, r2);
}
template <class LLDATATYPE>
@@ -200,6 +208,14 @@ inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATA
}
template <class LLDATATYPE>
+inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3, const LLDATATYPE& d4)
+{
+ LLDATATYPE r1 = llmin(d1,d2);
+ LLDATATYPE r2 = llmin(d3,d4);
+ return llmin(r1, r2);
+}
+
+template <class LLDATATYPE>
inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval)
{
return llmin(llmax(a, minval), maxval);