From 29cb85ba17faa600194dfa42343491715296a680 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 7 Mar 2022 12:17:46 +0800 Subject: [PATCH] arch/stm32: Fix compiler warning chip/stm32_i2s.c:1949:12: error: conflicting types for built-in function 'roundf'; expected 'float(float)' [-Werror=builtin-declaration-mismatch] 1949 | static int roundf(float num) | ^~~~~~ Signed-off-by: Xiang Xiao --- arch/arm/src/stm32/stm32_i2s.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/stm32/stm32_i2s.c b/arch/arm/src/stm32/stm32_i2s.c index d1649a9642..a650827a89 100644 --- a/arch/arm/src/stm32/stm32_i2s.c +++ b/arch/arm/src/stm32/stm32_i2s.c @@ -1946,7 +1946,7 @@ errout_with_buf: #endif } -static int roundf(float num) +static int stm32_i2s_roundf(float num) { if (((int)(num + 0.5f)) > num) { @@ -2209,8 +2209,8 @@ static uint32_t i2s_mckdivider(struct stm32_i2s_s *priv) { for (n = 2; n <= 256; ++n) { - napprox = roundf(priv->samplerate / 1000000.0f * - (8 * 32 * R * (2 * n + od))); + napprox = stm32_i2s_roundf(priv->samplerate / 1000000.0f * + (8 * 32 * R * (2 * n + od))); if ((napprox > 432) || (napprox < 50)) { continue;