From: Kenny Root Date: Wed, 24 Nov 2010 20:56:06 +0000 (-0800) Subject: Change assets to use 64-bit API X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/58f944ba35a85b706382a4ceff8038828eb052fc Change assets to use 64-bit API The asset system and supporting libraries were using off_t instead of off64_t to access files larger than 2GB (32-bit signed). This change replaces all off_t with off64_t and lseek64. There is a new utils/Compat.h added for Mac OS compatibility. Also fixed some size-related compiler warnings. Bug: 3205336 Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e --- diff --git a/Package.cpp b/Package.cpp index faae89b..ab71f34 100644 --- a/Package.cpp +++ b/Package.cpp @@ -461,7 +461,7 @@ ssize_t processJarFiles(Bundle* bundle, ZipFile* zip) ZipFile jar; err = jar.open(jars[i], ZipFile::kOpenReadOnly); if (err != 0) { - fprintf(stderr, "ERROR: unable to open '%s' as a zip file: %zd\n", + fprintf(stderr, "ERROR: unable to open '%s' as a zip file: %d\n", jars[i], err); return err; } diff --git a/Resource.cpp b/Resource.cpp index 7b74506..4614d6f 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -542,11 +542,11 @@ static bool applyFileOverlay(Bundle *bundle, DefaultKeyedVector > baseFiles = baseGroup->getFiles(); for (size_t i=0; i < baseFiles.size(); i++) { - printf("baseFile %d has flavor %s\n", i, + printf("baseFile %zd has flavor %s\n", i, baseFiles.keyAt(i).toString().string()); } for (size_t i=0; i < overlayFiles.size(); i++) { - printf("overlayFile %d has flavor %s\n", i, + printf("overlayFile %zd has flavor %s\n", i, overlayFiles.keyAt(i).toString().string()); } } @@ -560,7 +560,7 @@ static bool applyFileOverlay(Bundle *bundle, keyAt(overlayGroupIndex)); if(baseFileIndex < UNKNOWN_ERROR) { if (bundle->getVerbose()) { - printf("found a match (%d) for overlay file %s, for flavor %s\n", + printf("found a match (%zd) for overlay file %s, for flavor %s\n", baseFileIndex, overlayGroup->getLeaf().string(), overlayFiles.keyAt(overlayGroupIndex).toString().string()); diff --git a/StringPool.cpp b/StringPool.cpp index e28bdff..d067d59 100644 --- a/StringPool.cpp +++ b/StringPool.cpp @@ -30,7 +30,7 @@ void printStringPool(const ResStringPool* pool) str = String8(pool->stringAt(s, &len)).string(); } - printf("String #%d: %s\n", s, str); + printf("String #%zd: %s\n", s, str); } }