From 080e1be24dd43144acea22aa44d2da807b4b0fca Mon Sep 17 00:00:00 2001 From: "Pawel \"l0ner\" Soltys" Date: Sun, 4 Jan 2015 17:23:05 +0100 Subject: [PATCH] use static_cast<> instead of c-like cast --- graph.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graph.cc b/graph.cc index 6080f8d..97130f2 100644 --- a/graph.cc +++ b/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(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(value / (max - 0.1)) * len); for(step; step < barCount; step++) bars[step] = '|';