From f49bee7a2d647c2c5eac20b480666b1695c640a7 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Mon, 17 Apr 2017 19:15:40 +0000 Subject: [PATCH] Fixed and tweaked some pieces of C library code. --- c/qrcodegen.c | 5 +++-- c/qrcodegen.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/c/qrcodegen.c b/c/qrcodegen.c index 7a1c052..01c04d3 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -23,7 +23,6 @@ */ #include -#include #include #include "qrcodegen.h" @@ -45,6 +44,7 @@ static uint8_t finiteFieldMultiply(uint8_t x, uint8_t y); /*---- Function implementations ----*/ +// Public function - see documentation comment in header file. bool qrcodegen_isAlphanumeric(const char *text) { for (; *text != '\0'; text++) { char c = *text; @@ -70,6 +70,7 @@ bool qrcodegen_isAlphanumeric(const char *text) { } +// Public function - see documentation comment in header file. bool qrcodegen_isNumeric(const char *text) { for (; *text != '\0'; text++) { char c = *text; @@ -147,7 +148,7 @@ static void initializeFunctionalModules(int version, uint8_t qrcode[]) { } // Fill numerous alignment patterns - uint8_t alignPatPos[7] = {}; + uint8_t alignPatPos[7] = {0}; int numAlign = getAlignmentPatternPositions(version, alignPatPos); for (int i = 0; i < numAlign; i++) { for (int j = 0; j < numAlign; j++) { diff --git a/c/qrcodegen.h b/c/qrcodegen.h index 1d6448c..cbc8458 100644 --- a/c/qrcodegen.h +++ b/c/qrcodegen.h @@ -25,6 +25,7 @@ #pragma once #include +#include /*