diff options
author | 2021-07-13 22:05:31 +0000 | |
---|---|---|
committer | 2021-07-14 17:21:11 +0000 | |
commit | c5a4f2305caaf15b5b50a1898ca3591231f77885 (patch) | |
tree | a81fec803b213192d2059754bb5ba380288a93b1 | |
parent | fdc4ecb50acc24dc6d6ab9c89e879487dbd4bd4f (diff) |
Fix SkDebugf format specifier in Android
Bug: 192062380
Test: can compile with SK_PRINTF_LIKE included in the header file
Change-Id: I86a37eeb2f0ae5f800380960cd232b1b40cdef9b
-rw-r--r-- | libs/hwui/jni/Utils.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/hwui/jni/Utils.cpp b/libs/hwui/jni/Utils.cpp index ac2f5b77d23a..1259bb5a4f65 100644 --- a/libs/hwui/jni/Utils.cpp +++ b/libs/hwui/jni/Utils.cpp @@ -18,6 +18,7 @@ #include "SkUtils.h" #include "SkData.h" +#include <inttypes.h> #include <log/log.h> using namespace android; @@ -76,7 +77,7 @@ bool AssetStreamAdaptor::seek(size_t position) { bool AssetStreamAdaptor::move(long offset) { if (fAsset->seek(offset, SEEK_CUR) == -1) { - SkDebugf("---- fAsset->seek(%i, SEEK_CUR) failed\n", offset); + SkDebugf("---- fAsset->seek(%li, SEEK_CUR) failed\n", offset); return false; } @@ -100,7 +101,7 @@ size_t AssetStreamAdaptor::read(void* buffer, size_t size) { } off64_t newOffset = fAsset->seek(size, SEEK_CUR); if (-1 == newOffset) { - SkDebugf("---- fAsset->seek(%d) failed\n", size); + SkDebugf("---- fAsset->seek(%zu) failed\n", size); return 0; } amount = newOffset - oldOffset; @@ -127,14 +128,14 @@ sk_sp<SkData> android::CopyAssetToData(Asset* asset) { const off64_t size = asset->getLength(); if (size <= 0) { - SkDebugf("---- copyAsset: asset->getLength() returned %d\n", size); + SkDebugf("---- copyAsset: asset->getLength() returned %" PRId64 "\n", size); return NULL; } sk_sp<SkData> data(SkData::MakeUninitialized(size)); const off64_t len = asset->read(data->writable_data(), size); if (len != size) { - SkDebugf("---- copyAsset: asset->read(%d) returned %d\n", size, len); + SkDebugf("---- copyAsset: asset->read(%" PRId64 ") returned %" PRId64 "\n", size, len); return NULL; } |