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

Unified Diff: xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp

Issue 1577503002: Merge to XFA: Switch most min/max macros to std::min/max. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 4 years, 11 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
« no previous file with comments | « xfa/src/fxbarcode/common/BC_CommonByteArray.cpp ('k') | xfa/src/fxbarcode/oned/BC_OneDReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
index c930f0e45d5ce64bf72e568e00b18b2dd3ebbf83..27c29afe77c75db81915f47851618405792d651e 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/BC_ResultPoint.h"
#include "xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h"
@@ -166,7 +168,7 @@ CBC_QRDetectorResult* CBC_DataMatrixDetector::Detect(int32_t& e) {
correctedTopRight.get(), dimensionTop, dimensionRight, e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
} else {
- int32_t dimension = FX_MIN(dimensionRight, dimensionTop);
+ int32_t dimension = std::min(dimensionRight, dimensionTop);
correctedTopRight = CBC_AutoPtr<CBC_ResultPoint>(
CorrectTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension));
if (correctedTopRight.get() == NULL) {
@@ -176,12 +178,12 @@ CBC_QRDetectorResult* CBC_DataMatrixDetector::Detect(int32_t& e) {
topRight = NULL;
}
int32_t dimensionCorrected =
- FX_MAX(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(
- TransitionsBetween(topLeft, correctedTopRight.get()))
- ->GetTransitions(),
- CBC_AutoPtr<CBC_ResultPointsAndTransitions>(
- TransitionsBetween(bottomRight, correctedTopRight.get()))
- ->GetTransitions());
+ std::max(CBC_AutoPtr<CBC_ResultPointsAndTransitions>(
+ TransitionsBetween(topLeft, correctedTopRight.get()))
+ ->GetTransitions(),
+ CBC_AutoPtr<CBC_ResultPointsAndTransitions>(
+ TransitionsBetween(bottomRight, correctedTopRight.get()))
+ ->GetTransitions());
dimensionCorrected++;
if ((dimensionCorrected & 0x01) == 1) {
dimensionCorrected++;
« no previous file with comments | « xfa/src/fxbarcode/common/BC_CommonByteArray.cpp ('k') | xfa/src/fxbarcode/oned/BC_OneDReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698