From 050ee4848fe2debfdcacd93e85995c9cfc7107f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= Date: Tue, 14 Dec 2021 14:34:59 +0100 Subject: [PATCH] fix(qrcodegen) add brackets around assert calls (#2897) Add brackets to fix build errors on platforms which define assert as an empty macro. --- src/extra/libs/qrcode/qrcodegen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extra/libs/qrcode/qrcodegen.c b/src/extra/libs/qrcode/qrcodegen.c index 01d9d81af..091282512 100644 --- a/src/extra/libs/qrcode/qrcodegen.c +++ b/src/extra/libs/qrcode/qrcodegen.c @@ -948,9 +948,9 @@ struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) { result.mode = qrcodegen_Mode_ECI; result.numChars = 0; result.bitLength = 0; - if (assignVal < 0) + if (assignVal < 0) { assert(false); - else if (assignVal < (1 << 7)) { + } else if (assignVal < (1 << 7)) { memset(buf, 0, 1 * sizeof(buf[0])); appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); } 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(assignVal >> 10, 11, buf, &result.bitLength); appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); - } else + } else { assert(false); + } result.data = buf; return result; }