Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
index 4276066444a907e4e8880f985365df15c61cae45..ffa0a4d9d1ddbce820df908ee973d1c76cf77e8a 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;

Powered by Google App Engine
This is Rietveld 408576698