clang-tidy: Enable readability-implicit-bool
Modified code to address issues flagged by
readability-implicit-bool-conversion check.
Tested: Build and unit tests passed successfully.
Change-Id: Ic7a15466ea628629eb4a98233b12523fbbbe794d
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/.clang-tidy b/.clang-tidy
index c36a725..bce8ba2 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -296,6 +296,7 @@
readability-deleted-default,
readability-function-size,
readability-identifier-naming,
+readability-implicit-bool-conversion
readability-isolate-declaration,
readability-misleading-indentation,
readability-misplaced-array-index,
diff --git a/watch.cpp b/watch.cpp
index 35205da..9b6b6f3 100644
--- a/watch.cpp
+++ b/watch.cpp
@@ -80,7 +80,7 @@
{
auto userData = static_cast<Watch*>(userdata);
- if (!(revents & userData->events))
+ if ((revents & userData->events) == 0U)
{
return 0;
}
@@ -111,7 +111,7 @@
auto event = reinterpret_cast<inotify_event*>(&buffer[offset]);
auto mask = event->mask & userData->mask;
- if (mask)
+ if (mask != 0U)
{
userMap.emplace((userData->path / event->name), mask);
}