Merge branch 'load-whitespace'

This commit is contained in:
Matt McCormick 2015-04-02 09:42:35 -04:00
commit 1fe9a33252
2 changed files with 4 additions and 3 deletions

@ -41,13 +41,13 @@ std::string load_string( bool use_colors = false )
if( getloadavg( averages, nelem ) < 0 ) if( getloadavg( averages, nelem ) < 0 )
{ {
ss << "0.00 0.00 0.00"; // couldn't get averages. ss << " 0.00 0.00 0.00"; // couldn't get averages.
} }
else else
{ {
if( use_colors ) if( use_colors )
{ {
unsigned load_percent = static_cast<unsigned int>( averages[0] / unsigned load_percent = static_cast<unsigned int>( averages[0] /
get_cpu_count() * 0.5f * 100.0f ); get_cpu_count() * 0.5f * 100.0f );
if( load_percent > 100 ) if( load_percent > 100 )
@ -57,6 +57,7 @@ std::string load_string( bool use_colors = false )
ss << load_lut[load_percent]; ss << load_lut[load_percent];
} }
ss << ' ';
for( int i = 0; i < nelem; ++i ) for( int i = 0; i < nelem; ++i )
{ {
// Round to nearest, make sure this is only a 0.00 value not a 0.0000 // Round to nearest, make sure this is only a 0.00 value not a 0.0000

@ -155,7 +155,7 @@ int main( int argc, char** argv )
} }
std::cout << mem_string( use_colors ) std::cout << mem_string( use_colors )
<< cpu_string( cpu_usage_delay, graph_lines, use_colors ) << ' ' << cpu_string( cpu_usage_delay, graph_lines, use_colors )
<< load_string( use_colors ); << load_string( use_colors );
return EXIT_SUCCESS; return EXIT_SUCCESS;