fix MSVC warnings regarding implicit uint64 to uint32 conversions

Change-Id: I284dae9222a3817bba3c5ba6be271b31b5bf660d
This commit is contained in:
Pascal Massimino 2012-09-01 07:21:45 -07:00
parent f6c096aad3
commit 6920c71f0a
2 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,7 @@ void VP8LFillBitWindow(VP8LBitReader* const br) {
} }
uint32_t VP8LReadOneBit(VP8LBitReader* const br) { uint32_t VP8LReadOneBit(VP8LBitReader* const br) {
const uint32_t val = (br->val_ >> br->bit_pos_) & 1; const uint32_t val = (uint32_t)((br->val_ >> br->bit_pos_) & 1);
// Flag an error at end_of_stream. // Flag an error at end_of_stream.
if (!br->eos_) { if (!br->eos_) {
++br->bit_pos_; ++br->bit_pos_;
@ -198,7 +198,7 @@ uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) {
if ((br->bit_pos_ + n_bits) > 64) return val; if ((br->bit_pos_ + n_bits) > 64) return val;
} }
} }
val = (br->val_ >> br->bit_pos_) & kBitMask[n_bits]; val = (uint32_t)((br->val_ >> br->bit_pos_) & kBitMask[n_bits]);
br->bit_pos_ += n_bits; br->bit_pos_ += n_bits;
if (br->bit_pos_ >= 40) { if (br->bit_pos_ >= 40) {
if (br->pos_ + 5 < br->len_) { if (br->pos_ + 5 < br->len_) {

View File

@ -121,7 +121,7 @@ static WEBP_INLINE int VP8BitUpdate(VP8BitReader* const br, bit_t split) {
static WEBP_INLINE void VP8Shift(VP8BitReader* const br) { static WEBP_INLINE void VP8Shift(VP8BitReader* const br) {
// range_ is in [0..127] interval here. // range_ is in [0..127] interval here.
const int idx = br->range_ >> (BITS); const bit_t idx = br->range_ >> (BITS);
const int shift = kVP8Log2Range[idx]; const int shift = kVP8Log2Range[idx];
br->range_ = kVP8NewRange[idx]; br->range_ = kVP8NewRange[idx];
br->value_ <<= shift; br->value_ <<= shift;
@ -182,7 +182,7 @@ uint32_t VP8LReadOneBit(VP8LBitReader* const br);
// 32 times after the last VP8LFillBitWindow. Any subsequent calls // 32 times after the last VP8LFillBitWindow. Any subsequent calls
// (without VP8LFillBitWindow) will return invalid data. // (without VP8LFillBitWindow) will return invalid data.
static WEBP_INLINE uint32_t VP8LReadOneBitUnsafe(VP8LBitReader* const br) { static WEBP_INLINE uint32_t VP8LReadOneBitUnsafe(VP8LBitReader* const br) {
const uint32_t val = (br->val_ >> br->bit_pos_) & 1; const uint32_t val = (uint32_t)((br->val_ >> br->bit_pos_) & 1);
++br->bit_pos_; ++br->bit_pos_;
return val; return val;
} }