From 7b82d0e695bb9be7c1825c52df3799835e8b2a81 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 7 Jul 2018 00:34:03 +0100 Subject: [PATCH] Fix warning relating to max 0 with an unsigned variable I've looked at the code above and can't see anything that would try to lower the value below 0 as it's mostly just addition and dividing --- src/hardware/hw_md2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 8bb4c959..963b6fdb 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1228,13 +1228,13 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, colorbright = (blendcolor.s.red+blendcolor.s.green+blendcolor.s.blue)/3; tempcolor = (finalbright*blendcolor.s.red)/colorbright; - tempcolor = min(255, max(0, tempcolor)); + tempcolor = min(255, tempcolor); cur->s.red = (UINT8)tempcolor; tempcolor = (finalbright*blendcolor.s.green)/colorbright; - tempcolor = min(255, max(0, tempcolor)); + tempcolor = min(255, tempcolor); cur->s.green = (UINT8)tempcolor; tempcolor = (finalbright*blendcolor.s.blue)/colorbright; - tempcolor = min(255, max(0, tempcolor)); + tempcolor = min(255, tempcolor); cur->s.blue = (UINT8)tempcolor; cur->s.alpha = image->s.alpha; }