1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-25 14:16:17 +00:00
Lakka-LibreELEC/packages/sysutils/gptfdisk/patches/0009-Do-some-explicit-casts-in-gptcurses.cc-to-eliminate-.patch
mglae 0368acc296 gptfdisk: update to 1.0.9.2+ via patches from git
Latest release 1.0.9 is failing when using "sgdisk -e /dev/sdX"
2023-07-07 00:07:38 +03:00

70 lines
3.2 KiB
Diff

From 42eea87e89bdbf4c4548e88428513717a601e05d Mon Sep 17 00:00:00 2001
From: Rod Smith <rodsmith@rodsbooks.com>
Date: Mon, 6 Mar 2023 14:21:35 -0500
Subject: [PATCH 09/12] Do some explicit casts in gptcurses.cc to eliminate
compiler warnings.
---
NEWS | 3 +++
gptcurses.cc | 13 +++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 8d5b365..dc1660e 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@
partitions when the --largest-new=0 option to sgdisk is used. Thanks to
David Joaquín Shourabi Porcel for this improvement.
+- Make explicit casts in gptcurses.cc to eliminate compiler warnings about
+ mis-matched types in printw() statements.
+
1.0.9 (4/14/2022):
------------------
diff --git a/gptcurses.cc b/gptcurses.cc
index 8b0ae91..64cc514 100644
--- a/gptcurses.cc
+++ b/gptcurses.cc
@@ -333,13 +333,13 @@ void GPTDataCurses::ShowInfo(int partNum) {
printw("Partition GUID code: %s (%s)\n", partitions[partNum].GetType().AsString().c_str(),
partitions[partNum].GetTypeName().c_str());
printw("Partition unique GUID: %s\n", partitions[partNum].GetUniqueGUID().AsString().c_str());
- printw("First sector: %lld (at %s)\n", partitions[partNum].GetFirstLBA(),
+ printw("First sector: %llu (at %s)\n", (long long unsigned int) partitions[partNum].GetFirstLBA(),
BytesToIeee(partitions[partNum].GetFirstLBA(), blockSize).c_str());
- printw("Last sector: %lld (at %s)\n", partitions[partNum].GetLastLBA(),
+ printw("Last sector: %llu (at %s)\n", (long long unsigned int) partitions[partNum].GetLastLBA(),
BytesToIeee(partitions[partNum].GetLastLBA(), blockSize).c_str());
size = partitions[partNum].GetLastLBA() - partitions[partNum].GetFirstLBA() + 1;
- printw("Partition size: %lld sectors (%s)\n", size, BytesToIeee(size, blockSize).c_str());
- printw("Attribute flags: %016llx\n", partitions[partNum].GetAttributes().GetAttributes());
+ printw("Partition size: %llu sectors (%s)\n", (long long unsigned int) size, BytesToIeee(size, blockSize).c_str());
+ printw("Attribute flags: %016llx\n", (long long unsigned int) partitions[partNum].GetAttributes().GetAttributes());
#ifdef USE_UTF16
partitions[partNum].GetDescription().extract(0, NAME_SIZE , temp, NAME_SIZE );
printw("Partition name: '%s'\n", temp);
@@ -447,7 +447,8 @@ void GPTDataCurses::MakeNewPart(void) {
clrtoeol();
newFirstLBA = currentSpace->firstLBA;
Align(&newFirstLBA);
- printw("First sector (%lld-%lld, default = %lld): ", newFirstLBA, currentSpace->lastLBA, newFirstLBA);
+ printw("First sector (%llu-%llu, default = %llu): ", (long long unsigned int) newFirstLBA,
+ (long long unsigned int) currentSpace->lastLBA, (long long unsigned int) newFirstLBA);
echo();
getnstr(inLine, 79);
noecho();
@@ -461,7 +462,7 @@ void GPTDataCurses::MakeNewPart(void) {
while ((newLastLBA > currentSpace->lastLBA) || (newLastLBA < newFirstLBA)) {
move(LINES - 3, 0);
clrtoeol();
- printw("Size in sectors or {KMGTP} (default = %lld): ", size);
+ printw("Size in sectors or {KMGTP} (default = %llu): ", (long long unsigned int) size);
echo();
getnstr(inLine, 79);
noecho();
--
2.31.1