diff options
author | Dan Albert <danalbert@google.com> | 2014-09-08 18:28:00 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-09-08 18:30:08 -0700 |
commit | f348c15ecf78e9d58b8238ffcf1d78a279e3a862 (patch) | |
tree | fad413b2f2b3d849eaf83e607a8336683adb8b63 /tools | |
parent | 2a1ed46decbc8e21a39367a4b7770111392167c3 (diff) | |
download | frameworks_base-f348c15ecf78e9d58b8238ffcf1d78a279e3a862.zip frameworks_base-f348c15ecf78e9d58b8238ffcf1d78a279e3a862.tar.gz frameworks_base-f348c15ecf78e9d58b8238ffcf1d78a279e3a862.tar.bz2 |
Use char16_t for char things.
When compiling in C++ mode, the compiler will complain about conversions
from uint16_t to char16_t. Be consistent in using char16_t for strings.
Change-Id: I052b6176ced635162920b31560052d9a64f92764
Diffstat (limited to 'tools')
-rw-r--r-- | tools/aapt/Command.cpp | 6 | ||||
-rw-r--r-- | tools/aapt/Resource.cpp | 8 | ||||
-rw-r--r-- | tools/aapt/ResourceTable.cpp | 10 | ||||
-rw-r--r-- | tools/aapt/StringPool.cpp | 6 | ||||
-rw-r--r-- | tools/aapt/StringPool.h | 2 | ||||
-rw-r--r-- | tools/aapt/XMLNode.cpp | 18 |
6 files changed, 25 insertions, 25 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index f7de558..4dc9bfc 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -253,7 +253,7 @@ String8 getAttribute(const ResXMLTree& tree, const char* ns, } } 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(); } @@ -271,7 +271,7 @@ static String8 getAttribute(const ResXMLTree& tree, uint32_t attrRes, String8* o } } 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(); } @@ -325,7 +325,7 @@ static String8 getResolvedAttribute(const ResTable* resTable, const ResXMLTree& 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); diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 4d29ff7..f842bee 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -250,7 +250,7 @@ static status_t parsePackage(Bundle* bundle, const sp<AaptAssets>& assets, ssize_t minSdkIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "minSdkVersion"); if (minSdkIndex >= 0) { - const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len); + const char16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len); const char* minSdk8 = strdup(String8(minSdk16).string()); bundle->setManifestMinSdkVersion(minSdk8); } @@ -456,7 +456,7 @@ static int validateAttr(const String8& path, const ResTable& table, size_t len; ssize_t index = parser.indexOfAttribute(ns, attr); - const uint16_t* str; + const char16_t* str; Res_value value; if (index >= 0 && parser.getAttributeValue(index, &value) >= 0) { const ResStringPool* pool = &parser.getStrings(); @@ -1422,7 +1422,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets) } size_t len; ssize_t index = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "name"); - const uint16_t* id = block.getAttributeStringValue(index, &len); + const char16_t* id = block.getAttributeStringValue(index, &len); if (id == NULL) { fprintf(stderr, "%s:%d: missing name attribute in element <%s>.\n", manifestPath.string(), block.getLineNumber(), @@ -1465,7 +1465,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets) hasErrors = true; } syms->addStringSymbol(String8(e), idStr, srcPos); - const uint16_t* cmt = block.getComment(&len); + const char16_t* cmt = block.getComment(&len); if (cmt != NULL && *cmt != 0) { //printf("Comment of %s: %s\n", String8(e).string(), // String8(cmt).string()); diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index cf271a9..6632809 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -388,7 +388,7 @@ static status_t compileAttribute(const sp<AaptFile>& in, ssize_t l10nIdx = block.indexOfAttribute(NULL, "localization"); if (l10nIdx >= 0) { - const uint16_t* str = block.getAttributeStringValue(l10nIdx, &len); + const char16_t* str = block.getAttributeStringValue(l10nIdx, &len); bool error; uint32_t l10n_required = parse_flags(str, len, l10nRequiredFlags, &error); if (error) { @@ -1323,7 +1323,7 @@ status_t compileResourceFile(Bundle* bundle, size_t n = block.getAttributeCount(); for (size_t i = 0; i < n; i++) { size_t length; - const uint16_t* attr = block.getAttributeName(i, &length); + const char16_t* attr = block.getAttributeName(i, &length); if (strcmp16(attr, name16.string()) == 0) { name.setTo(block.getAttributeStringValue(i, &length)); } else if (strcmp16(attr, translatable16.string()) == 0) { @@ -1439,14 +1439,14 @@ status_t compileResourceFile(Bundle* bundle, // translatable. for (size_t i = 0; i < n; i++) { size_t length; - const uint16_t* attr = block.getAttributeName(i, &length); + const char16_t* attr = block.getAttributeName(i, &length); if (strcmp16(attr, formatted16.string()) == 0) { - const uint16_t* value = block.getAttributeStringValue(i, &length); + const char16_t* value = block.getAttributeStringValue(i, &length); if (strcmp16(value, false16.string()) == 0) { curIsFormatted = false; } } else if (strcmp16(attr, translatable16.string()) == 0) { - const uint16_t* value = block.getAttributeStringValue(i, &length); + const char16_t* value = block.getAttributeStringValue(i, &length); if (strcmp16(value, false16.string()) == 0) { isTranslatable = false; } diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp index 158b391..c7fd040 100644 --- a/tools/aapt/StringPool.cpp +++ b/tools/aapt/StringPool.cpp @@ -21,7 +21,7 @@ #define NOISY(x) //x -void strcpy16_htod(uint16_t* dst, const uint16_t* src) +void strcpy16_htod(char16_t* dst, const char16_t* src) { while (*src) { char16_t s = htods(*src); @@ -447,9 +447,9 @@ status_t StringPool::writeStringBlock(const sp<AaptFile>& pool) strncpy((char*)strings, encStr, encSize+1); } else { - uint16_t* strings = (uint16_t*)dat; + char16_t* strings = (char16_t*)dat; - ENCODE_LENGTH(strings, sizeof(uint16_t), strSize) + ENCODE_LENGTH(strings, sizeof(char16_t), strSize) strcpy16_htod(strings, ent.value); } diff --git a/tools/aapt/StringPool.h b/tools/aapt/StringPool.h index 1b3abfd..1b5a7ba 100644 --- a/tools/aapt/StringPool.h +++ b/tools/aapt/StringPool.h @@ -26,7 +26,7 @@ using namespace android; #define PRINT_STRING_METRICS 0 -void strcpy16_htod(uint16_t* dst, const uint16_t* src); +void strcpy16_htod(char16_t* dst, const char16_t* src); void printStringPool(const ResStringPool* pool); diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp index 607d419..03c66c1 100644 --- a/tools/aapt/XMLNode.cpp +++ b/tools/aapt/XMLNode.cpp @@ -234,9 +234,9 @@ status_t parseStyledString(Bundle* bundle, const String8 element8(element16); size_t nslen; - const uint16_t* ns = inXml->getElementNamespace(&nslen); + const char16_t* ns = inXml->getElementNamespace(&nslen); if (ns == NULL) { - ns = (const uint16_t*)"\0\0"; + ns = (const char16_t*)"\0\0"; nslen = 0; } const String8 nspace(String16(ns, nslen)); @@ -291,9 +291,9 @@ moveon: } else if (code == ResXMLTree::END_TAG) { size_t nslen; - const uint16_t* ns = inXml->getElementNamespace(&nslen); + const char16_t* ns = inXml->getElementNamespace(&nslen); if (ns == NULL) { - ns = (const uint16_t*)"\0\0"; + ns = (const char16_t*)"\0\0"; nslen = 0; } const String8 nspace(String16(ns, nslen)); @@ -422,7 +422,7 @@ static String8 make_prefix(int depth) } static String8 build_namespace(const Vector<namespace_entry>& namespaces, - const uint16_t* ns) + const char16_t* ns) { String8 str; if (ns != NULL) { @@ -453,9 +453,9 @@ void printXMLBlock(ResXMLTree* block) int i; if (code == ResXMLTree::START_TAG) { size_t len; - const uint16_t* ns16 = block->getElementNamespace(&len); + const char16_t* ns16 = block->getElementNamespace(&len); String8 elemNs = build_namespace(namespaces, ns16); - const uint16_t* com16 = block->getComment(&len); + const char16_t* com16 = block->getComment(&len); if (com16) { printf("%s <!-- %s -->\n", prefix.string(), String8(com16).string()); } @@ -503,7 +503,7 @@ void printXMLBlock(ResXMLTree* block) } else if (code == ResXMLTree::START_NAMESPACE) { namespace_entry ns; size_t len; - const uint16_t* prefix16 = block->getNamespacePrefix(&len); + const char16_t* prefix16 = block->getNamespacePrefix(&len); if (prefix16) { ns.prefix = String8(prefix16); } else { @@ -518,7 +518,7 @@ void printXMLBlock(ResXMLTree* block) depth--; const namespace_entry& ns = namespaces.top(); size_t len; - const uint16_t* prefix16 = block->getNamespacePrefix(&len); + const char16_t* prefix16 = block->getNamespacePrefix(&len); String8 pr; if (prefix16) { pr = String8(prefix16); |