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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRCoder.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
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp ('k') | xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
index ab370f88424b0ee97146493f6463b77f39be19c0..be46f2dec50d37274fa66ced1a736c58b764391a 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
@@ -39,19 +39,7 @@ CBC_QRCoder::CBC_QRCoder() {
m_matrix = NULL;
}
CBC_QRCoder::~CBC_QRCoder() {
- if (m_matrix != NULL) {
- delete m_matrix;
- m_matrix = NULL;
- }
- m_mode = NULL;
- m_ecLevel = NULL;
- m_version = -1;
- m_matrixWidth = -1;
- m_maskPattern = -1;
- m_numTotalBytes = -1;
- m_numDataBytes = -1;
- m_numECBytes = -1;
- m_numRSBlocks = -1;
+ delete m_matrix;
}
CBC_QRCoderMode* CBC_QRCoder::GetMode() {
return m_mode;
@@ -92,11 +80,11 @@ int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t& e) {
return value;
}
FX_BOOL CBC_QRCoder::IsValid() {
- return m_mode != NULL && m_ecLevel != NULL && m_version != -1 &&
- m_matrixWidth != -1 && m_maskPattern != -1 && m_numTotalBytes != -1 &&
- m_numDataBytes != -1 && m_numECBytes != -1 && m_numRSBlocks != -1 &&
+ return m_mode && m_ecLevel && m_version != -1 && m_matrixWidth != -1 &&
+ m_maskPattern != -1 && m_numTotalBytes != -1 && m_numDataBytes != -1 &&
+ m_numECBytes != -1 && m_numRSBlocks != -1 &&
IsValidMaskPattern(m_maskPattern) &&
- m_numTotalBytes == m_numDataBytes + m_numECBytes && m_matrix != NULL &&
+ m_numTotalBytes == m_numDataBytes + m_numECBytes && m_matrix &&
m_matrixWidth == m_matrix->GetWidth() &&
m_matrix->GetWidth() == m_matrix->GetHeight();
}
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp ('k') | xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698