aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/rational.h
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2013-08-26 22:31:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-27 14:25:34 +0200
commit16c3ed5837884e2b60cf40e762be6c58b13d7ba6 (patch)
tree22d2859807935461e1e95f1679376e29e5bcc92c /libavutil/rational.h
parent231201382ea0697b9e29fabcd7996db719ea8b9a (diff)
downloadffmpeg-16c3ed5837884e2b60cf40e762be6c58b13d7ba6.tar.gz
libavutil: cast truncated values to uint32_t
programs using ffmpeg that are compiled with -Wshorten-64-to-32 gives a warning when using header files common.h and rational.h cast 64-bit truncated values to (uint32_t) to avoid the warning Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/rational.h')
-rw-r--r--libavutil/rational.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/rational.h b/libavutil/rational.h
index 417e29e577..b9800ee360 100644
--- a/libavutil/rational.h
+++ b/libavutil/rational.h
@@ -55,7 +55,7 @@ typedef struct AVRational{
static inline int av_cmp_q(AVRational a, AVRational b){
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
- if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
+ if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1;
else if(b.den && a.den) return 0;
else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
else return INT_MIN;