From c1eed5c7f3295d134760f471bc28c09ce6337726 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Mon, 26 Apr 2021 19:56:34 +0900 Subject: [PATCH] tools/set_haiku_revision: Fix wrong type of arguments to formatting function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pointed out by lgtm. Change-Id: I385356c8bafec99d15184d5475f23e6418ec9849 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3889 Reviewed-by: Jérôme Duval --- src/tools/set_haiku_revision.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tools/set_haiku_revision.cpp b/src/tools/set_haiku_revision.cpp index 9ec29706e6..3460e7a664 100644 --- a/src/tools/set_haiku_revision.cpp +++ b/src/tools/set_haiku_revision.cpp @@ -406,11 +406,11 @@ public: if ((size_t)bytesRead != size) { if (errorMessage) { - throw Exception("%s Read too few bytes (%d/%d).", - errorMessage, (int)bytesRead, (int)size); + throw Exception("%s Read too few bytes (%zd/%zu).", + errorMessage, bytesRead, size); } else { - throw Exception("Read too few bytes (%ld/%lu).", - (int)bytesRead, (int)size); + throw Exception("Read too few bytes (%zd/%zu).", + bytesRead, size); } } } @@ -427,11 +427,11 @@ public: if ((size_t)bytesWritten != size) { if (errorMessage) { - throw Exception("%s Wrote too few bytes (%d/%d).", - errorMessage, (int)bytesWritten, (int)size); + throw Exception("%s Wrote too few bytes (%zd/%zu).", + errorMessage, bytesWritten, size); } else { - throw Exception("Wrote too few bytes (%ld/%lu).", - (int)bytesWritten, (int)size); + throw Exception("Wrote too few bytes (%zd/%zu).", + bytesWritten, size); } } } @@ -611,8 +611,8 @@ void ELFObject::_ParseELFHeader() } } } - - + + template bool ELFObject::_ReadSectionHeader(int index, SectionInfo& info) { @@ -650,7 +650,7 @@ bool ELFObject::_ReadSectionHeader(int index, SectionInfo& info) if (fSectionHeaderStrings) { if (nameIndex >= (uint32_t)fSectionHeaderStringsLength) { throw Exception(EIO, "Invalid ELF section header: " - "invalid name index: %lu.", nameIndex); + "invalid name index: %" PRIu32 ".", nameIndex); } info.name = fSectionHeaderStrings + nameIndex; } else {