From 2c055c2e677c01cd17d307a76290b3804c6aa44c Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Tue, 28 Aug 2018 05:30:18 +0000 Subject: [PATCH] Renamed some related variables in C code to match other language versions. --- c/qrcodegen-test.c | 8 ++++---- c/qrcodegen.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/c/qrcodegen-test.c b/c/qrcodegen-test.c index 0674587..192f7dd 100644 --- a/c/qrcodegen-test.c +++ b/c/qrcodegen-test.c @@ -125,10 +125,10 @@ static uint8_t *addEccAndInterleaveReference(const uint8_t *data, int version, e calcReedSolomonGenerator(blockEccLen, generator); for (int i = 0, k = 0; i < numBlocks; i++) { uint8_t *block = MALLOC(shortBlockLen + 1, uint8_t); - int blockDataLen = shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1); - memcpy(block, &data[k], blockDataLen * sizeof(uint8_t)); - calcReedSolomonRemainder(&data[k], blockDataLen, generator, blockEccLen, &block[shortBlockLen + 1 - blockEccLen]); - k += blockDataLen; + int datLen = shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1); + memcpy(block, &data[k], datLen * sizeof(uint8_t)); + calcReedSolomonRemainder(&data[k], datLen, generator, blockEccLen, &block[shortBlockLen + 1 - blockEccLen]); + k += datLen; blocks[i] = block; } free(generator); diff --git a/c/qrcodegen.c b/c/qrcodegen.c index 45e4f9a..d346fe8 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -210,9 +210,9 @@ testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ec uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX]; calcReedSolomonGenerator(blockEccLen, generator); for (int i = 0, k = 0; i < numBlocks; i++) { - int blockLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); - calcReedSolomonRemainder(&data[k], blockLen, generator, blockEccLen, &data[dataLen + i * blockEccLen]); - k += blockLen; + int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); + calcReedSolomonRemainder(&data[k], datLen, generator, blockEccLen, &data[dataLen + i * blockEccLen]); + k += datLen; } // Interleave (not concatenate) the bytes from every block into a single sequence