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

Unified Diff: xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.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
Index: xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
index 79754b020e56f7e2a407809dad934afa7c90f043..931a83163c5c6a87353645436b39d9fb0ad0346c 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
@@ -122,9 +122,9 @@ int32_t CBC_DetectionResult::adjustRowNumbers() {
m_detectionResultColumns[barcodeColumn]->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
if (!codewords->GetAt(codewordsRow)->hasValidRowNumber()) {
adjustRowNumbers(barcodeColumn, codewordsRow, codewords);
}
@@ -180,9 +180,9 @@ int32_t CBC_DetectionResult::adjustRowNumbersFromRRI() {
m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1)->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
int32_t rowIndicatorRowNumber =
codewords->GetAt(codewordsRow)->getRowNumber();
int32_t invalidRowCounts = 0;
@@ -204,17 +204,17 @@ int32_t CBC_DetectionResult::adjustRowNumbersFromRRI() {
return unadjustedCount;
}
int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() {
- if (m_detectionResultColumns[0] == NULL) {
+ if (!m_detectionResultColumns[0])
return 0;
- }
+
int32_t unadjustedCount = 0;
CFX_ArrayTemplate<CBC_Codeword*>* codewords =
m_detectionResultColumns.GetAt(0)->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
int32_t rowIndicatorRowNumber =
codewords->GetAt(codewordsRow)->getRowNumber();
int32_t invalidRowCounts = 0;
@@ -239,9 +239,9 @@ int32_t CBC_DetectionResult::adjustRowNumberIfValid(
int32_t rowIndicatorRowNumber,
int32_t invalidRowCounts,
CBC_Codeword* codeword) {
- if (codeword == NULL) {
+ if (!codeword)
return invalidRowCounts;
- }
+
if (!codeword->hasValidRowNumber()) {
if (codeword->isValidRowNumber(rowIndicatorRowNumber)) {
codeword->setRowNumber(rowIndicatorRowNumber);
@@ -298,9 +298,9 @@ void CBC_DetectionResult::adjustRowNumbers(
}
FX_BOOL CBC_DetectionResult::adjustRowNumber(CBC_Codeword* codeword,
CBC_Codeword* otherCodeword) {
- if (otherCodeword == NULL) {
+ if (!otherCodeword)
return FALSE;
- }
+
if (otherCodeword->hasValidRowNumber() &&
otherCodeword->getBucket() == codeword->getBucket()) {
codeword->setRowNumber(otherCodeword->getRowNumber());
« no previous file with comments | « xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698