diff options
| author | 2024-06-08 18:49:27 +0900 | |
|---|---|---|
| committer | 2024-07-23 21:11:31 +0900 | |
| commit | 5bca5adce9b32e592598f2cbf304594e9d677eb1 (patch) | |
| tree | d462267f1dbe3055714387c9f7cd93b75bc6fcb3 | |
| parent | cd170297c53c51d4fb5f99078154ff9ab08f7a94 (diff) | |
Fix -Wformat warning
frameworks/base/core/jni/com_android_internal_content_FileSystemUtils.cpp:92:38: error: format specifies type 'int' but the argument has type 'long' [-Werror,-Wformat]
91 | ", st_blksize: %d, st_size: %" PRIu64 "",
| ~~
| %ld
92 | beforePunch.st_blocks, beforePunch.st_blksize,
| ^~~~~~~~~~~~~~~~~~~~~~
Test: presubmit
Bug: 315250603
Change-Id: I87b2f17928f8e7029e4a6de3df231a41d6807aaf
| -rw-r--r-- | core/jni/com_android_internal_content_FileSystemUtils.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/core/jni/com_android_internal_content_FileSystemUtils.cpp b/core/jni/com_android_internal_content_FileSystemUtils.cpp index d426f1240a7f..6c72544a7958 100644 --- a/core/jni/com_android_internal_content_FileSystemUtils.cpp +++ b/core/jni/com_android_internal_content_FileSystemUtils.cpp @@ -87,9 +87,10 @@ bool punchHoles(const char *filePath, const uint64_t offset, IF_ALOGD() { ALOGD("Total number of LOAD segments %zu", programHeaders.size()); - ALOGD("Size before punching holes st_blocks: %" PRIu64 - ", st_blksize: %d, st_size: %" PRIu64 "", - beforePunch.st_blocks, beforePunch.st_blksize, + ALOGD("Size before punching holes st_blocks: %" PRIu64 ", st_blksize: %" PRIu64 + ", st_size: %" PRIu64 "", + static_cast<uint64_t>(beforePunch.st_blocks), + static_cast<uint64_t>(beforePunch.st_blksize), static_cast<uint64_t>(beforePunch.st_size)); } @@ -193,9 +194,10 @@ bool punchHoles(const char *filePath, const uint64_t offset, ALOGD("lstat64 failed for filePath %s, error:%d", filePath, errno); return false; } - ALOGD("Size after punching holes st_blocks: %" PRIu64 ", st_blksize: %d, st_size: %" PRIu64 - "", - afterPunch.st_blocks, afterPunch.st_blksize, + ALOGD("Size after punching holes st_blocks: %" PRIu64 ", st_blksize: %" PRIu64 + ", st_size: %" PRIu64 "", + static_cast<uint64_t>(afterPunch.st_blocks), + static_cast<uint64_t>(afterPunch.st_blksize), static_cast<uint64_t>(afterPunch.st_size)); } @@ -271,8 +273,9 @@ bool punchHolesInZip(const char *filePath, uint64_t offset, uint16_t extraFieldL uint64_t blockSize = beforePunch.st_blksize; IF_ALOGD() { ALOGD("Extra field length: %hu, Size before punching holes st_blocks: %" PRIu64 - ", st_blksize: %d, st_size: %" PRIu64 "", - extraFieldLen, beforePunch.st_blocks, beforePunch.st_blksize, + ", st_blksize: %" PRIu64 ", st_size: %" PRIu64 "", + extraFieldLen, static_cast<uint64_t>(beforePunch.st_blocks), + static_cast<uint64_t>(beforePunch.st_blksize), static_cast<uint64_t>(beforePunch.st_size)); } @@ -346,8 +349,9 @@ bool punchHolesInZip(const char *filePath, uint64_t offset, uint16_t extraFieldL return false; } ALOGD("punchHolesInApk:: Size after punching holes st_blocks: %" PRIu64 - ", st_blksize: %d, st_size: %" PRIu64 "", - afterPunch.st_blocks, afterPunch.st_blksize, + ", st_blksize: %" PRIu64 ", st_size: %" PRIu64 "", + static_cast<uint64_t>(afterPunch.st_blocks), + static_cast<uint64_t>(afterPunch.st_blksize), static_cast<uint64_t>(afterPunch.st_size)); } return true; |