Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bca5adc authored by Yi Kong's avatar Yi Kong
Browse files

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
parent cd170297
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -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;