From ad725b671e1d509cf5172d4a9432ae367c11b398 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Feb 2020 12:26:55 +0100 Subject: [PATCH] [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. --- src/modules/hostinfo/HostInfoJob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/hostinfo/HostInfoJob.cpp b/src/modules/hostinfo/HostInfoJob.cpp index 3e0e4258c..c2959fb6b 100644 --- a/src/modules/hostinfo/HostInfoJob.cpp +++ b/src/modules/hostinfo/HostInfoJob.cpp @@ -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 );