Renamed some related variables in C code to match other language versions.

This commit is contained in:
Project Nayuki 2018-08-28 05:30:18 +00:00
parent 08f7bba796
commit 2c055c2e67
2 changed files with 7 additions and 7 deletions

View File

@ -125,10 +125,10 @@ static uint8_t *addEccAndInterleaveReference(const uint8_t *data, int version, e
calcReedSolomonGenerator(blockEccLen, generator); calcReedSolomonGenerator(blockEccLen, generator);
for (int i = 0, k = 0; i < numBlocks; i++) { for (int i = 0, k = 0; i < numBlocks; i++) {
uint8_t *block = MALLOC(shortBlockLen + 1, uint8_t); uint8_t *block = MALLOC(shortBlockLen + 1, uint8_t);
int blockDataLen = shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1); int datLen = shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1);
memcpy(block, &data[k], blockDataLen * sizeof(uint8_t)); memcpy(block, &data[k], datLen * sizeof(uint8_t));
calcReedSolomonRemainder(&data[k], blockDataLen, generator, blockEccLen, &block[shortBlockLen + 1 - blockEccLen]); calcReedSolomonRemainder(&data[k], datLen, generator, blockEccLen, &block[shortBlockLen + 1 - blockEccLen]);
k += blockDataLen; k += datLen;
blocks[i] = block; blocks[i] = block;
} }
free(generator); free(generator);

View File

@ -210,9 +210,9 @@ testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ec
uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX]; uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX];
calcReedSolomonGenerator(blockEccLen, generator); calcReedSolomonGenerator(blockEccLen, generator);
for (int i = 0, k = 0; i < numBlocks; i++) { for (int i = 0, k = 0; i < numBlocks; i++) {
int blockLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1);
calcReedSolomonRemainder(&data[k], blockLen, generator, blockEccLen, &data[dataLen + i * blockEccLen]); calcReedSolomonRemainder(&data[k], datLen, generator, blockEccLen, &data[dataLen + i * blockEccLen]);
k += blockLen; k += datLen;
} }
// Interleave (not concatenate) the bytes from every block into a single sequence // Interleave (not concatenate) the bytes from every block into a single sequence