rEFIt_UEFI/libeg/lodepng.cpp
/* LSB of value is written first, and LSB of bytes is used first */
LSB of value is written first, and LSB of bytes is used first
LSB of value is written first and LSB of bytes is used first
static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  if(nbits == 1) { 
    WRITEBIT(writer, value);
  } else {
    size_t i;
    for(i = 0; i != nbits; ++i) {
      WRITEBIT(writer, (unsigned char)((value >> i) & 1));
    }
  }
}
static void writeBits ( LodePNGBitWriter * writer , unsigned value , size_t nbits ) { if ( nbits == 1 ) { WRITEBIT ( writer , value ) ; } else { size_t i ; for ( i = 0 ; i != nbits ; ++ i ) { WRITEBIT ( writer , ( unsigned char ) ( ( value >> i ) & 1 ) ) ; } } }
LSB of value is written first, and LSB of bytes is used first
LSB of value is written first and LSB of bytes is used first
/* compiler should statically compile this case if nbits == 1 */ /* TODO: increase output size nly once here rather than in each WRITEBIT */