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

Unified Diff: xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 10 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/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
index df36e3092625cbf7b28111dffb47ce01ebbe97c1..4e64b17da4ccabf440469df30fb31e6c84a1feb3 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
@@ -68,12 +68,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn = NULL;
CBC_DetectionResult* detectionResult = NULL;
for (int32_t i = 0; i < 2; i++) {
- if (imageTopLeft != NULL) {
+ if (imageTopLeft) {
leftRowIndicatorColumn =
getRowIndicatorColumn(image, boundingBox, *imageTopLeft, TRUE,
minCodewordWidth, maxCodewordWidth);
}
- if (imageTopRight != NULL) {
+ if (imageTopRight) {
rightRowIndicatorColumn =
getRowIndicatorColumn(image, boundingBox, *imageTopRight, FALSE,
minCodewordWidth, maxCodewordWidth);
@@ -106,7 +106,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
barcodeColumnCount++) {
int32_t barcodeColumn = leftToRight ? barcodeColumnCount
: maxBarcodeColumn - barcodeColumnCount;
- if (detectionResult->getDetectionResultColumn(barcodeColumn) != NULL) {
+ if (detectionResult->getDetectionResultColumn(barcodeColumn)) {
continue;
}
CBC_DetectionResultColumn* detectionResultColumn = NULL;
@@ -133,7 +133,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
CBC_Codeword* codeword = detectCodeword(
image, boundingBox->getMinX(), boundingBox->getMaxX(), leftToRight,
startColumn, imageRow, minCodewordWidth, maxCodewordWidth);
- if (codeword != NULL) {
+ if (codeword) {
detectionResultColumn->setCodeword(imageRow, codeword);
previousStartColumn = startColumn;
minCodewordWidth = minCodewordWidth < codeword->getWidth()
@@ -308,7 +308,7 @@ CBC_PDF417ScanningDecoder::getRowIndicatorColumn(CBC_CommonBitMatrix* image,
CBC_Codeword* codeword =
detectCodeword(image, 0, image->GetWidth(), leftToRight, startColumn,
imageRow, minCodewordWidth, maxCodewordWidth);
- if (codeword != NULL) {
+ if (codeword) {
rowIndicatorColumn->setCodeword(imageRow, codeword);
if (leftToRight) {
startColumn = codeword->getStartX();
@@ -513,19 +513,19 @@ int32_t CBC_PDF417ScanningDecoder::getStartColumn(
codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)
->getCodeword(imageRow);
}
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getEndX() : codeword->getStartX();
}
codeword = detectionResult->getDetectionResultColumn(barcodeColumn)
->getCodewordNearby(imageRow);
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getStartX() : codeword->getEndX();
}
if (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) {
codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)
->getCodewordNearby(imageRow);
}
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getEndX() : codeword->getStartX();
}
int32_t skippedColumns = 0;
@@ -541,7 +541,7 @@ int32_t CBC_PDF417ScanningDecoder::getStartColumn(
barcodeColumn)
->getCodewords()
->GetAt(i);
- if (previousRowCodeword != NULL) {
+ if (previousRowCodeword) {
return (leftToRight ? previousRowCodeword->getEndX()
: previousRowCodeword->getStartX()) +
offset * skippedColumns * (previousRowCodeword->getEndX() -

Powered by Google App Engine
This is Rietveld 408576698