summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-12-06 17:16:56 -0500
committerNat Goodspeed <nat@lindenlab.com>2022-12-06 17:16:56 -0500
commit7d9249d180f7bc228cad3d6f5ed4d5fb13296451 (patch)
treebd3cd5aefcd357b03931f7189fdfc5fb0c17944b /indra/llcommon
parent9a7e638b67cda4bb1174a4d46fb7769290472ebc (diff)
DRTVWR-575: Try to avoid comparison warnings in llclamp()
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lldefs.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h
index a567fd7c12..5c46f6a796 100644
--- a/indra/llcommon/lldefs.h
+++ b/indra/llcommon/lldefs.h
@@ -214,13 +214,14 @@ inline auto llmin(T1 d1, T2 d2, T3 d3, T4 d4)
template <typename A, typename MIN, typename MAX>
inline A llclamp(A a, MIN minval, MAX maxval)
{
- if ( a < minval )
+ A aminval{ static_cast<A>(minval) }, amaxval{ static_cast<A>(maxval) };
+ if ( a < aminval )
{
- return static_cast<A>(minval);
+ return aminval;
}
- else if ( a > maxval )
+ else if ( a > amaxval )
{
- return static_cast<A>(maxval);
+ return amaxval;
}
return a;
}