ref: 744697c4fe213821c18dd882098b311550d42da7
parent: 2e8f6da6fdf0eb71e58d2cdaad24e5b0a332f675
author: Fabian Greffrath <[email protected]>
date: Fri May 8 04:57:20 EDT 2015
warnings: fix "iteration XY invokes undefined behavior" warnings These were caused by loops which caused overflow of variables of type angle_t (= unsigned) by multiplication with iterators of typed int in angle calculations. Changing the type of the iterator variables to "unsigned int" prevents the undefined behavior.
--- a/src/heretic/p_enemy.c
+++ b/src/heretic/p_enemy.c
@@ -1904,7 +1904,7 @@
void A_HeadIceImpact(mobj_t * ice)
{
- int i;
+ unsigned int i;
angle_t angle;
mobj_t *shard;
@@ -2519,7 +2519,7 @@
void A_VolcBallImpact(mobj_t * ball)
{
- int i;
+ unsigned int i;
mobj_t *tiny;
angle_t angle;
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -1330,7 +1330,7 @@
void A_SpawnRippers(mobj_t * actor)
{
- int i;
+ unsigned int i;
angle_t angle;
mobj_t *ripper;
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -3855,7 +3855,7 @@
void A_IceGuyMissileExplode(mobj_t * actor)
{
mobj_t *mo;
- int i;
+ unsigned int i;
for (i = 0; i < 8; i++)
{