summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
commit375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch)
tree1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /xfa/src/fxbarcode/qrcode
parent492961df3011ccc25646eae12ac6e6dcfe7f26da (diff)
downloadpdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz
Merge to XFA: Switch most min/max macros to std::min/max.
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
Diffstat (limited to 'xfa/src/fxbarcode/qrcode')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp6
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp10
2 files changed, 10 insertions, 6 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 2610db95dc..2e16c036ca 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_UtilCodingConvert.h"
#include "xfa/src/fxbarcode/common/BC_CommonByteArray.h"
@@ -876,8 +878,8 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits,
GenerateECBytes(dataBytes, numEcBytesInBlosk, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
blocks.Add(new CBC_QRCoderBlockPair(dataBytes, ecBytes));
- maxNumDataBytes = FX_MAX(maxNumDataBytes, dataBytes->Size());
- maxNumEcBytes = FX_MAX(maxNumEcBytes, ecBytes->Size());
+ maxNumDataBytes = std::max(maxNumDataBytes, dataBytes->Size());
+ maxNumEcBytes = std::max(maxNumEcBytes, ecBytes->Size());
dataBytesOffset += numDataBytesInBlock;
}
if (numDataBytes != dataBytesOffset) {
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
index 1b799114b4..2280e9a4b8 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/BC_ResultPoint.h"
@@ -255,16 +257,16 @@ CBC_QRAlignmentPattern* CBC_QRDetector::FindAlignmentInRegion(
FX_FLOAT allowanceFactor,
int32_t& e) {
int32_t allowance = (int32_t)(allowanceFactor * overallEstModuleSize);
- int32_t alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance);
+ int32_t alignmentAreaLeftX = std::max(0, estAlignmentX - allowance);
int32_t alignmentAreaRightX =
- FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance);
+ std::min(m_image->GetWidth() - 1, estAlignmentX + allowance);
if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- int32_t alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance);
+ int32_t alignmentAreaTopY = std::max(0, estAlignmentY - allowance);
int32_t alignmentAreaBottomY =
- FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance);
+ std::min(m_image->GetHeight() - 1, estAlignmentY + allowance);
CBC_QRAlignmentPatternFinder alignmentFinder(
m_image, alignmentAreaLeftX, alignmentAreaTopY,
alignmentAreaRightX - alignmentAreaLeftX,