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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase 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/qrcode/BC_QRBitMatrixParser.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
index d4d0cb6148f4c8697f0ee07dbbbb1c0f4e4fbc99..d44995385abbd68062a49c7d0dbdcc02b9ce2a82 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
@@ -41,15 +41,11 @@ void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix* bitMatrix, int32_t& e) {
m_version = NULL;
}
CBC_QRBitMatrixParser::~CBC_QRBitMatrixParser() {
- if (m_parsedFormatInfo != NULL) {
- delete m_parsedFormatInfo;
- m_parsedFormatInfo = NULL;
- }
- m_version = NULL;
+ delete m_parsedFormatInfo;
}
CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
int32_t& e) {
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
int32_t formatInfoBits = 0;
@@ -65,7 +61,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
}
m_parsedFormatInfo =
CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
int32_t dimension = m_bitMatrix->GetDimension(e);
@@ -80,7 +76,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
}
m_parsedFormatInfo =
CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
e = BCExceptionRead;
@@ -88,7 +84,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
return NULL;
}
CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
- if (m_version != NULL) {
+ if (m_version) {
return m_version;
}
int32_t dimension = m_bitMatrix->GetDimension(e);
@@ -109,7 +105,7 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
}
m_version = CBC_QRCoderVersion::DecodeVersionInformation(versionBits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- if (m_version != NULL && m_version->GetDimensionForVersion() == dimension) {
+ if (m_version && m_version->GetDimensionForVersion() == dimension) {
return m_version;
}
versionBits = 0;
@@ -121,7 +117,7 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
}
m_version = CBC_QRCoderVersion::DecodeVersionInformation(versionBits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- if (m_version != NULL && m_version->GetDimensionForVersion() == dimension) {
+ if (m_version && m_version->GetDimensionForVersion() == dimension) {
return m_version;
}
e = BCExceptionRead;
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp ('k') | xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698