From 3ceca8ad314d84f893cc6a1a82e9391984517e0e Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 6 Aug 2013 14:25:26 -0700 Subject: [PATCH] bit_reader.h: cosmetics - use const where applicable - drop unnecessary string.h include Change-Id: I560eef84fe17d3925768f6817c02ea79604c4379 --- src/utils/bit_reader.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/utils/bit_reader.h b/src/utils/bit_reader.h index 8c5d9ee7..19ef174f 100644 --- a/src/utils/bit_reader.h +++ b/src/utils/bit_reader.h @@ -19,7 +19,6 @@ #ifdef _MSC_VER #include // _byteswap_ulong #endif -#include // For memcpy #include "../webp/types.h" #if defined(__cplusplus) || defined(c_plusplus) @@ -155,7 +154,7 @@ static WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) { if (br->buf_ + sizeof(lbit_t) <= br->buf_end_) { // convert memory type to register type (with some zero'ing!) bit_t bits; - lbit_t in_bits = *(lbit_t*)br->buf_; + const lbit_t in_bits = *(const lbit_t*)br->buf_; br->buf_ += (BITS) >> 3; #if !defined(__BIG_ENDIAN__) #if (BITS > 32) @@ -254,6 +253,7 @@ static WEBP_INLINE void VP8Shift(VP8BitReader* const br) { br->bits_ -= shift; #endif } + static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { #ifndef USE_RIGHT_JUSTIFY // It's important to avoid generating a 64bit x 64bit multiply here. @@ -282,7 +282,6 @@ static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) { return bit ? -v : v; } - // ----------------------------------------------------------------------------- // Bitreader for lossless format @@ -322,7 +321,7 @@ static WEBP_INLINE void VP8LSetBitPos(VP8LBitReader* const br, int val) { br->bit_pos_ = val; } -// Advances the Read buffer by 4 bytes to make room for reading next 32 bits. +// Advances the read buffer by 4 bytes to make room for reading next 32 bits. void VP8LFillBitWindow(VP8LBitReader* const br); #if defined(__cplusplus) || defined(c_plusplus)