rEFIt_UEFI/libeg/lodepng.cpp
/*See ensureBits documentation above. This one ensures up to 9 bits */
See ensureBits documentation above. This one ensures up to 9 bits
See ensureBits documentation above . This one ensures up to 9 bits
static unsigned ensureBits9(LodePNGBitReader* reader, size_t nbits) {
  size_t start = reader->bp >> 3u;
  size_t size = reader->size;
  if(start + 1u < size) {
    reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u);
    reader->buffer >>= (reader->bp & 7u);
    return 1;
  } else {
    reader->buffer = 0;
    if(start + 0u < size) reader->buffer |= reader->data[start + 0];
    reader->buffer >>= (reader->bp & 7u);
    return reader->bp + nbits <= reader->bitsize;
  }
}
static unsigned ensureBits9 ( LodePNGBitReader * reader , size_t nbits ) { size_t start = reader -> bp >> 3u ; size_t size = reader -> size ; if ( start + 1u < size ) { reader -> buffer = ( unsigned ) reader -> data [ start + 0 ] | ( ( unsigned ) reader -> data [ start + 1 ] << 8u ) ; reader -> buffer >>= ( reader -> bp & 7u ) ; return 1 ; } else { reader -> buffer = 0 ; if ( start + 0u < size ) reader -> buffer |= reader -> data [ start + 0 ] ; reader -> buffer >>= ( reader -> bp & 7u ) ; return reader -> bp + nbits <= reader -> bitsize ; } }
See ensureBits documentation above.
See ensureBits documentation above .