TrafficController - fix macro arg should be in paren warning
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Test: builds
Bug: 153035880
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9ac6a4ef26f65f013798608ad8e480e31e19c2ad
Merged-In: I9ac6a4ef26f65f013798608ad8e480e31e19c2ad
diff --git a/server/TrafficController.cpp b/server/TrafficController.cpp
index 36ccf53..e2b88a6 100644
--- a/server/TrafficController.cpp
+++ b/server/TrafficController.cpp
@@ -85,12 +85,12 @@
static_assert(STATS_MAP_SIZE - TOTAL_UID_STATS_ENTRIES_LIMIT > 100,
"The limit for stats map is to high, stats data may be lost due to overflow");
-#define FLAG_MSG_TRANS(result, flag, value) \
- do { \
- if (value & flag) { \
- result.append(StringPrintf(" %s", #flag)); \
- value &= ~flag; \
- } \
+#define FLAG_MSG_TRANS(result, flag, value) \
+ do { \
+ if ((value) & (flag)) { \
+ (result).append(" " #flag); \
+ (value) &= ~(flag); \
+ } \
} while (0)
const std::string uidMatchTypeToString(uint8_t match) {