Mercurial > libavcodec.hg
changeset 11721:969a7d792b79 libavcodec
Use standard C for implementing sign_extend() and zero_extend().
This fixes compilation of probetest
author | michael |
---|---|
date | Thu, 13 May 2010 16:32:21 +0000 |
parents | 92f4ca7a4002 |
children | 5aa83c5fb2c9 |
files | mathops.h |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mathops.h Thu May 13 15:41:49 2010 +0000 +++ b/mathops.h Thu May 13 16:32:21 2010 +0000 @@ -118,14 +118,14 @@ #ifndef sign_extend static inline av_const int sign_extend(int val, unsigned bits) { - return (val << (INT_BIT - bits)) >> (INT_BIT - bits); + return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); } #endif #ifndef zero_extend static inline av_const unsigned zero_extend(unsigned val, unsigned bits) { - return (val << (INT_BIT - bits)) >> (INT_BIT - bits); + return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); } #endif