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);
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);

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];
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