Tweaked casting between int and enum in C code (only affects this code being compiled in C++ mode).
This commit is contained in:
parent
d27ee77082
commit
53da031f1f
|
@ -303,7 +303,7 @@ static void encodeQrCodeTail(uint8_t dataAndQrcode[], int bitLen, uint8_t tempBu
|
||||||
if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask
|
if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask
|
||||||
long minPenalty = LONG_MAX;
|
long minPenalty = LONG_MAX;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
drawFormatBits(ecl, i, dataAndQrcode, qrsize);
|
drawFormatBits(ecl, (enum qrcodegen_Mask)i, dataAndQrcode, qrsize);
|
||||||
applyMask(tempBuffer, dataAndQrcode, qrsize, i);
|
applyMask(tempBuffer, dataAndQrcode, qrsize, i);
|
||||||
long penalty = getPenaltyScore(dataAndQrcode, qrsize);
|
long penalty = getPenaltyScore(dataAndQrcode, qrsize);
|
||||||
if (penalty < minPenalty) {
|
if (penalty < minPenalty) {
|
||||||
|
@ -314,7 +314,7 @@ static void encodeQrCodeTail(uint8_t dataAndQrcode[], int bitLen, uint8_t tempBu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(0 <= (int)mask && (int)mask <= 7);
|
assert(0 <= (int)mask && (int)mask <= 7);
|
||||||
drawFormatBits(ecl, (int)mask, dataAndQrcode, qrsize);
|
drawFormatBits(ecl, mask, dataAndQrcode, qrsize);
|
||||||
applyMask(tempBuffer, dataAndQrcode, qrsize, (int)mask);
|
applyMask(tempBuffer, dataAndQrcode, qrsize, (int)mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue