mirror of
https://github.com/thewtex/tmux-mem-cpu-load.git
synced 2026-09-10 07:16:16 -04:00
use static_cast<> instead of c-like cast
This commit is contained in:
parent
47b9f62a10
commit
080e1be24d
4
graph.cc
4
graph.cc
|
|
@ -7,7 +7,7 @@ char * getGraphByPercentage(unsigned value, unsigned len) {
|
|||
unsigned step = 0;
|
||||
char * bars = new char[len + 1];
|
||||
|
||||
unsigned barCount = (float(value) / 99.9 * len);
|
||||
unsigned barCount = (static_cast<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) - 0.1) * len);
|
||||
unsigned barCount = (static_cast<float>(value / (max - 0.1)) * len);
|
||||
|
||||
for(step; step < barCount; step++)
|
||||
bars[step] = '|';
|
||||
|
|
|
|||
Loading…
Reference in a new issue