From 859e95432e142a3d039635bcfe9f7a7d8e2f9619 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 13 May 2019 12:23:19 +0200 Subject: [PATCH] [partition] Handle all enum values in the switch --- src/libcalamares/partition/PartitionSize.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libcalamares/partition/PartitionSize.cpp b/src/libcalamares/partition/PartitionSize.cpp index edff0fe1e..5c4c0e040 100644 --- a/src/libcalamares/partition/PartitionSize.cpp +++ b/src/libcalamares/partition/PartitionSize.cpp @@ -153,6 +153,9 @@ PartitionSize::toBytes() const switch ( m_unit ) { + case unit_t::None: + case unit_t::Percent: + return -1; case unit_t::Byte: return value(); case unit_t::KiB: @@ -161,12 +164,7 @@ PartitionSize::toBytes() const return CalamaresUtils::MiBtoBytes( static_cast( value() ) ); case unit_t::GiB: return CalamaresUtils::GiBtoBytes( static_cast( value() ) ); - default: - break; } - - // Reached only when unit is Percent or None - return -1; } bool