Fix #1955 clang-tidy warning misc-macro-parentheses

clang-tidy gives warning "macro argument should be enclosed in
parentheses" to macro ZR_, the "first" parameter.
This commit is contained in:
Chih-Hung Hsieh 2016-09-02 15:28:42 -07:00
parent fa6428ed2a
commit 7c3f7c6a09
6 changed files with 14 additions and 14 deletions

View File

@ -1005,7 +1005,7 @@ void Method::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)

View File

@ -2419,7 +2419,7 @@ GenerateClear(io::Printer* printer) {
" &reinterpret_cast<$classname$*>(16)->f)\n" " &reinterpret_cast<$classname$*>(16)->f)\n"
"#endif\n\n" "#endif\n\n"
"#define ZR_(first, last) do {\\\n" "#define ZR_(first, last) do {\\\n"
" ::memset(&first, 0,\\\n" " ::memset(&(first), 0,\\\n"
" ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\\\n" " ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\\\n"
"} while (0)\n\n"; "} while (0)\n\n";
for (int i = 0; i < runs_of_fields_.size(); i++) { for (int i = 0; i < runs_of_fields_.size(); i++) {

View File

@ -2533,7 +2533,7 @@ void DescriptorProto_ExtensionRange::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -2836,7 +2836,7 @@ void DescriptorProto_ReservedRange::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -7347,7 +7347,7 @@ void MethodDescriptorProto::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -8163,7 +8163,7 @@ void FileOptions::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -9570,7 +9570,7 @@ void MessageOptions::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -10183,7 +10183,7 @@ void FieldOptions::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -11177,7 +11177,7 @@ void EnumOptions::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -13033,7 +13033,7 @@ void UninterpretedOption::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)
@ -14918,7 +14918,7 @@ void GeneratedCodeInfo_Annotation::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)

View File

@ -185,7 +185,7 @@ void Duration::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)

View File

@ -199,7 +199,7 @@ void Timestamp::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)

View File

@ -1125,7 +1125,7 @@ void Field::Clear() {
#endif #endif
#define ZR_(first, last) do {\ #define ZR_(first, last) do {\
::memset(&first, 0,\ ::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0) } while (0)