[FFmpeg-cvslog] avutil/libm: Replace macro based fminf() by function

Michael Niedermayer git at videolan.org
Fri Jun 6 17:30:58 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun  6 16:29:02 2014 +0200| [afce8348432463e135f2de69844e55598539c6bf] | committer: Michael Niedermayer

avutil/libm: Replace macro based fminf() by function

This avoids issues when the FFMIN parameter evaluation has side effects

Reviewed-by: Clément Bœsch <u at pkh.me>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=afce8348432463e135f2de69844e55598539c6bf
---

 libavutil/libm.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/libm.h b/libavutil/libm.h
index eacb3cc..13e6cfe 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



More information about the ffmpeg-cvslog mailing list