summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRod Smith <rodsmith@rodsbooks.com>2023-03-06 14:21:35 -0500
committerRod Smith <rodsmith@rodsbooks.com>2023-03-06 14:21:35 -0500
commit42eea87e89bdbf4c4548e88428513717a601e05d (patch)
tree660d57e99f5a2b6ecc4fc5e81b0d2c43440078fc
parente7a566bd96573b3f71001d0215dab93dcdd120d9 (diff)
downloadsgdisk-42eea87e89bdbf4c4548e88428513717a601e05d.tar.gz
Do some explicit casts in gptcurses.cc to eliminate compiler warnings.
-rw-r--r--NEWS3
-rw-r--r--gptcurses.cc13
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();