Added/tweaked comments in C code to correspond to the other language ports.

pull/134/head
Project Nayuki 3 years ago
parent 359c42557c
commit c53c754acf

@ -255,14 +255,14 @@ bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], siz
for (uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11)
appendBitsToBuffer(padByte, 8, qrcode, &bitLen);
// Draw function and data codeword modules
// Compute ECC, draw modules
addEccAndInterleave(qrcode, version, ecl, tempBuffer);
initializeFunctionModules(version, qrcode);
drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode);
drawLightFunctionModules(qrcode, version);
initializeFunctionModules(version, tempBuffer);
// Handle masking
// Do masking
if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask
long minPenalty = LONG_MAX;
for (int i = 0; i < 8; i++) {
@ -278,8 +278,8 @@ bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], siz
}
}
assert(0 <= (int)mask && (int)mask <= 7);
applyMask(tempBuffer, qrcode, mask);
drawFormatBits(ecl, mask, qrcode);
applyMask(tempBuffer, qrcode, mask); // Apply the final choice of mask
drawFormatBits(ecl, mask, qrcode); // Overwrite old format bits
return true;
}

Loading…
Cancel
Save