]> granicus.if.org Git - icinga2/commitdiff
Fix compiler warning in PerfdataValue::Parse.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 11 Nov 2013 12:14:42 +0000 (13:14 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 11 Nov 2013 12:14:42 +0000 (13:14 +0100)
Fixes #5055

lib/icinga/perfdatavalue.cpp

index 9cc5fa00c233b2e84d601942b11480698cf9b4a5..c00d1b42b3396d485c2a5cbd773522f5b9f3fc0e 100644 (file)
@@ -63,24 +63,24 @@ Value PerfdataValue::Parse(const String& perfdata)
        boost::algorithm::to_lower(unit);
 
        if (unit == "us") {
-               value /= 1000 * 1000;
+               value /= 1000.0 * 1000.0;
                unit = "seconds";
        } else if (unit == "ms") {
-               value /= 1000;
+               value /= 1000.0;
                unit = "seconds";
        } else if (unit == "s") {
                unit = "seconds";
        } else if (unit == "tb") {
-               value *= 1024 * 1024 * 1024 * 1024;
+               value *= 1024.0 * 1024.0 * 1024.0 * 1024.0;
                unit = "bytes";
        } else if (unit == "gb") {
-               value *= 1024 * 1024 * 1024;
+               value *= 1024.0 * 1024.0 * 1024.0;
                unit = "bytes";
        } else if (unit == "mb") {
-               value *= 1024 * 1024;
+               value *= 1024.0 * 1024.0;
                unit = "bytes";
        } else if (unit == "kb") {
-               value *= 1024;
+               value *= 1024.0;
                unit = "bytes";
        } else if (unit == "b") {
                unit = "bytes";