diff options
author | weili <weili@chromium.org> | 2016-06-02 15:48:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-02 15:48:16 -0700 |
commit | db444d2063df6c574882d9263e885c4fe1134133 (patch) | |
tree | 27ce4a3f181ae0b5ad4eff6893016e7d49dfce0a /xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp | |
parent | ad700c2c1fc3c3843dae71e5982f462e42efc987 (diff) | |
download | pdfium-db444d2063df6c574882d9263e885c4fe1134133.tar.xz |
Fix all the code which has duplicate variable declarations
When there are duplicate variable declarations, the inner names shadow the
outter ones. This is error prone and harder to read. Remove all the
instances found by /analyze.
BUG=chromium:613623, chromium:427616
Review-Url: https://codereview.chromium.org/2027273002
Diffstat (limited to 'xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp')
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp index 4276066444..ffa0a4d9d1 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp @@ -57,13 +57,12 @@ CBC_CommonDecoderResult* CBC_DataMatrixDecoder::Decode( BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); int32_t dataBlocksCount = dataBlocks->GetSize(); int32_t totalBytes = 0; - int32_t i, j; - for (i = 0; i < dataBlocksCount; i++) { + for (int32_t i = 0; i < dataBlocksCount; i++) { totalBytes += (*dataBlocks)[i]->GetNumDataCodewords(); } CFX_ByteArray resultBytes; resultBytes.SetSize(totalBytes); - for (j = 0; j < dataBlocksCount; j++) { + for (int32_t j = 0; j < dataBlocksCount; j++) { CFX_ByteArray* codewordBytes = (*dataBlocks)[j]->GetCodewords(); int32_t numDataCodewords = (*dataBlocks)[j]->GetNumDataCodewords(); CorrectErrors(*codewordBytes, numDataCodewords, e); @@ -74,12 +73,11 @@ CBC_CommonDecoderResult* CBC_DataMatrixDecoder::Decode( delete dataBlocks; return nullptr; } - int32_t i; - for (i = 0; i < numDataCodewords; i++) { + for (int32_t i = 0; i < numDataCodewords; i++) { resultBytes[i * dataBlocksCount + j] = (*codewordBytes)[i]; } } - for (i = 0; i < (dataBlocks->GetSize()); i++) { + for (int32_t i = 0; i < (dataBlocks->GetSize()); i++) { delete (*dataBlocks)[i]; } delete dataBlocks; |