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

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

Issue 2048983002: Get rid of NULLs in xfa/fxbarcode/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 4 years, 6 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/fxbarcode/qrcode/BC_QRDetector.cpp ('k') | xfa/fxbarcode/qrcode/BC_QRGridSampler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
diff --git a/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp b/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
index dc63131d01d9ae688255a29c006adbeb6e12347c..5ceeefac539bd41dd9ed2b120bdde832aa6e6108 100644
--- a/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
@@ -166,7 +166,7 @@ CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(int32_t hint,
}
std::unique_ptr<CFX_ArrayTemplate<CBC_QRFinderPattern*>> patternInfo(
SelectBestpatterns(e));
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
OrderBestPatterns(patternInfo.get());
return new CBC_QRFinderPatternInfo(patternInfo.get());
}
@@ -400,18 +400,17 @@ int32_t CBC_QRFinderPatternFinder::FindRowSkip() {
if (max <= 1) {
return 0;
}
- FinderPattern* firstConfirmedCenter = NULL;
+ FinderPattern* firstConfirmedCenter = nullptr;
for (int32_t i = 0; i < max; i++) {
CBC_QRFinderPattern* center = m_possibleCenters[i];
if (center->GetCount() >= CENTER_QUORUM) {
- if (firstConfirmedCenter == NULL) {
- firstConfirmedCenter = center;
- } else {
+ if (firstConfirmedCenter) {
m_hasSkipped = TRUE;
return (int32_t)((fabs(firstConfirmedCenter->GetX() - center->GetX()) -
fabs(firstConfirmedCenter->GetY() - center->GetY())) /
2);
}
+ firstConfirmedCenter = center;
}
}
return 0;
@@ -445,7 +444,7 @@ CBC_QRFinderPatternFinder::SelectBestpatterns(int32_t& e) {
int32_t startSize = m_possibleCenters.GetSize();
if (m_possibleCenters.GetSize() < 3) {
e = BCExceptionRead;
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
}
FX_FLOAT average = 0.0f;
if (startSize > 3) {
« no previous file with comments | « xfa/fxbarcode/qrcode/BC_QRDetector.cpp ('k') | xfa/fxbarcode/qrcode/BC_QRGridSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698