> 0, which means that we are shifting _this->end_byte (an unsigned char) > by 8, so the result should be zero regardless of the content of > _this->end_byte. Can you check whether _this->end_bits_left is really chars are 16 bit on C55x. You should probably just initialize end_byte to zero.