aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-27 18:41:28 +0200
committerMax Kellermann <max@duempel.org>2014-08-27 18:41:33 +0200
commite43b56eb3842e4691fe1b6a30db40d9aa94860fe (patch)
treedac025176ee840f5f3c4e60db0d3dd85bab91f35
parent0c2d767f6fca030a8da3202c05b3eb80ba176ef1 (diff)
downloadmpd-e43b56eb3842e4691fe1b6a30db40d9aa94860fe.tar.gz
mpd-e43b56eb3842e4691fe1b6a30db40d9aa94860fe.tar.xz
mpd-e43b56eb3842e4691fe1b6a30db40d9aa94860fe.zip
Chrono: add template parameter to ToScale()
-rw-r--r--src/Chrono.hxx6
1 files 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<typename T=rep>
+ constexpr T ToScale(unsigned base) const {
+ return count() * T(base) / 1000;
}
};