shithub: choc

Download patch

ref: dfadc9303db2e943930289d2fd524640a3a913dd
parent: 670212f2ee7c468790c3e3b351b45135c274ef9c
parent: 8c449751f43083960ece5d37e1f9cb74422230dc
author: Turo Lamminen <turol@users.noreply.github.com>
date: Tue May 12 06:32:49 EDT 2020

Merge pull request #1281 from turol/clang

Fix clang warnings

--- a/src/heretic/r_segs.c
+++ b/src/heretic/r_segs.c
@@ -356,7 +356,7 @@
 // calculate rw_distance for scale calculation
 //
     rw_normalangle = curline->angle + ANG90;
-    offsetangle = abs(rw_normalangle - rw_angle1);
+    offsetangle = abs((int) rw_normalangle - (int) rw_angle1);
     if (offsetangle > ANG90)
         offsetangle = ANG90;
     distangle = ANG90 - offsetangle;
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -2877,7 +2877,7 @@
     {                           // attack the destination mobj if it's attackable
         mobj_t *oldTarget;
 
-        if (abs(actor->angle - R_PointToAngle2(actor->x, actor->y,
+        if (abs((int) actor->angle - (int) R_PointToAngle2(actor->x, actor->y,
                                                target->x,
                                                target->y)) < ANG45 / 2)
         {
@@ -2915,9 +2915,9 @@
                 mo = P_FindMobjFromTID(target->args[i], &search);
                 angleToSpot = R_PointToAngle2(actor->x, actor->y,
                                               mo->x, mo->y);
-                if (abs(angleToSpot - angleToTarget) < bestAngle)
+                if (abs((int) angleToSpot - (int) angleToTarget) < bestAngle)
                 {
-                    bestAngle = abs(angleToSpot - angleToTarget);
+                    bestAngle = abs((int) angleToSpot - (int) angleToTarget);
                     bestArg = i;
                 }
             }
@@ -2986,13 +2986,13 @@
         }
         angle = R_PointToAngle2(actor->x, actor->y, actor->target->x,
                                 actor->target->y);
-        if (abs(actor->angle - angle) < ANG45 / 2
+        if (abs((int) actor->angle - (int) angle) < ANG45 / 2
             && P_CheckMeleeRange(actor))
         {
             P_DamageMobj(actor->target, actor, actor, HITDICE(8));
             S_StartSound(actor, SFX_DRAGON_ATTACK);
         }
-        else if (abs(actor->angle - angle) <= ANG1 * 20)
+        else if (abs((int) actor->angle - (int) angle) <= ANG1 * 20)
         {
             P_SetMobjState(actor, actor->info->missilestate);
             S_StartSound(actor, SFX_DRAGON_ATTACK);
@@ -4032,7 +4032,7 @@
         case SORC_STOPPING:    // Balls stopping
             if ((parent->special2.i == actor->type) &&
                 (parent->args[1] > SORCBALL_SPEED_ROTATIONS) &&
-                (abs(angle - (parent->angle >> ANGLETOFINESHIFT)) <
+                (abs((int) angle - (int) (parent->angle >> ANGLETOFINESHIFT)) <
                  (30 << 5)))
             {
                 // Can stop now
--- a/src/hexen/p_mobj.c
+++ b/src/hexen/p_mobj.c
@@ -537,7 +537,7 @@
                     {
                         case MT_CENTAUR:
                         case MT_CENTAURLEADER:
-                            if (abs(angle - BlockingMobj->angle) >> 24 > 45)
+                            if (abs((int) angle - (int) BlockingMobj->angle) >> 24 > 45)
                                 goto explode;
                             if (mo->type == MT_HOLY_FX)
                                 goto explode;
--- a/src/hexen/r_segs.c
+++ b/src/hexen/r_segs.c
@@ -348,7 +348,7 @@
 // calculate rw_distance for scale calculation
 //
     rw_normalangle = curline->angle + ANG90;
-    offsetangle = abs(rw_normalangle - rw_angle1);
+    offsetangle = abs((int) rw_normalangle - (int) rw_angle1);
     if (offsetangle > ANG90)
         offsetangle = ANG90;
     distangle = ANG90 - offsetangle;
--- a/src/strife/r_segs.c
+++ b/src/strife/r_segs.c
@@ -407,7 +407,7 @@
     
     // calculate rw_distance for scale calculation
     rw_normalangle = curline->angle + ANG90;
-    offsetangle = abs(rw_normalangle-rw_angle1);
+    offsetangle = abs((int) rw_normalangle - (int) rw_angle1);
     
     if (offsetangle > ANG90)
 	offsetangle = ANG90;