MantisBT - Doomseeker |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0003810 | Doomseeker | [All Projects] Cleanup | public | 2020-06-07 04:20 | 2020-06-07 20:18 |
|
Reporter | WubTheCaptain | |
Assigned To | | |
Priority | none | Severity | tweak | Reproducibility | have not tried |
Status | confirmed | Resolution | open | |
Platform | | OS | | OS Version | |
Product Version | 1.3.1 | |
Target Version | | Fixed in Version | | |
|
Summary | 0003810: Some integer literals are cast to bool |
Description | Some code in Doomseeker uses integer values like 0 or 1 to indicate false / true, instead of those keywords. Not ideal (for readability).
Guesstimate some of them were an int type before (like in C89), then converted from int to bool without changing the value itself.
An example:
Quote from src/core/modreader.h virtual bool load() = 0;
should be written as:
Quote from src/core/modreader.h virtual bool load() = false; |
Steps To Reproduce | $ grep -r "bool " src/ | grep "= 1" | wc -l
1
$ grep -r "bool " src/ | grep "= 0" | wc -l
16
$ grep -r "bool " src/ | grep "(1)" | wc -l
0
$ grep -r "bool " src/ | grep "(0)" | wc -l
0
$ grep -r "bool " src/ | grep "? 1" | wc -l
0
$ grep -r "bool " src/ | grep "? 0" | wc -l
0 |
Additional Information | 'https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html [^]' |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2020-06-07 04:20 | WubTheCaptain | New Issue | |
2020-06-07 04:21 | WubTheCaptain | Priority | normal => none |
2020-06-07 04:25 | WubTheCaptain | Description Updated | bug_revision_view_page.php?rev_id=13127#r13127 |
2020-06-07 04:25 | WubTheCaptain | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=13129#r13129 |
2020-06-07 20:15 | Pol M | Note Added: 0021382 | |
2020-06-07 20:18 | Pol M | Note Added: 0021383 | |
2020-06-07 20:18 | Pol M | Status | new => confirmed |