From e43b56eb3842e4691fe1b6a30db40d9aa94860fe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 Aug 2014 18:41:28 +0200 Subject: Chrono: add template parameter to ToScale() --- src/Chrono.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Chrono.hxx b/src/Chrono.hxx index 765522cf0..97e3ddc24 100644 --- a/src/Chrono.hxx +++ b/src/Chrono.hxx @@ -57,9 +57,9 @@ public: return count(); } - constexpr unsigned ToScale(unsigned base) const { - // TODO: case to 64 bit to avoid integer overflow? - return count() * base / 1000; + template + constexpr T ToScale(unsigned base) const { + return count() * T(base) / 1000; } }; -- cgit v1.2.3