Commit 4f1f3c96 authored by Luis Ibanez's avatar Luis Ibanez
Browse files

COMP: Fixing type declarations and type conversions that could potentially

      truncate 64 bits types into 32 bits types.
parent fbdca9c8
...@@ -257,10 +257,10 @@ protected: ...@@ -257,10 +257,10 @@ protected:
// Evaluate the memory information. // Evaluate the memory information.
int QueryMemory(); int QueryMemory();
unsigned long TotalVirtualMemory; size_t TotalVirtualMemory;
unsigned long AvailableVirtualMemory; size_t AvailableVirtualMemory;
unsigned long TotalPhysicalMemory; size_t TotalPhysicalMemory;
unsigned long AvailablePhysicalMemory; size_t AvailablePhysicalMemory;
size_t CurrentPositionInFile; size_t CurrentPositionInFile;
...@@ -2771,7 +2771,7 @@ bool SystemInformationImplementation::ParseSysCtl() ...@@ -2771,7 +2771,7 @@ bool SystemInformationImplementation::ParseSysCtl()
uint64_t value = 0; uint64_t value = 0;
size_t len = sizeof(value); size_t len = sizeof(value);
sysctlbyname("hw.memsize", &value, &len, NULL, 0); sysctlbyname("hw.memsize", &value, &len, NULL, 0);
this->TotalPhysicalMemory = value/1048576; this->TotalPhysicalMemory = static_cast< size_t >( value/1048576 );
// Parse values for Mac // Parse values for Mac
this->AvailablePhysicalMemory = 0; this->AvailablePhysicalMemory = 0;
...@@ -2782,7 +2782,7 @@ bool SystemInformationImplementation::ParseSysCtl() ...@@ -2782,7 +2782,7 @@ bool SystemInformationImplementation::ParseSysCtl()
{ {
err = sysctlbyname("hw.pagesize", &value, &len, NULL, 0); err = sysctlbyname("hw.pagesize", &value, &len, NULL, 0);
int64_t available_memory = vmstat.free_count * value; int64_t available_memory = vmstat.free_count * value;
this->AvailablePhysicalMemory = available_memory / 1048576; this->AvailablePhysicalMemory = static_cast< size_t >( available_memory / 1048576 );
} }
#ifdef VM_SWAPUSAGE #ifdef VM_SWAPUSAGE
...@@ -2794,8 +2794,8 @@ bool SystemInformationImplementation::ParseSysCtl() ...@@ -2794,8 +2794,8 @@ bool SystemInformationImplementation::ParseSysCtl()
err = sysctl(mib, miblen, &swap, &len, NULL, 0); err = sysctl(mib, miblen, &swap, &len, NULL, 0);
if (err == 0) if (err == 0)
{ {
this->AvailableVirtualMemory = swap.xsu_avail/1048576; this->AvailableVirtualMemory = static_cast< size_t >( swap.xsu_avail/1048576 );
this->TotalVirtualMemory = swap.xsu_total/1048576; this->TotalVirtualMemory = static_cast< size_t >( swap.xsu_total/1048576 );
} }
#else #else
this->AvailableVirtualMemory = 0; this->AvailableVirtualMemory = 0;
...@@ -2811,7 +2811,7 @@ bool SystemInformationImplementation::ParseSysCtl() ...@@ -2811,7 +2811,7 @@ bool SystemInformationImplementation::ParseSysCtl()
len = sizeof(value); len = sizeof(value);
sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0); sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0);
this->CPUSpeedInMHz = value / 1048576; this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576;
// Chip family // Chip family
...@@ -2859,14 +2859,14 @@ bool SystemInformationImplementation::ParseSysCtl() ...@@ -2859,14 +2859,14 @@ bool SystemInformationImplementation::ParseSysCtl()
// Chip Model // Chip Model
len = sizeof(value); len = sizeof(value);
err = sysctlbyname("machdep.cpu.model", &value, &len, NULL, 0); err = sysctlbyname("machdep.cpu.model", &value, &len, NULL, 0);
this->ChipID.Model = value; this->ChipID.Model = static_cast< int >( value );
} }
// Cache size // Cache size
len = sizeof(value); len = sizeof(value);
err = sysctlbyname("hw.l1icachesize", &value, &len, NULL, 0); err = sysctlbyname("hw.l1icachesize", &value, &len, NULL, 0);
this->Features.L1CacheSize = value; this->Features.L1CacheSize = static_cast< int >( value );
err = sysctlbyname("hw.l2cachesize", &value, &len, NULL, 0); err = sysctlbyname("hw.l2cachesize", &value, &len, NULL, 0);
this->Features.L2CacheSize = value; this->Features.L2CacheSize = static_cast< int >( value );
return true; return true;
#else #else
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2009) SET(KWSYS_DATE_STAMP_YEAR 2009)
# KWSys version date month component. Format is MM. # KWSys version date month component. Format is MM.
SET(KWSYS_DATE_STAMP_MONTH 10) SET(KWSYS_DATE_STAMP_MONTH 11)
# KWSys version date day component. Format is DD. # KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 19) SET(KWSYS_DATE_STAMP_DAY 15)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment