[FFmpeg-cvslog] checkasm: Cast unsigned to signed

Luca Barbato git at videolan.org
Wed Mar 15 13:32:57 EET 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Jul 19 05:26:33 2016 +0200| [40ad05bab206c932a32171d45581080c914b06ec] | committer: Luca Barbato

checkasm: Cast unsigned to signed

Avoid a warning for passing an unsigned value to abs(), some compilers
might optimize away abs().

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

 tests/checkasm/checkasm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index b062197..34f49c0 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -190,7 +190,7 @@ int float_near_ulp(float a, float b, unsigned max_ulp)
         return a == b;
     }
 
-    if (abs(x.i - y.i) <= max_ulp)
+    if (llabs((int64_t)x.i - y.i) <= max_ulp)
         return 1;
 
     return 0;



More information about the ffmpeg-cvslog mailing list