From b0e17c9e91bd51a129933e46ef1b68e57bb4b5f3 Mon Sep 17 00:00:00 2001 From: Krzysztof Wesolowski Date: Thu, 30 Nov 2017 10:11:13 +0100 Subject: [PATCH] Improve ALOGV compatiblity with clang-tidy Currently used clang tidy does not filter the warnings caused by macros, even if macros come from filtered headers. This change allows projects using ALOGV to use readability-implicit-bool-conversion without spreading //NOLINT everywhere. Bug: 71533509 Change-Id: Id1b193d1e56d13f00171e04f600292877c5f6cb3 --- liblog/include/log/log_main.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h index 339a06d86..21fc7cca0 100644 --- a/liblog/include/log/log_main.h +++ b/liblog/include/log/log_main.h @@ -17,6 +17,8 @@ #ifndef _LIBS_LOG_LOG_MAIN_H #define _LIBS_LOG_LOG_MAIN_H +#include + #include #include @@ -175,10 +177,10 @@ __BEGIN_DECLS #if LOG_NDEBUG #define ALOGV(...) \ do { \ - if (0) { \ + if (false) { \ __ALOGV(__VA_ARGS__); \ } \ - } while (0) + } while (false) #else #define ALOGV(...) __ALOGV(__VA_ARGS__) #endif