From 596d08ea62d7bb10552bdbda8839d38e25f9fc9e Mon Sep 17 00:00:00 2001 From: Jonathan Reichelt Gjertsen Date: Sun, 23 May 2021 15:21:09 +0200 Subject: [PATCH] Add missing cast to uint32_t in hw_divider_u32_quotient for host (#436) Fixes the following warning: ``` [...]/pico-sdk/src/host/hardware_divider/include/hardware/divider.h:81:26: warning: operand of ?: changes signedness from 'int' to 'uint32_t' {aka 'unsigned int'} due to unsignedness of other operand [-Wsign-compare] return b ? (a / b) : -1; ^~ ``` --- src/host/hardware_divider/include/hardware/divider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/hardware_divider/include/hardware/divider.h b/src/host/hardware_divider/include/hardware/divider.h index 4d81874..c126688 100644 --- a/src/host/hardware_divider/include/hardware/divider.h +++ b/src/host/hardware_divider/include/hardware/divider.h @@ -78,7 +78,7 @@ static inline int32_t hw_divider_s32_remainder_wait() { } static inline uint32_t hw_divider_u32_quotient(uint32_t a, uint32_t b) { - return b ? (a / b) : -1; + return b ? (a / b) : (uint32_t)(-1); } static inline uint32_t hw_divider_u32_remainder(uint32_t a, uint32_t b) {