diff options
author | Chih-Hung Hsieh <chh@google.com> | 2017-08-02 14:59:25 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2017-08-16 19:35:08 +0000 |
commit | 306cc4b6e8f90402a4efea3142628840682998cb (patch) | |
tree | 5d5878611e3c8f2d1256f7031f7eae2c597b41fa /utils | |
parent | cec46c48853a8c1246656d0095a9faa3fad5c4f9 (diff) | |
download | hidl-306cc4b6e8f90402a4efea3142628840682998cb.tar.gz |
Fix or suppress misc-macro-parentheses in system/tools/hidl.
* Use NOLINT to suppress wrong warnings around macro parameters
used as type arguments or statements.
* Replace macro EACH_SERVER with template function runOnEachServer,
whose template parmater is a class template.
Bug: 28705665
Test: make with WITH_TIDY=1 WITH_TIDY_CHECKS=-*,misc-macro-* \
WITH_TIDY_FLAGS=-header-filter=system/tools/hidl/.*
Change-Id: Ibf4e8f8c0291662851af615071c58df971844229
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Formatter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/utils/Formatter.cpp b/utils/Formatter.cpp index f994650d..f29562c2 100644 --- a/utils/Formatter.cpp +++ b/utils/Formatter.cpp @@ -148,10 +148,11 @@ Formatter &Formatter::operator<<(const std::string &out) { return *this; } -#define FORMATTER_INPUT_INTEGER(__type__) \ - Formatter &Formatter::operator<<(__type__ n) { \ - return (*this) << std::to_string(n); \ - } \ +// NOLINT to suppress missing parentheses warning about __type__. +#define FORMATTER_INPUT_INTEGER(__type__) \ + Formatter& Formatter::operator<<(__type__ n) { /* NOLINT */ \ + return (*this) << std::to_string(n); \ + } FORMATTER_INPUT_INTEGER(short); FORMATTER_INPUT_INTEGER(unsigned short); @@ -167,10 +168,11 @@ FORMATTER_INPUT_INTEGER(long double); #undef FORMATTER_INPUT_INTEGER -#define FORMATTER_INPUT_CHAR(__type__) \ - Formatter &Formatter::operator<<(__type__ c) { \ - return (*this) << std::string(1, (char)c); \ - } \ +// NOLINT to suppress missing parentheses warning about __type__. +#define FORMATTER_INPUT_CHAR(__type__) \ + Formatter& Formatter::operator<<(__type__ c) { /* NOLINT */ \ + return (*this) << std::string(1, (char)c); \ + } FORMATTER_INPUT_CHAR(char); FORMATTER_INPUT_CHAR(signed char); |