diff --git a/libavutil/common.h b/libavutil/common.h index dd1c22396e..2e72a83913 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -118,7 +118,7 @@ static inline av_const int av_clip(int a, int amin, int amax) */ static inline av_const uint8_t av_clip_uint8(int a) { - if (a&(~255)) return (-a)>>31; + if (a&(~0xFF)) return (-a)>>31; else return a; } @@ -129,7 +129,7 @@ static inline av_const uint8_t av_clip_uint8(int a) */ static inline av_const uint16_t av_clip_uint16(int a) { - if (a&(~65535)) return (-a)>>31; + if (a&(~0xFFFF)) return (-a)>>31; else return a; } @@ -140,7 +140,7 @@ static inline av_const uint16_t av_clip_uint16(int a) */ static inline av_const int16_t av_clip_int16(int a) { - if ((a+32768) & ~65535) return (a>>31) ^ 32767; + if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF; else return a; }