|
|
|
@ -346,7 +346,7 @@ static void encodeQrCodeTail(uint8_t dataAndQrcode[], int bitLen, uint8_t tempBu
|
|
|
|
|
|
|
|
|
|
// Appends the given sequence of bits to the given byte-based bit buffer, increasing the bit length.
|
|
|
|
|
testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen) {
|
|
|
|
|
assert(0 <= numBits && numBits <= 16 && (long)val >> numBits == 0);
|
|
|
|
|
assert(0 <= numBits && numBits <= 16 && (unsigned long)val >> numBits == 0);
|
|
|
|
|
for (int i = numBits - 1; i >= 0; i--, (*bitLen)++)
|
|
|
|
|
buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7));
|
|
|
|
|
}
|
|
|
|
|