diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 507330a80..cb7c8a01d 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -451,6 +451,8 @@ isEfiFilesystemSuitableType( const Partition* candidate ) { auto type = candidate->fileSystem().type(); + QT_WARNING_PUSH + QT_WARNING_DISABLE_CLANG( "-Wswitch-enum" ) switch ( type ) { case FileSystem::Type::Fat32: @@ -465,6 +467,7 @@ isEfiFilesystemSuitableType( const Partition* candidate ) cWarning() << "EFI boot partition must be FAT32"; return false; } + QT_WARNING_POP } bool @@ -526,14 +529,15 @@ efiFilesystemMinimumSize() { using CalamaresUtils::Units::operator""_MiB; - auto uefisys_part_sizeB = 300_MiB; + size_t uefisys_part_sizeB = 300_MiB; // The default can be overridden; the key used here comes // from the partition module Config.cpp auto* gs = Calamares::JobQueue::instance()->globalStorage(); if ( gs->contains( "efiSystemPartitionSize_i" ) ) { - uefisys_part_sizeB = gs->value( "efiSystemPartitionSize_i" ).toLongLong(); + qint64 v = gs->value( "efiSystemPartitionSize_i" ).toLongLong(); + uefisys_part_sizeB = v > 0 ? static_cast< size_t >( 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/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index 8514bbe2c..8226499b4 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -71,15 +71,15 @@ swapSuggestion( const qint64 availableSpaceB, Config::SwapChoice swap ) // Allow for a fudge factor - suggestedSwapSizeB *= overestimationFactor; + suggestedSwapSizeB = qRound( suggestedSwapSizeB * overestimationFactor ); // don't use more than 10% of available space if ( !ensureSuspendToDisk ) { - suggestedSwapSizeB = qMin( suggestedSwapSizeB, qint64( 0.10 * availableSpaceB ) ); + suggestedSwapSizeB = qMin( suggestedSwapSizeB, availableSpaceB / 10 /* 10% is 0.1 */ ); } - cDebug() << "Suggested swap size:" << suggestedSwapSizeB / 1024. / 1024. / 1024. << "GiB"; + cDebug() << "Suggested swap size:" << CalamaresUtils::BytesToGiB( suggestedSwapSizeB ) << "GiB"; return suggestedSwapSizeB; } diff --git a/src/modules/partition/core/PartitionLayout.cpp b/src/modules/partition/core/PartitionLayout.cpp index f60952643..3813207ef 100644 --- a/src/modules/partition/core/PartitionLayout.cpp +++ b/src/modules/partition/core/PartitionLayout.cpp @@ -141,6 +141,8 @@ void PartitionLayout::setDefaultFsType( FileSystem::Type defaultFsType ) { using FileSystem = FileSystem::Type; + QT_WARNING_PUSH + QT_WARNING_DISABLE_CLANG( "-Wswitch-enum" ) switch ( defaultFsType ) { case FileSystem::Unknown: @@ -196,6 +198,7 @@ PartitionLayout::setDefaultFsType( FileSystem::Type defaultFsType ) << "Using ext4 instead."; defaultFsType = FileSystem::Ext4; } + QT_WARNING_POP m_defaultFsType = defaultFsType; }