Lines Matching refs:size

67 // size measured in sizeof(uint32_t)
102 const uint32_t size = dtohl(chunk->size);
105 if (headerSize <= size) {
106 if (((headerSize|size)&0x3) == 0) {
107 if ((ssize_t)size <= (dataEnd-((const uint8_t*)chunk))) {
110 ALOGW("%s data size %p extends beyond resource end %p.",
111 name, (void*)size,
115 ALOGW("%s size 0x%x or headerSize 0x%x is not on an integer boundary.",
116 name, (int)size, (int)headerSize);
119 ALOGW("%s size %p is smaller than header size %p.",
120 name, (void*)size, (void*)(int)headerSize);
123 ALOGW("%s header size %p is too small.",
130 size = dtohs(src.size);
172 // The size of this struct is 32 bytes on the 32-bit target system
224 ALOGW("idmap assertion failed: size=%d bytes\n", (int)sizeBytes);
242 // size of data block, in uint32_t
243 const size_t size = (sizeBytes - ResTable::IDMAP_HEADER_SIZE_BYTES) / sizeof(uint32_t);
252 if (typeCount > size) {
253 ALOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, (int)size);
261 if (typeOffset + 1 > size) {
262 ALOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n",
263 typeOffset, (int)size);
273 if (index > size) {
274 ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, (int)size);
315 ResStringPool::ResStringPool(const void* data, size_t size, bool copyData)
318 setTo(data, size, copyData);
326 status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)
328 if (!data || !size) {
337 mOwnedData = malloc(size);
341 memcpy(mOwnedData, data, size);
351 h->header.size = dtohl(mHeader->header.size);
359 if (mHeader->header.headerSize > mHeader->header.size
360 || mHeader->header.size > size) {
361 ALOGW("Bad string block: header size %d or total size %d is larger than data size %d\n",
362 (int)mHeader->header.headerSize, (int)mHeader->header.size, (int)size);
365 mSize = mHeader->header.size;
372 > size) {
373 ALOGW("Bad string block: entry of %d items extends past data size %d\n",
375 (int)size);
389 if (mHeader->stringsStart >= (mHeader->header.size-sizeof(uint16_t))) {
390 ALOGW("Bad string block: string pool starts at %d, after total size %d\n",
391 (int)mHeader->stringsStart, (int)mHeader->header.size);
396 (mHeader->header.size-mHeader->stringsStart)/charSize;
399 if (mHeader->stylesStart >= (mHeader->header.size-sizeof(uint16_t))) {
400 ALOGW("Bad style block: style block starts at %d past data size of %d\n",
401 (int)mHeader->stylesStart, (int)mHeader->header.size);
416 ALOGW("Bad string block: stringCount is %d but pool size is 0\n", (int)mHeader->stringCount);
455 if (((const uint8_t*)mEntryStyles-(const uint8_t*)mHeader) > (int)size) {
456 ALOGW("Bad string block: entry of %d styles extends past data size %d\n",
458 (int)size);
463 if (mHeader->stylesStart >= mHeader->header.size) {
464 ALOGW("Bad string block: style pool starts %d, after total size %d\n",
465 (int)mHeader->stylesStart, (int)mHeader->header.size);
469 (mHeader->header.size-mHeader->stylesStart)/sizeof(uint32_t);
745 size_t ResStringPool::size() const
757 return (mError == NO_ERROR) ? mHeader->header.size : 0;
1044 return indexOfAttribute(ns ? nsStr.string() : NULL, ns ? nsStr.size() : 0,
1045 attrStr.string(), attrStr.size());
1111 (((const uint8_t*)mCurNode) + dtohl(mCurNode->header.size));
1126 const uint32_t totalSize = dtohl(next->header.size);
1152 ALOGW("Bad XML block: header type 0x%x in node at 0x%x has size %d, need %d\n",
1193 ResXMLTree::ResXMLTree(const void* data, size_t size, bool copyData)
1198 setTo(data, size, copyData);
1207 status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData)
1213 mOwnedData = malloc(size);
1217 memcpy(mOwnedData, data, size);
1222 mSize = dtohl(mHeader->header.size);
1223 if (dtohs(mHeader->header.headerSize) > mSize || mSize > size) {
1224 ALOGW("Bad XML block: header size %d or total size %d is larger than data size %d\n",
1226 (int)dtohl(mHeader->header.size), (int)size);
1244 ((const uint8_t*)chunk) < (mDataEnd-dtohl(chunk->size))) {
1251 const size_t size = dtohl(chunk->size);
1252 XML_NOISY(printf("Scanning @ %p: type=0x%x, size=0x%x\n",
1253 (void*)(((uint32_t)chunk)-((uint32_t)mHeader)), type, size));
1255 mStrings.setTo(chunk, size);
1259 mNumResIds = (dtohl(chunk->size)-dtohs(chunk->headerSize))/sizeof(uint32_t);
1280 (((const uint8_t*)chunk) + size);
1327 const uint32_t size = dtohl(node->header.size);
1331 if ((size >= headerSize + sizeof(ResXMLTree_attrExt))
1335 if ((dtohs(attrExt->attributeStart)+attrSize) <= (size-headerSize)) {
1340 (unsigned int)(size-headerSize));
1343 ALOGW("Bad XML start block: node header size 0x%x, size 0x%x\n",
1344 (unsigned int)headerSize, (unsigned int)size);
1355 const uint32_t size = dtohl(node->header.size);
1358 if (size >= headerSize) {
1359 if (((const uint8_t*)node) <= (mDataEnd-size)) {
1364 <= (size-headerSize)) {
1369 (int)(size-headerSize));
1376 ALOGW("Bad XML block: node at 0x%x header size 0x%x smaller than total size 0x%x\n",
1378 (int)headerSize, (int)size);
1381 ALOGW("Bad XML block: node at 0x%x header size 0x%x too small\n",
1393 const size_t size = dtohl(o.size);
1394 if (size >= sizeof(ResTable_config)) {
1397 memcpy(this, &o, size);
1398 memset(((uint8_t*)this)+size, 0, sizeof(ResTable_config)-size);
1404 size = sizeof(ResTable_config);
1418 size = htodl(size);
1706 // The configuration closest to the actual size is best.
1745 // requested size is at least normal; otherwise, small
1755 // For screen size, the best match is the one that is
1756 // closest to the requested screen size, but not over
1875 // size value.
2045 if (res.size() > 0) res.append("-");
2049 if (res.size() > 0) res.append("-");
2053 if (res.size() > 0) res.append("-");
2057 if (res.size() > 0) res.append("-");
2061 if (res.size() > 0) res.append("-");
2076 if (res.size() > 0) res.append("-");
2080 if (res.size() > 0) res.append("-");
2084 if (res.size() > 0) res.append("-");
2088 if (res.size() > 0) res.append("-");
2109 if (res.size() > 0) res.append("-");
2124 if (res.size() > 0) res.append("-");
2141 if (res.size() > 0) res.append("-");
2162 if (res.size() > 0) res.append("-");
2177 if (res.size() > 0) res.append("-");
2206 if (res.size() > 0) res.append("-");
2223 if (res.size() > 0) res.append("-");
2240 if (res.size() > 0) res.append("-");
2254 if (res.size() > 0) res.append("-");
2274 if (res.size() > 0) res.append("-");
2289 if (res.size() > 0) res.append("-");
2293 if (res.size() > 0) res.append("-");
2320 size_t size;
2349 size_t i = types.size();
2365 return idx < types.size() ? types[idx] : NULL;
2378 const size_t N = packages.size();
2722 ResTable::ResTable(const void* data, size_t size, void* cookie, bool copyData)
2727 add(data, size, cookie, copyData);
2743 status_t ResTable::add(const void* data, size_t size, void* cookie, bool copyData,
2746 return add(data, size, cookie, NULL, copyData, reinterpret_cast<const Asset*>(idmap));
2756 size_t size = (size_t)asset->getLength();
2757 return add(data, size, cookie, asset, copyData, reinterpret_cast<const Asset*>(idmap));
2764 for (size_t i=0; i<src->mHeaders.size(); i++) {
2768 for (size_t i=0; i<src->mPackageGroups.size(); i++) {
2771 for (size_t j=0; j<srcPg->packages.size(); j++) {
2784 status_t ResTable::add(const void* data, size_t size, void* cookie,
2789 header->index = mHeaders.size();
2807 ALOGV("Adding resources to ResTable: data=%p, size=0x%x, cookie=%p, asset=%p, copy=%d "
2808 "idmap=%p\n", data, size, cookie, asset, copyData, idmap));
2811 header->ownedData = malloc(size);
2815 memcpy(header->ownedData, data, size);
2820 header->size = dtohl(header->header->header.size);
2821 //ALOGI("Got size 0x%x, again size 0x%x, raw size 0x%x\n", header->size,
2822 // dtohl(header->header->header.size), header->header->header.size);
2824 LOAD_TABLE_NOISY(printHexData(2, header->header, header->size < 256 ? header->size : 256,
2826 if (dtohs(header->header->header.headerSize) > header->size
2827 || header->size > size) {
2828 ALOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n",
2830 (int)header->size, (int)size);
2833 if (((dtohs(header->header->header.headerSize)|header->size)&0x3) != 0) {
2834 ALOGW("Bad resource table: header size 0x%x or total size 0x%x is not on an integer boundary\n",
2836 (int)header->size);
2839 header->dataEnd = ((const uint8_t*)header->header) + header->size;
2848 ((const uint8_t*)chunk) <= (header->dataEnd-dtohl(chunk->size))) {
2853 TABLE_NOISY(ALOGV("Chunk: type=0x%x, headerSize=0x%x, size=0x%x, pos=%p\n",
2854 dtohs(chunk->type), dtohs(chunk->headerSize), dtohl(chunk->size),
2856 const size_t csize = dtohl(chunk->size);
2919 size_t N = mPackageGroups.size();
2924 N = mHeaders.size();
2967 if (grp->packages.size() > 0) {
2978 outName->packageLen = grp->name.size();
3048 size_t ip = grp->packages.size();
3098 << HexDump(type, dtohl(type->header.size)) << endl);
3100 if ((size_t)offset > (dtohl(type->header.size)-sizeof(Res_value))) {
3102 (int)offset, dtohl(type->header.size));
3135 outValue->size = dtohs(bestValue->size);
3325 size_t ip = grp->packages.size();
3381 const uint16_t entrySize = dtohs(entry->size);
3389 TABLE_NOISY(ALOGI("Found map: size=%p parent=%p count=%d\n",
3442 if ((size_t)curOff > (dtohl(type->header.size)-sizeof(ResTable_map))) {
3444 (int)curOff, dtohl(type->header.size));
3501 const size_t size = dtohs(map->value.size);
3502 curOff += size + sizeof(*map)-sizeof(map->value);
3527 for (size_t i=0; i<mPackageGroups.size(); i++) {
3664 const size_t NG = mPackageGroups.size();
3669 group->name.string(), group->name.size())) {
3689 if (typeConfigs == NULL || typeConfigs->configs.size() <= 0) {
3694 size_t NTC = typeConfigs->configs.size();
3699 const uint8_t* const end = ((const uint8_t*)ty) + dtohl(ty->header.size);
3712 if (offset > (dtohl(ty->header.size)-sizeof(ResTable_entry))) {
3714 offset, dtohl(ty->header.size));
3728 if (dtohs(entry->size) < sizeof(*entry)) {
3729 ALOGW("ResTable_entry size %d is too small", dtohs(entry->size));
4073 outValue->size = sizeof(Res_value);
4180 uint32_t rid = identifierForName(name.string(), name.size(), type.string(),
4181 type.size(), package.string(), package.size(), &specFlags);
4334 identifierForName(name.string(), name.size(),
4335 type.string(), type.size(),
4336 package.string(), package.size(), &specFlags);
4717 if (tmp.size() != 0) {
4742 return mPackageGroups.size();
4750 LOG_FATAL_IF(idx >= mPackageGroups.size(),
4752 (int)idx, (int)mPackageGroups.size());
4761 LOG_FATAL_IF(idx >= mPackageGroups.size(),
4763 (int)idx, (int)mPackageGroups.size());
4769 return mHeaders.size();
4784 const size_t I = mPackageGroups.size();
4787 const size_t J = packageGroup->packages.size();
4790 const size_t K = package->types.size();
4794 const size_t L = type->configs.size();
4799 const size_t M = configs->size();
4821 ALOGV("called getConfigurations size=%d", (int)configs.size());
4822 const size_t I = configs.size();
4826 const size_t J = locales->size();
4866 const size_t NT = allTypes->configs.size();
4875 entryIndex, typeIndex+1, dtohl(thisType->config.size),
4887 + dtohl(thisType->header.size);
4925 if (offset > (dtohl(type->header.size)-sizeof(ResTable_entry))) {
4927 offset, dtohl(type->header.size));
4938 if (dtohs(entry->size) < sizeof(*entry)) {
4939 ALOGW("ResTable_entry size 0x%x is too small", dtohs(entry->size));
4948 return offset + dtohs(entry->size);
4961 const size_t pkgSize = dtohl(pkg->header.size);
4964 ALOGW("ResTable_package type strings at %p are past chunk size %p.",
4974 ALOGW("ResTable_package key strings at %p are past chunk size %p.",
5000 idx = mPackageGroups.size()+1;
5055 const uint8_t* endPos = ((const uint8_t*)pkg) + dtohs(pkg->header.size);
5057 ((const uint8_t*)chunk) <= (endPos-dtohl(chunk->size))) {
5058 TABLE_NOISY(ALOGV("PackageChunk: type=0x%x, headerSize=0x%x, size=0x%x, pos=%p\n",
5059 dtohs(chunk->type), dtohs(chunk->headerSize), dtohl(chunk->size),
5061 const size_t csize = dtohl(chunk->size);
5071 const size_t typeSpecSize = dtohl(typeSpec->header.size);
5073 LOAD_TABLE_NOISY(printf("TypeSpec off %p: type=0x%x, headerSize=0x%x, size=%p\n",
5094 while (package->types.size() < typeSpec->id) {
5118 const size_t typeSize = dtohl(type->header.size);
5120 LOAD_TABLE_NOISY(printf("Type off %p: type=0x%x, headerSize=0x%x, size=%p\n",
5144 while (package->types.size() < type->id) {
5175 group->typeCount = package->types.size();
5185 if (mPackageGroups.size() == 0) {
5188 if (mPackageGroups[0]->packages.size() == 0) {
5195 size_t typeCount = pkg->types.size();
5196 // starting size is header + first item (number of types in map)
5225 overlayName.size(),
5227 overlayType.size(),
5229 overlayPackage.size());
5251 if (last_past_one < vector.size()) {
5252 vector.removeItemsAt(last_past_one, vector.size() - last_past_one);
5259 *outSize += (2 + vector.size()) * sizeof(uint32_t);
5275 const size_t mapSize = map.size();
5280 const size_t N = vector.size();
5291 const size_t N = vector.size();
5439 (int)value.size, (int)value.res0);
5453 size_t pgCount = mPackageGroups.size();
5458 (int)pgIndex, pg->id, (int)pg->packages.size(),
5461 size_t pkgCount = pg->packages.size();
5464 size_t typeCount = pkg->types.size();
5474 const size_t NTC = typeConfigs->configs.size();
5502 printf(" config %s:\n", configStr.size() > 0
5510 uint32_t typeSize = dtohl(type->header.size);
5512 printf(" NON-INTEGER ResTable_type header.size: %p\n", (void*)typeSize);
5518 + dtohl(type->header.size);
5544 printf("OFFSET OUT OF BOUNDS: %p+%p (size is %p)\n",
5558 uint16_t esize = dtohs(ent->size);
5564 printf("ResTable_entry OUT OF BOUNDS: %p+%p+%p (size is %p)\n",
5582 (int)value.size, (int)value.res0);
5606 const size_t size = dtohs(mapPtr->value.size);
5607 mapOffset += size + sizeof(*mapPtr)-sizeof(mapPtr->value);