use static_cast<> instead of c-like cast

This commit is contained in:
Pawel "l0ner" Soltys 2015-01-04 17:23:05 +01:00
parent 47b9f62a10
commit 080e1be24d

View file

@ -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] = '|';