Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003810Doomseeker[All Projects] Cleanuppublic2020-06-07 04:202020-06-07 20:18
ReporterWubTheCaptain 
Assigned To 
PrioritynoneSeveritytweakReproducibilityhave not tried
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version1.3.1 
Target VersionFixed in Version 
Summary0003810: Some integer literals are cast to bool
DescriptionSome 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 [^]'
Attached Files

- Relationships

-  Notes
User avatar (0021382)
Pol M (developer)
2020-06-07 20:15

For some reason, pure virtual/abstract classes are commonly expressed with:
= 0;

instead of:
=false;

That should stay like this since everyone does it like this (even though the other way may be more expressive)
User avatar (0021383)
Pol M (developer)
2020-06-07 20:18

If you find any other case apart from that, you can change it

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- 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 View Revisions
2020-06-07 04:25 WubTheCaptain Steps to Reproduce Updated View Revisions
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






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker