From 976ff90d9e9085f8f3f37ffd0b8c8a128aed8967 Mon Sep 17 00:00:00 2001 From: Jonathan Reichelt Gjertsen Date: Sun, 23 May 2021 15:12:13 +0200 Subject: [PATCH] Add missing cast to uint32_t in hw_divider_u32_quotient for host 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 4d818747a..c12668852 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) {