From: Danny Al-Gaaf Date: Thu, 17 Sep 2015 12:54:58 +0000 (+0200) Subject: tools/rados/rados.cc: fix UNINTENDED_INTEGER_DIVISION X-Git-Tag: v10.0.4~86^2~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b838300c5c1f9e7e35dba47d1308e14e8e88ced9;p=ceph.git tools/rados/rados.cc: fix UNINTENDED_INTEGER_DIVISION Fix for: CID 1297882 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions ns and 1000000000UL, and then converting the integer quotient to type float. Any remainder, or fractional part of the quotient, is ignored. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc index 36f620bc209d..85aeb0187abe 100644 --- a/src/tools/rados/rados.cc +++ b/src/tools/rados/rados.cc @@ -569,7 +569,7 @@ public: utime_t now = ceph_clock_now(g_ceph_context); now -= start_time; uint64_t ns = now.nsec(); - float total = ns / 1000000000; + float total = (float) ns / 1000000000.0; total += now.sec(); return total; }