foxygit / doom Log in
commit a03d93810b22294c8c4f2e466bba8795f81b9193
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Mon Jan 28 10:02:29 2019 +0100
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Mon Jan 28 10:02:29 2019 +0100

    hexen: replace shifted negative value with negative of shifted value

    This fixes a "Shifting a negative value is undefined behaviour"
    cppcheck error.
---
 src/hexen/r_things.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hexen/r_things.c b/src/hexen/r_things.c
index fbc8eeaf..92a8deec 100644
--- a/src/hexen/r_things.c
+++ b/src/hexen/r_things.c
@@ -1033,7 +1033,7 @@ void R_DrawMasked(void)
 //
 // Added for the sideviewing with an external device
     if (viewangleoffset <= 1024 << ANGLETOFINESHIFT || viewangleoffset >=
-        -1024 << ANGLETOFINESHIFT)
+        -(1024 << ANGLETOFINESHIFT))
     {                           // don't draw on side views
         R_DrawPlayerSprites();
     }