-
Notifications
You must be signed in to change notification settings - Fork 593
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
Fix more C++ modernize lints #3353
Conversation
@@ -8,6 +8,7 @@ Checks: | |||
-modernize-avoid-c-arrays, | |||
-modernize-use-trailing-return-type, | |||
-modernize-concat-nested-namespaces, | |||
-modernize-use-default-member-init, |
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.
Suppressed for now as -fix doesn't deal well with macro conditionals and produces incorrect code.
_subMaps.begin(); | ||
p != _subMaps.end(); | ||
++p) | ||
for (auto p = _subMaps.begin(); p != _subMaps.end(); ++p) |
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.
I don't know why -fix didn't convert this code in a loop.
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.
Actually, in this case, I prefer to leave it alone as the syntax is hard to decipher.
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.
I think many loop still need to be fixed.
@@ -31,15 +31,15 @@ namespace Ice::SSL | |||
bool | |||
DistinguishedName::match(const DistinguishedName& other) const | |||
{ | |||
for (list<pair<string, string>>::const_iterator p = other._unescaped.begin(); p != other._unescaped.end(); ++p) | |||
for (const auto& p : other._unescaped) |
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.
Would be nice to use a variable like name
instead of p
and q
.
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.
I only through some of the files, it seems good so far,
although I think the tool is still missing some const auto&
in for loops.
If you want to take a look: for\s*\(auto(?!&)
This PR fixes:
It also fixes the syntax for NOLINT.
It was mostly done using "-fix" ... but with additional fixes as "-fix" is not always correct/good.