summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/pdf417
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/pdf417')
-rw-r--r--xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp5
-rw-r--r--xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp10
2 files changed, 8 insertions, 7 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp
index 8bb2c1ebc8..ea1e38765a 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp
@@ -20,11 +20,12 @@
* limitations under the License.
*/
+#include <limits>
+
#include "xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h"
#include "xfa/src/fxbarcode/pdf417/BC_PDF417Common.h"
#define SYMBOL_TABLE_Length 2787
-#define Float_MAX_VALUE 2147483647
FX_FLOAT CBC_PDF417CodewordDecoder::RATIOS_TABLE[2787][8] = {{0}};
@@ -99,7 +100,7 @@ int32_t CBC_PDF417CodewordDecoder::getClosestDecodedValue(
for (int32_t i = 0; i < bitCountRatios.GetSize(); i++) {
bitCountRatios[i] = moduleBitCount.GetAt(i) / (FX_FLOAT)bitCountSum;
}
- FX_FLOAT bestMatchError = (FX_FLOAT)Float_MAX_VALUE;
+ FX_FLOAT bestMatchError = std::numeric_limits<int32_t>::max();
int32_t bestMatch = -1;
for (int32_t j = 0; j < SYMBOL_TABLE_Length; j++) {
FX_FLOAT error = 0.0f;
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp
index 7e5d0d8851..6365e27efb 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <limits>
+
#include "xfa/src/fxbarcode/BC_BinaryBitmap.h"
#include "xfa/src/fxbarcode/BC_BinaryBitmap.h"
#include "xfa/src/fxbarcode/BC_DecoderResult.h"
@@ -51,10 +53,9 @@
#include "xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h"
#include "xfa/src/fxbarcode/utils.h"
-#define Integer_MAX_VALUE 2147483647
-
CBC_PDF417Reader::CBC_PDF417Reader() {}
CBC_PDF417Reader::~CBC_PDF417Reader() {}
+
CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap* image, int32_t& e) {
return Decode(image, 0, e);
}
@@ -100,9 +101,8 @@ int32_t CBC_PDF417Reader::getMaxWidth(CBC_ResultPoint* p1,
}
int32_t CBC_PDF417Reader::getMinWidth(CBC_ResultPoint* p1,
CBC_ResultPoint* p2) {
- if (p1 == NULL || p2 == NULL) {
- return Integer_MAX_VALUE;
- }
+ if (!p1 || !p2)
+ return std::numeric_limits<int32_t>::max();
return (int32_t)FXSYS_fabs(p1->GetX() - p2->GetX());
}
int32_t CBC_PDF417Reader::getMaxCodewordWidth(CFX_PtrArray& p) {