Anonymous | Login | 2024-04-25 13:34 CEST |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
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 | throw_raypath_while.patch [^] (487 bytes) 2014-03-10 03:20 [Show Content] | ||||||||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |