[partition] Handle all enum values in the switch

This commit is contained in:
Adriaan de Groot 2019-05-13 12:23:19 +02:00
parent 3b0d778d1e
commit 859e95432e

View File

@ -153,6 +153,9 @@ PartitionSize::toBytes() const
switch ( m_unit ) switch ( m_unit )
{ {
case unit_t::None:
case unit_t::Percent:
return -1;
case unit_t::Byte: case unit_t::Byte:
return value(); return value();
case unit_t::KiB: case unit_t::KiB:
@ -161,12 +164,7 @@ PartitionSize::toBytes() const
return CalamaresUtils::MiBtoBytes( static_cast<unsigned long long>( value() ) ); return CalamaresUtils::MiBtoBytes( static_cast<unsigned long long>( value() ) );
case unit_t::GiB: case unit_t::GiB:
return CalamaresUtils::GiBtoBytes( static_cast<unsigned long long>( value() ) ); return CalamaresUtils::GiBtoBytes( static_cast<unsigned long long>( value() ) );
default:
break;
} }
// Reached only when unit is Percent or None
return -1;
} }
bool bool