NdcDispatcher - fix bugprone-macro-parentheses warnings
Fixes:
system/netd/server/NdcDispatcher.cpp:55:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
system/netd/server/NdcDispatcher.cpp:57:13: ...
system/netd/server/NdcDispatcher.cpp:64:47: ...
system/netd/server/NdcDispatcher.cpp:66:13: ...
Test: builds
Bug: 153035880
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I50f89e8b2e90c623c5473f543e38e16ac973a3c4
Merged-In: I50f89e8b2e90c623c5473f543e38e16ac973a3c4
diff --git a/server/NdcDispatcher.cpp b/server/NdcDispatcher.cpp
index d2ad6d4..d2f790c 100644
--- a/server/NdcDispatcher.cpp
+++ b/server/NdcDispatcher.cpp
@@ -50,22 +50,22 @@
using android::base::StringPrintf;
using android::binder::Status;
-#define PARSE_INT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \
- do { \
- if (!android::base::ParseInt(label, &intLabel)) { \
- errno = EINVAL; \
- cli->sendMsg(ResponseCode::OperationFailed, errMsg, addErrno); \
- return 0; \
- } \
+#define PARSE_INT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \
+ do { \
+ if (!android::base::ParseInt((label), &(intLabel))) { \
+ errno = EINVAL; \
+ (cli)->sendMsg(ResponseCode::OperationFailed, (errMsg), (addErrno)); \
+ return 0; \
+ } \
} while (0)
-#define PARSE_UINT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \
- do { \
- if (!android::base::ParseUint(label, &intLabel)) { \
- errno = EINVAL; \
- cli->sendMsg(ResponseCode::OperationFailed, errMsg, addErrno); \
- return 0; \
- } \
+#define PARSE_UINT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \
+ do { \
+ if (!android::base::ParseUint((label), &(intLabel))) { \
+ errno = EINVAL; \
+ (cli)->sendMsg(ResponseCode::OperationFailed, (errMsg), (addErrno)); \
+ return 0; \
+ } \
} while (0)
namespace android {