From ed3e401d0629356e85ae4fa49608aeb4c7f51bee Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 29 Aug 2024 21:06:04 +0100 Subject: [PATCH] Use ClampTo in RXCompressUint to fix narrowing warning --- src/core/math_func.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/math_func.cpp b/src/core/math_func.cpp index 1d4eef26fb..fc8853de3c 100644 --- a/src/core/math_func.cpp +++ b/src/core/math_func.cpp @@ -135,7 +135,7 @@ uint16_t RXCompressUint(uint32_t num) { if (num <= 0x100) return num; if (num <= 0x7900) return 0x100 + ((num - 0x100) >> 3); - return std::min(UINT16_MAX, 0x1000 + ((num - 0x7900) >> 6)); + return ClampTo(0x1000 + ((num - 0x7900) >> 6)); } /**