From 7d9249d180f7bc228cad3d6f5ed4d5fb13296451 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 6 Dec 2022 17:16:56 -0500 Subject: DRTVWR-575: Try to avoid comparison warnings in llclamp() --- indra/llcommon/lldefs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llcommon') 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 inline A llclamp(A a, MIN minval, MAX maxval) { - if ( a < minval ) + A aminval{ static_cast(minval) }, amaxval{ static_cast(maxval) }; + if ( a < aminval ) { - return static_cast(minval); + return aminval; } - else if ( a > maxval ) + else if ( a > amaxval ) { - return static_cast(maxval); + return amaxval; } return a; } -- cgit v1.2.3