[iortcw] 332/497: Rend2: Use signed value in case value goes below 0
Simon McVittie
smcv at debian.org
Fri Sep 8 10:37:18 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit 3b2d78880c0b451483801f12ad90e37180510cc3
Author: Donny <M4N4T4RMS at gmail.com>
Date: Mon Apr 6 06:20:14 2015 -0400
Rend2: Use signed value in case value goes below 0
---
MP/code/rend2/tr_extramath.c | 2 +-
SP/code/rend2/tr_extramath.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MP/code/rend2/tr_extramath.c b/MP/code/rend2/tr_extramath.c
index da9a94d..bded757 100644
--- a/MP/code/rend2/tr_extramath.c
+++ b/MP/code/rend2/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;
diff --git a/SP/code/rend2/tr_extramath.c b/SP/code/rend2/tr_extramath.c
index da9a94d..bded757 100644
--- a/SP/code/rend2/tr_extramath.c
+++ b/SP/code/rend2/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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list