diff options
Diffstat (limited to 'xfa/fxbarcode/datamatrix')
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 14 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index 1c20b7c8a1..8f54353d4a 100644 --- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -172,14 +172,12 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t len, int32_t numECWords, int32_t& e) { - int32_t table = -1; - for (int32_t i = 0; i < sizeof(FACTOR_SETS) / sizeof(int32_t); i++) { - if (FACTOR_SETS[i] == numECWords) { - table = i; - break; - } - } - if (table < 0) { + static const size_t kFactorTableNum = sizeof(FACTOR_SETS) / sizeof(int32_t); + size_t table = 0; + while (table < kFactorTableNum && FACTOR_SETS[table] != numECWords) + table++; + + if (table >= kFactorTableNum) { e = BCExceptionIllegalArgument; return (FX_WCHAR*)""; } diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 15f288be63..19672c1b71 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -158,7 +158,7 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, int32_t charsProcessed = 0; while (TRUE) { if ((startpos + charsProcessed) == msg.GetLength()) { - uint32_t min = std::numeric_limits<int32_t>::max(); + int32_t min = std::numeric_limits<int32_t>::max(); CFX_ByteArray mins; mins.SetSize(6); CFX_Int32Array intCharCounts; |