From afce8348432463e135f2de69844e55598539c6bf Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 6 Jun 2014 16:29:02 +0200 Subject: [PATCH] avutil/libm: Replace macro based fminf() by function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids issues when the FFMIN parameter evaluation has side effects Reviewed-by: Clément Bœsch Reviewed-by: Derek Buitenhuis Signed-off-by: Michael Niedermayer --- libavutil/libm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/libm.h b/libavutil/libm.h index eacb3cc42a..13e6cfe181 100644 --- a/libavutil/libm.h +++ b/libavutil/libm.h @@ -84,7 +84,10 @@ static av_always_inline float cbrtf(float x) #if !HAVE_FMINF #undef fminf -#define fminf(x, y) (FFMIN(x,y)) +static av_always_inline av_const float fminf(float x, float y) +{ + return FFMIN(x, y); +} #endif #if !HAVE_ISINF