From 0be88f1453454bed2f42553676e028bb388dc1a0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 8 Feb 2022 16:42:31 +0100 Subject: [PATCH] [partition] Use signed sizes --- src/modules/partition/core/PartUtils.cpp | 8 ++++---- src/modules/partition/core/PartUtils.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index cb7c8a01d..a4ec7fe0b 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -479,7 +479,7 @@ isEfiFilesystemSuitableSize( const Partition* candidate ) return false; } - if ( size_t( size ) >= efiFilesystemMinimumSize() ) + if ( size >= efiFilesystemMinimumSize() ) { return true; } @@ -524,12 +524,12 @@ isEfiBootable( const Partition* candidate ) } // TODO: this is configurable via the config file **already** -size_t +qint64 efiFilesystemMinimumSize() { using CalamaresUtils::Units::operator""_MiB; - size_t uefisys_part_sizeB = 300_MiB; + qint64 uefisys_part_sizeB = 300_MiB; // The default can be overridden; the key used here comes // from the partition module Config.cpp @@ -537,7 +537,7 @@ efiFilesystemMinimumSize() if ( gs->contains( "efiSystemPartitionSize_i" ) ) { qint64 v = gs->value( "efiSystemPartitionSize_i" ).toLongLong(); - uefisys_part_sizeB = v > 0 ? static_cast< size_t >( v ) : 0; + uefisys_part_sizeB = v > 0 ? v : 0; } // There is a lower limit of what can be configured if ( uefisys_part_sizeB < 32_MiB ) diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index 31b4cde84..f3c51df45 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -107,7 +107,7 @@ bool isEfiFilesystemSuitableSize( const Partition* candidate ); * * A minimum of 32MiB (which is bonkers-small) is enforced. */ -size_t efiFilesystemMinimumSize(); +qint64 efiFilesystemMinimumSize(); /** * @brief Is the given @p partition bootable in EFI? Depending on