From 0ac06d77f1d47398808935418153a14d1d858860 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 1 Feb 2013 14:04:40 +0100 Subject: PcmUtils: make PcmClamp() 64-bit-safe, add missing cast --- src/PcmUtils.hxx | 4 ++-- 1 file 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 limits; static_assert(MIN_VALUE >= limits::min(), "out of range"); -- cgit v1.2.3