Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008253 [DCSS] Bug Report minor N/A 2014-03-10 03:20 2014-03-10 04:02
Reporter floatingatoll View Status public  
Assigned To gammafunk
Priority normal Resolution done  
Status resolved   Product Branch 0.14 ancient branch
Summary 0008253: while loop typo in 428849b0 "Make the monster throw ability use a ray path"
Description 428849b03052c4253dbc0b0a2ced2c1bbc12745d (March 8, 2014) introduces the following compiler warning:

mon-abil.cc:5127:50: warning: while loop has empty body [-Wempty-body]
        while (ray.advance() && ray.pos() != *di);
                                                 ^
mon-abil.cc:5127:50: note: put the semicolon on a separate line to silence this warning


Which correctly identifies that there is something resembling a typo'd while loop in the code:

          while (ray.advance() && ray.pos() != *di);
          {
              if (!map_bounds(ray.pos()))
                  break;
          }


As written with the semicolon, it iterates over ray.advance() until exhausted, then does a single check of map_bounds(ray.pos) and breaks out of the distance_iterator for loop.

It seems likely that this was intended to break out of the while loop, implying that the semicolon should be removed.

Removing the semicolon clears the warnings. I'm not familiar with this code, so I don't know how to test the before/after behavior properly.
Additional Information
Tags No tags attached.
Attached Files ? file icon throw_raypath_while.patch [^] (487 bytes) 2014-03-10 03:20 [Show Content]

- Relationships

-  Notes
(0025533)
gammafunk (administrator)
2014-03-10 04:02

Fixed in 0.14-a0-3168-gfdc5474, thanks!

- Issue History
Date Modified Username Field Change
2014-03-10 03:20 floatingatoll New Issue
2014-03-10 03:20 floatingatoll File Added: throw_raypath_while.patch
2014-03-10 04:02 gammafunk Note Added: 0025533
2014-03-10 04:02 gammafunk Status new => resolved
2014-03-10 04:02 gammafunk Fixed in Branch => 0.14 development branch
2014-03-10 04:02 gammafunk Resolution open => done
2014-03-10 04:02 gammafunk Assigned To => gammafunk


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker