From 7acefc6c60f3a735c5adf913cd270ef7b1db904c Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 19 Apr 2020 00:07:57 -0400 Subject: [PATCH] AudioMatrix/Submix: static_cast INT_MAX to float --- lib/audiodev/AudioMatrix.hpp | 2 +- lib/audiodev/AudioSubmix.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/audiodev/AudioMatrix.hpp b/lib/audiodev/AudioMatrix.hpp index ccc31f1..cce679c 100644 --- a/lib/audiodev/AudioMatrix.hpp +++ b/lib/audiodev/AudioMatrix.hpp @@ -25,7 +25,7 @@ static inline int16_t Clamp16(float in) { static inline int32_t Clamp32(float in) { if (in < INT_MIN) return INT_MIN; - else if (in > INT_MAX) + else if (in > static_cast(INT_MAX)) return INT_MAX; return in; } diff --git a/lib/audiodev/AudioSubmix.cpp b/lib/audiodev/AudioSubmix.cpp index ca9ddd7..4565648 100644 --- a/lib/audiodev/AudioSubmix.cpp +++ b/lib/audiodev/AudioSubmix.cpp @@ -101,7 +101,7 @@ constexpr T ClampInt(float in) { if (in < MIN) return MIN; - else if (in > MAX) + else if (in > static_cast(MAX)) return MAX; else return in;