summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/oned
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/oned')
-rw-r--r--xfa/src/fxbarcode/oned/BC_OneDReader.cpp4
-rw-r--r--xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp6
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp4
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp8
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp4
5 files changed, 18 insertions, 8 deletions
diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp
index 61448d21e7..b89f76423e 100644
--- a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_Reader.h"
#include "xfa/src/fxbarcode/BC_BinaryBitmap.h"
@@ -48,7 +50,7 @@ CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap* image,
CBC_CommonBitArray* row = NULL;
int32_t middle = height >> 1;
FX_BOOL tryHarder = FALSE;
- int32_t rowStep = FX_MAX(1, height >> (tryHarder ? 8 : 5));
+ int32_t rowStep = std::max(1, height >> (tryHarder ? 8 : 5));
int32_t maxLines;
if (tryHarder) {
maxLines = height;
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp
index 8f4b226e8c..159f27f826 100644
--- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -22,6 +22,7 @@
#include "BC_OneDimWriter.h"
+#include <algorithm>
#include <memory>
#include "xfa/src/fxbarcode/BC_Writer.h"
@@ -391,7 +392,8 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
m_outputHScale = (FX_FLOAT)m_Width / (FX_FLOAT)codeLength;
}
if (!isDevice) {
- m_outputHScale = FX_MAX(m_outputHScale, m_ModuleWidth);
+ m_outputHScale =
+ std::max(m_outputHScale, static_cast<FX_FLOAT>(m_ModuleWidth));
}
FX_FLOAT dataLengthScale = 1.0;
if (m_iDataLenth > 0 && contents.GetLength() != 0) {
@@ -407,7 +409,7 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
int32_t outputHeight = 1;
if (!isDevice) {
if (m_Height == 0) {
- outputHeight = FX_MAX(20, m_ModuleHeight);
+ outputHeight = std::max(20, m_ModuleHeight);
} else {
outputHeight = m_Height;
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp
index a2177fd699..c75ddd48ee 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_Reader.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitArray.h"
@@ -140,7 +142,7 @@ CFX_Int32Array* CBC_OnedCodaBarReader::FindAsteriskPattern(
if (counterPosition == patternLength - 1) {
if (ArrayContains(STARTEND_ENCODING, ToNarrowWidePattern(&counters))) {
FX_BOOL btemp3 =
- row->IsRange(FX_MAX(0, patternStart - (i - patternStart) / 2),
+ row->IsRange(std::max(0, patternStart - (i - patternStart) / 2),
patternStart, FALSE, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
if (btemp3) {
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
index 601baa2a4c..cbc7a5a859 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_Reader.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitArray.h"
@@ -115,7 +117,7 @@ CFX_Int32Array* CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray* row,
}
if (bestMatch >= 0) {
FX_BOOL btemp2 =
- row->IsRange(FX_MAX(0, patternStart - (i - patternStart) / 2),
+ row->IsRange(std::max(0, patternStart - (i - patternStart) / 2),
patternStart, FALSE, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
if (btemp2) {
@@ -338,8 +340,8 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber,
nextStart++;
}
FX_BOOL boolT1 = row->IsRange(
- nextStart, FX_MIN(width, nextStart + (nextStart - lastStart) / 2), FALSE,
- e);
+ nextStart, std::min(width, nextStart + (nextStart - lastStart) / 2),
+ FALSE, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
if (!boolT1) {
e = BCExceptionNotFound;
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
index a5b77ed13f..18d1e96494 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_Reader.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitArray.h"
@@ -144,7 +146,7 @@ CFX_Int32Array* CBC_OnedCode39Reader::FindAsteriskPattern(
if (counterPosition == patternLength - 1) {
if (ToNarrowWidePattern(&counters) == ASTERISK_ENCODING) {
FX_BOOL bT1 =
- row->IsRange(FX_MAX(0, patternStart - (i - patternStart) / 2),
+ row->IsRange(std::max(0, patternStart - (i - patternStart) / 2),
patternStart, FALSE, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
if (bT1) {