summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-09 18:39:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-09 18:39:33 -0700
commit6dc1d7753691c0ff2f390e8ffd95a3182064487e (patch)
tree43d77664973a76c107832ae7b3c3e0f04bba1fe0 /xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
parentfcf61b39ee597c73e80ba789833fb7fe49878422 (diff)
downloadpdfium-6dc1d7753691c0ff2f390e8ffd95a3182064487e.tar.xz
Get rid of NULLs in xfa/fxbarcode/
Review-Url: https://codereview.chromium.org/2048983002
Diffstat (limited to 'xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp')
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp b/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp
index dc63131d01..5ceeefac53 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) {