summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/androidfw/ResourceTypes.cpp2
-rw-r--r--tools/aapt/StringPool.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index d6dd983717c7..57a12f578c66 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6543,7 +6543,7 @@ bool ResTable::getIdmapInfo(const void* idmap, size_t sizeBytes,
#define CHAR16_TO_CSTR(c16, len) (String8(String16(c16,len)).string())
#define CHAR16_ARRAY_EQ(constant, var, len) \
- ((len == (sizeof(constant)/sizeof(constant[0]))) && (0 == memcmp((var), (constant), (len))))
+ (((len) == (sizeof(constant)/sizeof((constant)[0]))) && (0 == memcmp((var), (constant), (len))))
static void print_complex(uint32_t complex, bool isFraction)
{
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index 9908c44c6d1f..37a493329ade 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -390,12 +390,12 @@ sp<AaptFile> StringPool::createStringBlock()
#define ENCODE_LENGTH(str, chrsz, strSize) \
{ \
- size_t maxMask = 1 << ((chrsz*8)-1); \
+ size_t maxMask = 1 << (((chrsz)*8)-1); \
size_t maxSize = maxMask-1; \
- if (strSize > maxSize) { \
- *str++ = maxMask | ((strSize>>(chrsz*8))&maxSize); \
+ if ((strSize) > maxSize) { \
+ *(str)++ = maxMask | (((strSize)>>((chrsz)*8))&maxSize); \
} \
- *str++ = strSize; \
+ *(str)++ = strSize; \
}
status_t StringPool::writeStringBlock(const sp<AaptFile>& pool)