resolve merge conflicts of c9badf1 to nyc-dev-plus-aosp am: 78e2c9c17f
am: e08ba2f988

* commit 'e08ba2f9883d0954c0adc32494fadd951a9a4ab0':
  Fix misc-macro-parentheses warnings.

Change-Id: I39114bf48f739ba5aaa9398afeb278844bb065c5
diff --git a/libril/RilSapSocket.cpp b/libril/RilSapSocket.cpp
index b4234d1..3a66f8c 100644
--- a/libril/RilSapSocket.cpp
+++ b/libril/RilSapSocket.cpp
@@ -226,18 +226,18 @@
 #define BYTES_PER_LINE 16
 
 #define NIBBLE_TO_HEX(n) ({ \
-  uint8_t __n = (uint8_t) n & 0x0f; \
+  uint8_t __n = (uint8_t) (n) & 0x0f; \
   __nibble >= 10 ? 'A' + __n - 10: '0' + __n; \
 })
 
 #define HEX_HIGH(b) ({ \
-  uint8_t __b = (uint8_t) b; \
+  uint8_t __b = (uint8_t) (b); \
   uint8_t __nibble = (__b >> 4) & 0x0f; \
   NIBBLE_TO_HEX(__nibble); \
 })
 
 #define HEX_LOW(b) ({ \
-  uint8_t __b = (uint8_t) b; \
+  uint8_t __b = (uint8_t) (b); \
   uint8_t __nibble = __b & 0x0f; \
   NIBBLE_TO_HEX(__nibble); \
 })
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 5e55b7e..2dfd896 100755
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -92,8 +92,8 @@
 #define RESPONSE_UNSOLICITED_ACK_EXP 4
 
 /* Negative values for private RIL errno's */
-#define RIL_ERRNO_INVALID_RESPONSE -1
-#define RIL_ERRNO_NO_MEMORY -12
+#define RIL_ERRNO_INVALID_RESPONSE (-1)
+#define RIL_ERRNO_NO_MEMORY (-12)
 
 // request, response, and unsolicited msg print macro
 #define PRINTBUF_SIZE 8096
diff --git a/reference-ril/atchannel.c b/reference-ril/atchannel.c
index 6124d88..84e8c37 100644
--- a/reference-ril/atchannel.c
+++ b/reference-ril/atchannel.c
@@ -36,7 +36,7 @@
 #include "misc.h"
 
 
-#define NUM_ELEMS(x) (sizeof(x)/sizeof(x[0]))
+#define NUM_ELEMS(x) (sizeof(x)/sizeof((x)[0]))
 
 #define MAX_AT_RESPONSE (8 * 1024)
 #define HANDSHAKE_RETRY_COUNT 8