diff --git a/common/cpu.h b/common/cpu.h index 356b0d6..67bd601 100644 --- a/common/cpu.h +++ b/common/cpu.h @@ -45,7 +45,7 @@ #endif float cpu_percentage( unsigned ); -uint8_t get_cpu_count(); +uint32_t get_cpu_count(); /** CPU percentage output mode. * diff --git a/common/memory.cc b/common/memory.cc index 9dae11c..423e6b2 100644 --- a/common/memory.cc +++ b/common/memory.cc @@ -84,8 +84,9 @@ std::string mem_string( const MemoryStatus & mem_status, break; } default: // Default mode, just show the used/total memory in MB - oss << static_cast< unsigned int >( mem_status.used_mem ) << '/' - << static_cast< unsigned int >( mem_status.total_mem ) << "MB"; + if(mem_status.used_mem>100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem/1024)<<"/"<(mem_status.total_mem/1024)<<"GB"; + else if(mem_status.used_mem<100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem)<<"MB/"<(mem_status.total_mem/1024)<<"GB"; + else oss<(mem_status.used_mem)<<"/"<(mem_status.total_mem)<<"MB"; } if( use_colors ) diff --git a/linux/cpu.cc b/linux/cpu.cc index 2fcc4c9..77110f1 100644 --- a/linux/cpu.cc +++ b/linux/cpu.cc @@ -23,7 +23,7 @@ #include "cpu.h" #include "luts.h" -uint8_t get_cpu_count() +uint32_t get_cpu_count() { return sysconf( _SC_NPROCESSORS_ONLN ); } diff --git a/osx/cpu.cc b/osx/cpu.cc index d287756..f9023be 100644 --- a/osx/cpu.cc +++ b/osx/cpu.cc @@ -21,7 +21,7 @@ #include "cpu.h" -uint8_t get_cpu_count() +uint32_t get_cpu_count() { return sysconf( _SC_NPROCESSORS_ONLN ); } diff --git a/windows/cpu.cc b/windows/cpu.cc index 4a200a3..13f48cb 100644 --- a/windows/cpu.cc +++ b/windows/cpu.cc @@ -31,9 +31,9 @@ static PDH_HCOUNTER cpuTotal; #include "cpu.h" #include "luts.h" -uint8_t get_cpu_count() +uint32_t get_cpu_count() { - return static_cast< uint8_t >( std::thread::hardware_concurrency() ); + return static_cast< uint32_t >( std::thread::hardware_concurrency() ); } float cpu_percentage( unsigned cpu_usage_delay )