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

Unified Diff: xfa/fxbarcode/qrcode/BC_QRDetector.cpp

Issue 2000073003: Clean up more XFA code which causes warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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
Index: xfa/fxbarcode/qrcode/BC_QRDetector.cpp
diff --git a/xfa/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/fxbarcode/qrcode/BC_QRDetector.cpp
index 15ae3e26f1b53301773efaad91dda61b3c0d0d4c..35915cd6735699ae69ae0472ccba49aaaeb847f4 100644
--- a/xfa/fxbarcode/qrcode/BC_QRDetector.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRDetector.cpp
@@ -56,17 +56,17 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(
CalculateModuleSize(topLeft.get(), topRight.get(), bottomLeft.get());
if (moduleSize < 1.0f) {
e = BCExceptionRead;
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ return nullptr;
}
int32_t dimension = ComputeDimension(topLeft.get(), topRight.get(),
bottomLeft.get(), moduleSize, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
CBC_QRCoderVersion* provisionalVersion =
CBC_QRCoderVersion::GetProvisionalVersionForDimension(dimension, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
int32_t modulesBetweenFPCenters =
provisionalVersion->GetDimensionForVersion() - 7;
- CBC_QRAlignmentPattern* alignmentPattern = NULL;
+ CBC_QRAlignmentPattern* alignmentPattern = nullptr;
if (provisionalVersion->GetAlignmentPatternCenters()->GetSize() > 0) {
FX_FLOAT bottomRightX =
topRight->GetX() - topLeft->GetX() + bottomLeft->GetX();
@@ -83,8 +83,10 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(
for (int32_t i = 4; i <= 16; i <<= 1) {
CBC_QRAlignmentPattern* temp = FindAlignmentInRegion(
moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT)i, e);
- alignmentPattern = temp;
- break;
+ if (temp) {
+ alignmentPattern = temp;
+ break;
+ }
}
}
CBC_CommonBitMatrix* bits =

Powered by Google App Engine
This is Rietveld 408576698