From: Jean-Baptiste Queru Date: Sat, 2 Jun 2012 16:21:36 +0000 (-0700) Subject: Merge "aapt: Remove terminal pointer incrementaion" X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/1beaac92e4594d6d76c2da521341c1effd1d2313?ds=inline;hp=-c Merge "aapt: Remove terminal pointer incrementaion" --- 1beaac92e4594d6d76c2da521341c1effd1d2313 diff --combined ResourceTable.cpp index 770b027,a417311..d051c29 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@@ -2253,7 -2253,6 +2253,6 @@@ bool ResourceTable::getAttributeFlags bool failed = false; while (pos < end && !failed) { const char16_t* start = pos; - end++; while (pos < end && *pos != '|') { pos++; } @@@ -2661,12 -2660,6 +2660,12 @@@ status_t ResourceTable::flatten(Bundle const bool filterable = (typeName != mipmap16); const size_t N = t != NULL ? t->getOrderedConfigs().size() : 0; + + // Until a non-NO_ENTRY value has been written for a resource, + // that resource is invalid; validResources[i] represents + // the item at t->getOrderedConfigs().itemAt(i). + Vector validResources; + validResources.insertAt(false, 0, N); // First write the typeSpec chunk, containing information about // each resource entry in this type. @@@ -2803,7 -2796,6 +2802,7 @@@ if (amt < 0) { return amt; } + validResources.editItemAt(ei) = true; } else { index[ei] = htodl(ResTable_type::NO_ENTRY); } @@@ -2814,14 -2806,6 +2813,14 @@@ (((uint8_t*)data->editData()) + typeStart); tHeader->header.size = htodl(data->getSize()-typeStart); } + + for (size_t i = 0; i < N; ++i) { + if (!validResources[i]) { + sp c = t->getOrderedConfigs().itemAt(i); + fprintf(stderr, "warning: no entries written for %s/%s\n", + String8(typeName).string(), String8(c->getName()).string()); + } + } } // Fill in the rest of the package information. @@@ -3624,7 -3608,9 +3623,7 @@@ sp ResourceTabl { sp p = mPackages.valueFor(package); if (p == NULL) { - if (mBundle->getIsOverlayPackage()) { - p = new Package(package, 0x00); - } else if (mIsAppPackage) { + if (mIsAppPackage) { if (mHaveAppPackage) { fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n" "Use -x to create extended resources.\n");