diff options
author | Raphael <raphael@google.com> | 2011-12-12 13:14:12 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-12 13:14:12 -0800 |
commit | 2ace3b01ab9447ce9fda2f578e31c1c11f4837cb (patch) | |
tree | aa185e02040b8bc38a34a4be72a805fdde46a951 | |
parent | ed0830c502d7403d69abfd8247c046ac2746ac8c (diff) | |
parent | 7c3bef85dab709326e052fec1fdc8b32e47c811e (diff) | |
download | frameworks_base-2ace3b01ab9447ce9fda2f578e31c1c11f4837cb.zip frameworks_base-2ace3b01ab9447ce9fda2f578e31c1c11f4837cb.tar.gz frameworks_base-2ace3b01ab9447ce9fda2f578e31c1c11f4837cb.tar.bz2 |
Merge "Merge "AAPT fix printf %zd crash on Windows". Do not merge." into ics-mr1
-rw-r--r-- | tools/aapt/Resource.cpp | 16 | ||||
-rw-r--r-- | tools/aapt/StringPool.cpp | 10 |
2 files changed, 21 insertions, 5 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 887fa74..1ecf7da 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -14,6 +14,14 @@ #include "FileFinder.h" #include "CacheUpdater.h" +#if HAVE_PRINTF_ZD +# define ZD "%zd" +# define ZD_TYPE ssize_t +#else +# define ZD "%ld" +# define ZD_TYPE long +#endif + #define NOISY(x) // x // ========================================================================== @@ -566,11 +574,11 @@ static bool applyFileOverlay(Bundle *bundle, DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> > baseFiles = baseGroup->getFiles(); for (size_t i=0; i < baseFiles.size(); i++) { - printf("baseFile %zd has flavor %s\n", i, + printf("baseFile " ZD " has flavor %s\n", (ZD_TYPE) i, baseFiles.keyAt(i).toString().string()); } for (size_t i=0; i < overlayFiles.size(); i++) { - printf("overlayFile %zd has flavor %s\n", i, + printf("overlayFile " ZD " has flavor %s\n", (ZD_TYPE) i, overlayFiles.keyAt(i).toString().string()); } } @@ -584,8 +592,8 @@ static bool applyFileOverlay(Bundle *bundle, keyAt(overlayGroupIndex)); if (baseFileIndex < UNKNOWN_ERROR) { if (bundle->getVerbose()) { - printf("found a match (%zd) for overlay file %s, for flavor %s\n", - baseFileIndex, + printf("found a match (" ZD ") for overlay file %s, for flavor %s\n", + (ZD_TYPE) baseFileIndex, overlayGroup->getLeaf().string(), overlayFiles.keyAt(overlayGroupIndex).toString().string()); } diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp index d067d59..9a0a1c4 100644 --- a/tools/aapt/StringPool.cpp +++ b/tools/aapt/StringPool.cpp @@ -8,6 +8,14 @@ #include <utils/ByteOrder.h> +#if HAVE_PRINTF_ZD +# define ZD "%zd" +# define ZD_TYPE ssize_t +#else +# define ZD "%ld" +# define ZD_TYPE long +#endif + #define NOISY(x) //x void strcpy16_htod(uint16_t* dst, const uint16_t* src) @@ -30,7 +38,7 @@ void printStringPool(const ResStringPool* pool) str = String8(pool->stringAt(s, &len)).string(); } - printf("String #%zd: %s\n", s, str); + printf("String #" ZD ": %s\n", (ZD_TYPE) s, str); } } |