Fixed warnings about int64 to int32 conversion
authorMichael Bradshaw <mbradshaw@sorensonmedia.com>
Wed, 16 May 2012 17:39:20 +0000 (11:39 -0600)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 25 May 2012 00:41:28 +0000 (02:41 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/common.h

index f4fcc9c..a11a325 100644 (file)
@@ -171,7 +171,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;
-    else                                         return a;
+    else                                         return (int32_t)a;
 }
 
 /**
@@ -230,7 +230,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(x) + av_popcount(x >> 32);
+    return av_popcount((uint32_t)x) + av_popcount(x >> 32);
 }
 
 #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))