Lines Matching defs:bitLen
55 testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen);
185 testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen) {
187 for (int i = numBits - 1; i >= 0; i--, (*bitLen)++)
188 buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7));
232 int bitLen = 0;
235 appendBitsToBuffer((unsigned int)seg->mode, 4, qrcode, &bitLen);
236 appendBitsToBuffer((unsigned int)seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen);
239 appendBitsToBuffer((unsigned int)bit, 1, qrcode, &bitLen);
242 assert(bitLen == dataUsedBits);
246 assert(bitLen <= dataCapacityBits);
247 int terminatorBits = dataCapacityBits - bitLen;
250 appendBitsToBuffer(0, terminatorBits, qrcode, &bitLen);
251 appendBitsToBuffer(0, (8 - bitLen % 8) % 8, qrcode, &bitLen);
252 assert(bitLen % 8 == 0);
255 for (uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11)
256 appendBitsToBuffer(padByte, 8, qrcode, &bitLen);
896 int bitLen = calcSegmentBitLength(result.mode, len);
897 assert(bitLen != -1);
899 if (bitLen > 0)
900 memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0]));
918 assert(result.bitLength == bitLen);
930 int bitLen = calcSegmentBitLength(result.mode, len);
931 assert(bitLen != -1);
933 if (bitLen > 0)
934 memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0]));
952 assert(result.bitLength == bitLen);