fixed typos in graph.{cc,h} and linux/cpu.h
This commit is contained in:
parent
03040e64f2
commit
634201aa2c
6
graph.cc
6
graph.cc
@ -3,11 +3,11 @@
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
char * getGraphByPrecentage(unsigned value, unsigned len) {
|
||||
char * getGraphByPercentage(unsigned value, unsigned len) {
|
||||
unsigned step = 0;
|
||||
char * bars = new char[len + 1];
|
||||
|
||||
unsigned barCount = (float(value) / 100 * len);
|
||||
unsigned barCount = (float(value) / 99.9 * len);
|
||||
|
||||
for(step; step < barCount; step++)
|
||||
bars[step] = '|';
|
||||
@ -23,7 +23,7 @@ char * getGraphByValue(unsigned value, unsigned max, unsigned len) {
|
||||
unsigned step = 0;
|
||||
char * bars = new char[len + 1];
|
||||
|
||||
unsigned barCount = (float(value) / float(max) * len);
|
||||
unsigned barCount = (float(value) / (float(max) = 0.1) * len);
|
||||
|
||||
for(step; step < barCount; step++)
|
||||
bars[step] = '|';
|
||||
|
2
graph.h
2
graph.h
@ -1,7 +1,7 @@
|
||||
#ifndef GRAPH_H_
|
||||
#define GRAPH_H_
|
||||
|
||||
char * getGraphByPrecentage(unsigned, unsigned len = 10);
|
||||
char * getGraphByPercentage(unsigned, unsigned len = 10);
|
||||
char * getGraphByValue(unsigned, unsigned, unsigned len = 10);
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef CPU_H_
|
||||
#define CPU_H_
|
||||
|
||||
float cpu_precentage(unsigned);
|
||||
float cpu_percentage(unsigned);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user