OpenBSD: missing headers, typos

cpu.h: underscores in get_cpu_count()
load.cc: underscores in get_cpu_count(), typos
memory.cc: missing headers
This commit is contained in:
Pawel "l0ner" Soltys 2015-01-20 02:44:21 +01:00
parent 112004f3db
commit 580b076b79
3 changed files with 6 additions and 4 deletions

@ -10,7 +10,7 @@
#define CP_IDLE 4 #define CP_IDLE 4
#define CPUSTATES 5 #define CPUSTATES 5
float cpu_percentage(unsigned); float cpu_percentage( unsigned );
uint8_t getCpuCount(); uint8_t get_cpu_count();
#endif #endif

@ -33,7 +33,7 @@ std::string load_string( bool use_colors = false )
{ {
std::stringstream ss; std::stringstream ss;
// Only get 3 load averages // Only get 3 load averages
cont int nelem = 3; const int nelem = 3;
double averages[nelem]; double averages[nelem];
// based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c // based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c
@ -46,7 +46,7 @@ std::string load_string( bool use_colors = false )
if( use_colors ) if( use_colors )
{ {
// may not work // may not work
uint8_t cpu_count = getCpuCount(); uint8_t cpu_count = get_cpu_count();
unsigned load_percent = static_cast<unsigned int>( unsigned load_percent = static_cast<unsigned int>(
averages[0] / cpu_count * 0.5f * 100.0f); averages[0] / cpu_count * 0.5f * 100.0f);

@ -21,6 +21,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <sys/mount.h> // VFS_* which we use to get cache
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/vmmeter.h> // vmtotal struct #include <sys/vmmeter.h> // vmtotal struct
@ -28,6 +29,7 @@
#include "error.h" #include "error.h"
#include "memory.h" #include "memory.h"
#include "../luts.h" #include "../luts.h"
#include "../conversions.h"
static int pageshift; static int pageshift;