mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-29 06:36:05 +08:00
fix(qrcodegen) add brackets around assert calls (#2897)
Add brackets to fix build errors on platforms which define assert as an empty macro.
This commit is contained in:
committed by
GitHub
parent
cb7fc2bb59
commit
050ee4848f
@@ -948,9 +948,9 @@ struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) {
|
|||||||
result.mode = qrcodegen_Mode_ECI;
|
result.mode = qrcodegen_Mode_ECI;
|
||||||
result.numChars = 0;
|
result.numChars = 0;
|
||||||
result.bitLength = 0;
|
result.bitLength = 0;
|
||||||
if (assignVal < 0)
|
if (assignVal < 0) {
|
||||||
assert(false);
|
assert(false);
|
||||||
else if (assignVal < (1 << 7)) {
|
} else if (assignVal < (1 << 7)) {
|
||||||
memset(buf, 0, 1 * sizeof(buf[0]));
|
memset(buf, 0, 1 * sizeof(buf[0]));
|
||||||
appendBitsToBuffer(assignVal, 8, buf, &result.bitLength);
|
appendBitsToBuffer(assignVal, 8, buf, &result.bitLength);
|
||||||
} else if (assignVal < (1 << 14)) {
|
} else if (assignVal < (1 << 14)) {
|
||||||
@@ -962,8 +962,9 @@ struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) {
|
|||||||
appendBitsToBuffer(6, 3, buf, &result.bitLength);
|
appendBitsToBuffer(6, 3, buf, &result.bitLength);
|
||||||
appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength);
|
appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength);
|
||||||
appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength);
|
appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength);
|
||||||
} else
|
} else {
|
||||||
assert(false);
|
assert(false);
|
||||||
|
}
|
||||||
result.data = buf;
|
result.data = buf;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user