aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/lldefs.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llcommon/lldefs.h
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/llcommon/lldefs.h')
-rw-r--r--linden/indra/llcommon/lldefs.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/linden/indra/llcommon/lldefs.h b/linden/indra/llcommon/lldefs.h
index d081245..0e69626 100644
--- a/linden/indra/llcommon/lldefs.h
+++ b/linden/indra/llcommon/lldefs.h
@@ -218,7 +218,15 @@ inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATA
218template <class LLDATATYPE> 218template <class LLDATATYPE>
219inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval) 219inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval)
220{ 220{
221 return llmin(llmax(a, minval), maxval); 221 if ( a < minval )
222 {
223 return minval;
224 }
225 else if ( a > maxval )
226 {
227 return maxval;
228 }
229 return a;
222} 230}
223 231
224template <class LLDATATYPE> 232template <class LLDATATYPE>
@@ -234,3 +242,4 @@ inline LLDATATYPE llclampb(const LLDATATYPE& a)
234} 242}
235 243
236#endif // LL_LLDEFS_H 244#endif // LL_LLDEFS_H
245