Reformatted small pieces of C code.

This commit is contained in:
Project Nayuki 2018-08-28 04:57:03 +00:00
parent e2789cd5c4
commit 536a881416
1 changed files with 7 additions and 4 deletions

View File

@ -239,8 +239,11 @@ testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ec
// for the given version number and error correction level. The result is in the range [9, 2956].
testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) {
int v = version, e = (int)ecl;
assert(0 <= e && e < 4 && qrcodegen_VERSION_MIN <= v && v <= qrcodegen_VERSION_MAX);
return getNumRawDataModules(v) / 8 - ECC_CODEWORDS_PER_BLOCK[e][v] * NUM_ERROR_CORRECTION_BLOCKS[e][v];
assert(qrcodegen_VERSION_MIN <= v && v <= qrcodegen_VERSION_MAX
&& 0 <= e && e < 4);
return getNumRawDataModules(v) / 8
- ECC_CODEWORDS_PER_BLOCK[e][v]
* NUM_ERROR_CORRECTION_BLOCKS[e][v];
}