- Shut up GCC aggressive optimizer warnings.

From what I can see, GCC would miscompile the involved loops, because the index variable is 'signed int' and the multiplication with an unsigned would cause signed overflow (undefined behavior). Change the index variable type to 'unsigned int' to expect unsigned overflow (conformant to standard).
This commit is contained in:
Edoardo Prezioso 2014-05-25 10:11:09 +02:00
parent b285cbebe4
commit 72bbb19cc7
4 changed files with 4 additions and 4 deletions

View File

@ -187,7 +187,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact) DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
{ {
int i; unsigned int i;
AActor *tiny; AActor *tiny;
angle_t angle; angle_t angle;

View File

@ -797,7 +797,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers) DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
{ {
int i; unsigned int i;
angle_t angle; angle_t angle;
AActor *ripper; AActor *ripper;

View File

@ -171,7 +171,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact) DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
{ {
int i; unsigned int i;
angle_t angle; angle_t angle;
AActor *shard; AActor *shard;

View File

@ -125,7 +125,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyMissileExplode) DEFINE_ACTION_FUNCTION(AActor, A_IceGuyMissileExplode)
{ {
AActor *mo; AActor *mo;
int i; unsigned int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {