[hostinfo] Warnings--

- Physical memory can't be negative, so it is reported as
   an unsigned long, but the bytes-to-MiB functions do accept
   negative amounts. As long as no machine has more than 2**62
   bytes of memory, we're good though.
This commit is contained in:
Adriaan de Groot 2020-02-12 12:26:55 +01:00
parent a11280b427
commit ad725b671e

View File

@ -156,7 +156,8 @@ HostInfoJob::exec()
gs->insert( "hostOSName", hostOSName() );
gs->insert( "hostCPU", hostCPU() );
auto ram = CalamaresUtils::BytesToMiB( CalamaresUtils::System::instance()->getTotalMemoryB().first );
// Memory can't be negative, so it's reported as unsigned long.
auto ram = CalamaresUtils::BytesToMiB( qint64( CalamaresUtils::System::instance()->getTotalMemoryB().first ) );
if ( ram )
{
gs->insert( "hostRAMMiB", ram );