aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2016-06-21 18:15:36 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-06-21 18:15:36 +0000
commit36ad0207d67ef395b003dbf75d2c0193d3b8e093 (patch)
treec118ed244ee2f5d4795aefe44d64737cfc46be62
parent801dfc03cb0a439de7d901f230848cb585622479 (diff)
parent1a5fd9c155be65d49d51cd511097541897f4bb37 (diff)
downloadbionic-36ad0207d67ef395b003dbf75d2c0193d3b8e093.tar.gz
Merge "Fix misc-macro-parentheses warnings in bionic."
-rw-r--r--benchmarks/stdio_benchmark.cpp3
-rw-r--r--benchmarks/string_benchmark.cpp3
-rw-r--r--linker/dlfcn.cpp4
3 files changed, 4 insertions, 6 deletions
diff --git a/benchmarks/stdio_benchmark.cpp b/benchmarks/stdio_benchmark.cpp
index cc07128d4..a556d1723 100644
--- a/benchmarks/stdio_benchmark.cpp
+++ b/benchmarks/stdio_benchmark.cpp
@@ -20,8 +20,7 @@
#include <benchmark/benchmark.h>
-#define KB 1024
-#define MB 1024*KB
+constexpr auto KB = 1024;
#define AT_COMMON_SIZES \
Arg(1)->Arg(2)->Arg(3)->Arg(4)->Arg(8)->Arg(16)->Arg(32)->Arg(64)->Arg(512)-> \
diff --git a/benchmarks/string_benchmark.cpp b/benchmarks/string_benchmark.cpp
index c04409d5d..0a3851265 100644
--- a/benchmarks/string_benchmark.cpp
+++ b/benchmarks/string_benchmark.cpp
@@ -19,8 +19,7 @@
#include <benchmark/benchmark.h>
-#define KB 1024
-#define MB 1024*KB
+constexpr auto KB = 1024;
#define AT_COMMON_SIZES \
Arg(8)->Arg(64)->Arg(512)->Arg(1*KB)->Arg(8*KB)->Arg(16*KB)->Arg(32*KB)->Arg(64*KB)
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index 743b01ddb..a3ebcd646 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -176,14 +176,14 @@ android_namespace_t* android_create_namespace(const char* name,
{ name_offset, \
reinterpret_cast<Elf32_Addr>(value), \
/* st_size */ 0, \
- (shndx == 0) ? 0 : (STB_GLOBAL << 4), \
+ ((shndx) == 0) ? 0 : (STB_GLOBAL << 4), \
/* st_other */ 0, \
shndx, \
}
#define ELF64_SYM_INITIALIZER(name_offset, value, shndx) \
{ name_offset, \
- (shndx == 0) ? 0 : (STB_GLOBAL << 4), \
+ ((shndx) == 0) ? 0 : (STB_GLOBAL << 4), \
/* st_other */ 0, \
shndx, \
reinterpret_cast<Elf64_Addr>(value), \