-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STYLE: Replace integer literals which are cast to bool. #4983
STYLE: Replace integer literals which are cast to bool. #4983
Conversation
Finds and replaces integer literals which are cast to bool. cd ${BLDDIR} run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-bool-literals -header-filter=.* -fix
@N-Dekker After all the headache I caused in the previous big commit, I opted for a smaller commit this time :) . |
@@ -92,7 +92,7 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) | |||
for (int i = 0; i < 5; ++i) | |||
for (int j = 0; j < 5; j++, ++maskIt) | |||
{ | |||
maskIt.Set(bool{ 1 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved of course, but what about itk::NumericTraits<bool>::OneValue()
? 😺
ITK/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx
Line 107 in 214b763
rescale->SetOutputMaximum(itk::NumericTraits<bool>::OneValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjmjohnson I just "unresolved" because I did not see a "resolution" to my remark on itk::NumericTraits<bool>::OneValue()
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's quite a round-about way to write true
. There is no need to overcomplicate things. itk::NumericTraits<bool>::OneValue()
exists primarily to ease implementing templated code.
2792d9a
into
InsightSoftwareConsortium:master
Finds and replaces integer literals which are cast to bool.
cd ${BLDDIR}
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-,modernize-use-bool-literals -header-filter=. -fix
PR Checklist