summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_extramath.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2015-04-06 03:05:28 -0700
committerTim Angus <tim@ngus.net>2015-06-07 12:03:37 +0100
commit2c051e1b420ca07012f319ac14452449c8bfd1e1 (patch)
treebe3615e2957fbb27a33ad5a113ea7aef2ee43a09 /src/renderergl2/tr_extramath.c
parentda27b948bc67b804b7755478fd81ed7da31d6152 (diff)
OpenGL2: Use signed value in case value goes below 0.
Diffstat (limited to 'src/renderergl2/tr_extramath.c')
-rw-r--r--src/renderergl2/tr_extramath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/renderergl2/tr_extramath.c b/src/renderergl2/tr_extramath.c
index 552406bb..fc0a21a3 100644
--- a/src/renderergl2/tr_extramath.c
+++ b/src/renderergl2/tr_extramath.c
@@ -225,7 +225,7 @@ uint16_t FloatToHalf(float in)
f32.f = in;
- f16.pack.exponent = CLAMP(f32.pack.exponent - 112, 0, 31);
+ f16.pack.exponent = CLAMP((int)(f32.pack.exponent) - 112, 0, 31);
f16.pack.fraction = f32.pack.fraction >> 13;
f16.pack.sign = f32.pack.sign;