Fix misc-macro-parentheses warnings.
* Add parentheses to fix warnings.
* Use NOLINT to suppress wrong clang-tidy warnings.
Bug: 28705665
Change-Id: Icc8bc9b59583dee0ea17ab83e0ff0383b8599c3e
diff --git a/runtime/base/logging.h b/runtime/base/logging.h
index 3b5b8b5..41a1aee 100644
--- a/runtime/base/logging.h
+++ b/runtime/base/logging.h
@@ -140,11 +140,11 @@
// Helper for CHECK_STRxx(s1,s2) macros.
#define CHECK_STROP(s1, s2, sense) \
- if (UNLIKELY((strcmp(s1, s2) == 0) != sense)) \
+ if (UNLIKELY((strcmp(s1, s2) == 0) != (sense))) \
LOG(::art::FATAL) << "Check failed: " \
- << "\"" << s1 << "\"" \
- << (sense ? " == " : " != ") \
- << "\"" << s2 << "\""
+ << "\"" << (s1) << "\"" \
+ << ((sense) ? " == " : " != ") \
+ << "\"" << (s2) << "\""
// Check for string (const char*) equality between s1 and s2, LOG(FATAL) if not.
#define CHECK_STREQ(s1, s2) CHECK_STROP(s1, s2, true)
@@ -156,7 +156,7 @@
int rc = call args; \
if (rc != 0) { \
errno = rc; \
- PLOG(::art::FATAL) << # call << " failed for " << what; \
+ PLOG(::art::FATAL) << # call << " failed for " << (what); \
} \
} while (false)