mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix saturateCast signed check
This commit is contained in:
parent
d8643870d6
commit
00d1c0dc9d
|
@ -74,7 +74,7 @@ constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
|
|||
|
||||
template<typename T, typename U>
|
||||
constexpr T saturateCast(U value) {
|
||||
if (std::numeric_limits<T>::is_signed == std::numeric_limits<T>::is_signed) {
|
||||
if (std::numeric_limits<T>::is_signed == std::numeric_limits<U>::is_signed) {
|
||||
if (value > std::numeric_limits<T>::max()) {
|
||||
return std::numeric_limits<T>::max();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue