From 2fc287904a8c2f2cb504c5710ee58684dd2bf697 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Thu, 4 Nov 2021 14:45:44 +0000 Subject: [PATCH] Tweaked C code to avoid unused-parameter warning when compiling without asserts. --- c/qrcodegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/qrcodegen.c b/c/qrcodegen.c index 2e28a4f..fc236b2 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -713,7 +713,7 @@ static long getPenaltyScore(const uint8_t qrcode[]) { // returns either 0, 1, or 2. A helper function for getPenaltyScore(). static int finderPenaltyCountPatterns(const int runHistory[7], int qrsize) { int n = runHistory[1]; - assert(n <= qrsize * 3); + assert(n <= qrsize * 3); (void)qrsize; bool core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n; // The maximum QR Code size is 177, hence the dark run length n <= 177. // Arithmetic is promoted to int, so n*4 will not overflow.