Fix issues that will be present in C++11
- char16_t is a distinct type, so stay consistent
with it throughout the code base.
- char16_t is defined as minimum size of 16 bits.
Since we mmap and cast data structures onto raw memory,
we need a precise definition (uint16_t), so we cast between
that (and static_assert that they are the same size).
Change-Id: I869c32637543bbcfb39d2643e7d9df10d33acd3c
diff --git a/tools/aapt/AaptXml.cpp b/tools/aapt/AaptXml.cpp
index 708e405..b04a55d 100644
--- a/tools/aapt/AaptXml.cpp
+++ b/tools/aapt/AaptXml.cpp
@@ -41,7 +41,7 @@
}
size_t len;
- const uint16_t* str = tree.getAttributeStringValue(attrIndex, &len);
+ const char16_t* str = tree.getAttributeStringValue(attrIndex, &len);
return str ? String8(str, len) : String8();
}
@@ -103,7 +103,7 @@
if (tree.getAttributeValue(idx, &value) != NO_ERROR) {
if (value.dataType == Res_value::TYPE_STRING) {
size_t len;
- const uint16_t* str = tree.getAttributeStringValue(idx, &len);
+ const char16_t* str = tree.getAttributeStringValue(idx, &len);
return str ? String8(str, len) : String8();
}
resTable.resolveReference(&value, 0);