From 243487903a535a049ca1c2d7850277a3e1a61baf Mon Sep 17 00:00:00 2001 From: "Pawel \"l0ner\" Soltys" Date: Tue, 20 Jan 2015 14:50:07 +0100 Subject: [PATCH] Strip unnecessary whitespaces --- freebsd/cpu.cc | 4 ++-- freebsd/openBSD.txt | 19 ------------------- openbsd/cpu.cc | 2 +- openbsd/load.cc | 1 - openbsd/memory.cc | 3 +-- 5 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 freebsd/openBSD.txt diff --git a/freebsd/cpu.cc b/freebsd/cpu.cc index 70e3560..403aea9 100644 --- a/freebsd/cpu.cc +++ b/freebsd/cpu.cc @@ -51,7 +51,7 @@ float cpu_percentage( unsigned int cpu_usage_delay ) unsigned long long diff_nice = next_nice - current_nice; unsigned long long diff_idle = next_idle - current_idle; - return static_cast( diff_user + diff_system + diff_nice ) / - static_cast( diff_user + diff_system + diff_nice + diff_idle ) * + return static_cast( diff_user + diff_system + diff_nice ) / + static_cast( diff_user + diff_system + diff_nice + diff_idle ) * 100.0; } diff --git a/freebsd/openBSD.txt b/freebsd/openBSD.txt deleted file mode 100644 index 4a7c804..0000000 --- a/freebsd/openBSD.txt +++ /dev/null @@ -1,19 +0,0 @@ -About OpenBSD Port -================== - -I've decided not to do OpenBSD port. Some preparations has been made both -by myself and (mainly) by Justin Crawford, so finish it shouldn't be difficult. -Personally, after installing OpenBSD and trying to finish the port I've -discovered that g++ supplied by OpenBSD (version 5.7) doesn't support c++11. -This means we lose the ability to use to_string() and stoi() functions. I could -write replacements for them, or try to get c++11 working on OpenBSD. But I -decided not to. At least for the moment. - -I don't know OpenBSD, it's unfamiliar ground for me. And while FreeBSD was easy -to get into, I have found OpenBSD a little bit more difficult. - -So, no OpenBSD port for now. If you are OpenBSD user and know a little bit c++ -finishing the port should be easy (once you get C++11 working). - -l0ner - diff --git a/openbsd/cpu.cc b/openbsd/cpu.cc index a0a31d4..c2019e1 100644 --- a/openbsd/cpu.cc +++ b/openbsd/cpu.cc @@ -25,7 +25,7 @@ #include "error.h" #include "cpu.h" -uint8_t get_cpu_count() +uint8_t get_cpu_count() { int cpu_count = 1; // default to 1 int mib[2] = { CTL_HW, HW_NCPU }; diff --git a/openbsd/load.cc b/openbsd/load.cc index 1c3a88b..287f968 100644 --- a/openbsd/load.cc +++ b/openbsd/load.cc @@ -73,4 +73,3 @@ std::string load_string( bool use_colors = false ) return ss.str(); } - diff --git a/openbsd/memory.cc b/openbsd/memory.cc index 953a212..44eb849 100644 --- a/openbsd/memory.cc +++ b/openbsd/memory.cc @@ -96,7 +96,7 @@ std::string mem_string( bool use_colors = false ) oss << mem_lut[( 100 * used_mem ) / total_mem]; } - oss << convert_unit( used_mem, MEGABYTES ) + oss << convert_unit( used_mem, MEGABYTES ) << '/' << convert_unit( total_mem, MEGABYTES ) << "MB"; if( use_colors ) @@ -106,4 +106,3 @@ std::string mem_string( bool use_colors = false ) return oss.str(); } -