diff options
author | Alfred E. Heggestad <aeh@db.org> | 2013-08-26 22:31:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-27 14:25:34 +0200 |
commit | 16c3ed5837884e2b60cf40e762be6c58b13d7ba6 (patch) | |
tree | 22d2859807935461e1e95f1679376e29e5bcc92c /libavutil/common.h | |
parent | 231201382ea0697b9e29fabcd7996db719ea8b9a (diff) | |
download | ffmpeg-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/common.h')
-rw-r--r-- | libavutil/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index c7c32fd363..9f0f998682 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -175,7 +175,7 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a) */ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { - if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF; + if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); else return (int32_t)a; } @@ -279,7 +279,7 @@ static av_always_inline av_const int av_popcount_c(uint32_t x) */ static av_always_inline av_const int av_popcount64_c(uint64_t x) { - return av_popcount((uint32_t)x) + av_popcount(x >> 32); + return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32)); } #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24)) |