diff options
Diffstat (limited to 'linden/indra/llcommon/lldefs.h')
-rw-r--r-- | linden/indra/llcommon/lldefs.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/linden/indra/llcommon/lldefs.h b/linden/indra/llcommon/lldefs.h index 69bfaa7..d081245 100644 --- a/linden/indra/llcommon/lldefs.h +++ b/linden/indra/llcommon/lldefs.h | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -183,7 +183,15 @@ template <class LLDATATYPE> | |||
183 | inline LLDATATYPE llmax(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3) | 183 | inline LLDATATYPE llmax(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3) |
184 | { | 184 | { |
185 | LLDATATYPE r = llmax(d1,d2); | 185 | LLDATATYPE r = llmax(d1,d2); |
186 | return (r > d3 ? r : d3); | 186 | return llmax(r, d3); |
187 | } | ||
188 | |||
189 | template <class LLDATATYPE> | ||
190 | inline LLDATATYPE llmax(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3, const LLDATATYPE& d4) | ||
191 | { | ||
192 | LLDATATYPE r1 = llmax(d1,d2); | ||
193 | LLDATATYPE r2 = llmax(d3,d4); | ||
194 | return llmax(r1, r2); | ||
187 | } | 195 | } |
188 | 196 | ||
189 | template <class LLDATATYPE> | 197 | template <class LLDATATYPE> |
@@ -200,6 +208,14 @@ inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATA | |||
200 | } | 208 | } |
201 | 209 | ||
202 | template <class LLDATATYPE> | 210 | template <class LLDATATYPE> |
211 | inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATATYPE& d3, const LLDATATYPE& d4) | ||
212 | { | ||
213 | LLDATATYPE r1 = llmin(d1,d2); | ||
214 | LLDATATYPE r2 = llmin(d3,d4); | ||
215 | return llmin(r1, r2); | ||
216 | } | ||
217 | |||
218 | template <class LLDATATYPE> | ||
203 | inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval) | 219 | inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval) |
204 | { | 220 | { |
205 | return llmin(llmax(a, minval), maxval); | 221 | return llmin(llmax(a, minval), maxval); |