aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-02-01 14:04:40 +0100
committerMax Kellermann <max@duempel.org>2013-02-01 14:04:40 +0100
commit0ac06d77f1d47398808935418153a14d1d858860 (patch)
tree28be085df4fcbdf86fd3879e08dee26d1323fc2f
parent469e23342831361100d18e53f7f36631f8d96a3a (diff)
PcmUtils: make PcmClamp() 64-bit-safe, add missing cast
-rw-r--r--src/PcmUtils.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PcmUtils.hxx b/src/PcmUtils.hxx
index d05b8a69..7c7173d8 100644
--- a/src/PcmUtils.hxx
+++ b/src/PcmUtils.hxx
@@ -71,8 +71,8 @@ gcc_const
static inline T
PcmClamp(U x)
{
- constexpr U MIN_VALUE = -(1 << (bits - 1));
- constexpr U MAX_VALUE = (1 << (bits - 1)) - 1;
+ constexpr U MIN_VALUE = -(U(1) << (bits - 1));
+ constexpr U MAX_VALUE = (U(1) << (bits - 1)) - 1;
typedef std::numeric_limits<T> limits;
static_assert(MIN_VALUE >= limits::min(), "out of range");