From dc36bb6dea837608c29c177a7ea8cf46b6a0cd53 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Fri, 11 May 2018 15:52:49 -0700 Subject: For Win32, don't cast ssize_t while printing Bug: http://b/69933068 This is a partial revert of https://android-review.googlesource.com/c/platform/frameworks/base/+/109433 so we can use Clang for windows cross compilation. Clang does not allow a cast to 'signed size_t' and both Clang and current MinGW accept a ssize_t to the '%zd' format specifier. Test: m native-host, m native-host-cross with both MinGW and Clang Change-Id: I5366622b91be1433f6c533c55a9ae429b57c7a27 --- tools/aapt/StringPool.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tools/aapt/StringPool.cpp') diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp index 866291a3b678..37b61bfdffbd 100644 --- a/tools/aapt/StringPool.cpp +++ b/tools/aapt/StringPool.cpp @@ -12,13 +12,6 @@ #include "ResourceTable.h" -// SSIZE: mingw does not have signed size_t == ssize_t. -#if !defined(_WIN32) -# define SSIZE(x) x -#else -# define SSIZE(x) (signed size_t)x -#endif - // Set to true for noisy debug output. static const bool kIsDebug = false; @@ -202,7 +195,7 @@ ssize_t StringPool::add(const String16& value, if (kIsDebug) { printf("Adding string %s to pool: pos=%zd eidx=%zd vidx=%zd\n", - String8(value).string(), SSIZE(pos), SSIZE(eidx), SSIZE(vidx)); + String8(value).string(), pos, eidx, vidx); } return pos; @@ -598,7 +591,7 @@ ssize_t StringPool::offsetForString(const String16& val) const const Vector* indices = offsetsForString(val); ssize_t res = indices != NULL && indices->size() > 0 ? indices->itemAt(0) : -1; if (kIsDebug) { - printf("Offset for string %s: %zd (%s)\n", String8(val).string(), SSIZE(res), + printf("Offset for string %s: %zd (%s)\n", String8(val).string(), res, res >= 0 ? String8(mEntries[mEntryArray[res]].value).string() : String8()); } return res; -- cgit v1.2.3-59-g8ed1b