From 4d52b43cb6f5c5fed9256c37212911b2de4c3344 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Thu, 12 May 2016 10:07:30 -0700 Subject: [PATCH] Fix misc-macro-parentheses warnings. Bug: 28705665 Change-Id: Ie514abfe12bea065658da3706aad8b4c9c0a93c7 --- modules/camera/ExampleCamera.cpp | 2 +- modules/consumerir/consumerir.c | 2 +- modules/usbcamera/UsbCamera.cpp | 2 +- tests/hwc/cnativewindow.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/camera/ExampleCamera.cpp b/modules/camera/ExampleCamera.cpp index d8733217..2b1f1856 100644 --- a/modules/camera/ExampleCamera.cpp +++ b/modules/camera/ExampleCamera.cpp @@ -26,7 +26,7 @@ #include "ExampleCamera.h" -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) namespace default_camera_hal { diff --git a/modules/consumerir/consumerir.c b/modules/consumerir/consumerir.c index f3eac0b9..b0ff9406 100644 --- a/modules/consumerir/consumerir.c +++ b/modules/consumerir/consumerir.c @@ -22,7 +22,7 @@ #include #include -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) static const consumerir_freq_range_t consumerir_freqs[] = { {.min = 30000, .max = 30000}, diff --git a/modules/usbcamera/UsbCamera.cpp b/modules/usbcamera/UsbCamera.cpp index 82a1145c..d0aadede 100644 --- a/modules/usbcamera/UsbCamera.cpp +++ b/modules/usbcamera/UsbCamera.cpp @@ -26,7 +26,7 @@ #include "Camera.h" #include "UsbCamera.h" -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) namespace usb_camera_hal { diff --git a/tests/hwc/cnativewindow.c b/tests/hwc/cnativewindow.c index 5c16afbe..5b1d78ea 100644 --- a/tests/hwc/cnativewindow.c +++ b/tests/hwc/cnativewindow.c @@ -37,7 +37,7 @@ typedef struct ANativeWindow aWindow; static int trace_level = 1; #define _TRACE(n,fmt...) \ - do { if (trace_level >= n) fprintf(stderr, "CNW: " fmt); } while (0) + do { if (trace_level >= (n)) fprintf(stderr, "CNW: " fmt); } while (0) #define ERROR(fmt...) _TRACE(0, fmt) #define INFO(fmt...) _TRACE(1, fmt)