-
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++ lints in cpp #3275
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
#include "SessionI.h" | ||
#include "TopicI.h" | ||
|
||
namespace std | ||
// TODO: explain why we need to use namespace std here. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this is for ADL? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably, but it's not immediately clear to me. |
||
namespace std // NOLINT:cert-dcl58-cpp | ||
{ | ||
template<typename T> inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& p) | ||
{ | ||
|
@@ -205,7 +206,7 @@ namespace DataStormI | |
return os; | ||
} | ||
|
||
class TraceLevels | ||
class TraceLevels // NOLINT:clang-analyzer-optin.performance.Padding | ||
{ | ||
public: | ||
TraceLevels(const Ice::PropertiesPtr&, Ice::LoggerPtr); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,9 +107,11 @@ namespace | |
{ | ||
#if defined(__APPLE__) || defined(_WIN32) | ||
|
||
// NOLINTBEGIN:cert-err58-cpp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just get rid of the constants? They're only used in this function. and we make a copy all the time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. In simple cases like these, we should use |
||
const string padBytes0 = ""; | ||
const string padBytes1 = "="; | ||
const string padBytes2 = "=="; | ||
// NOLINTEND | ||
|
||
inline string paddingBytes(size_t length) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
// For UINTPTR_MAX on Ubuntu Precise | ||
// | ||
#ifndef __STDC_LIMIT_MACROS | ||
# define __STDC_LIMIT_MACROS | ||
# define __STDC_LIMIT_MACROS // NOLINT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. What doesn't the linter like here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't like that we define a __XXX symbol. |
||
#endif | ||
|
||
#include "Ice/Exception.h" | ||
|
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.
Can we include the lint name like we're doing in other places.
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.
These are dummy functions to keep GCC happy. Here, clang-tidy is complaining about not testing for self-assignment, which is irrelevant.