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

Unified Diff: core/src/fxcodec/codec/fx_codec_jpeg.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 years 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 | « core/src/fpdfdoc/doc_vt.cpp ('k') | core/src/fxcrt/fx_basic_bstring.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/codec/fx_codec_jpeg.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index 1bee5e774aeb7d31653b2a6e6d0245487335a57d..730872363c2df07d3b9263330f954c8552d26f9a 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -282,10 +282,10 @@ static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf,
color_transform =
cinfo.jpeg_color_space == JCS_YCbCr || cinfo.jpeg_color_space == JCS_YCCK;
bits_per_components = cinfo.data_precision;
- if (icc_buf_ptr != NULL) {
+ if (icc_buf_ptr) {
*icc_buf_ptr = NULL;
}
- if (icc_length != NULL) {
+ if (icc_length) {
*icc_length = 0;
}
jpeg_destroy_decompress(&cinfo);
@@ -531,7 +531,7 @@ FX_BOOL CCodec_JpegModule::Encode(const CFX_DIBSource* pSource,
int quality,
const uint8_t* icc_buf,
FX_DWORD icc_length) {
- if (pSource->GetBPP() < 8 || pSource->GetPalette() != NULL) {
+ if (pSource->GetBPP() < 8 || pSource->GetPalette()) {
ASSERT(pSource->GetBPP() >= 8 && pSource->GetPalette() == NULL);
return FALSE;
}
@@ -655,7 +655,7 @@ FX_BOOL CCodec_JpegModule::ReadScanline(void* pContext,
}
FX_DWORD CCodec_JpegModule::GetAvailInput(void* pContext,
uint8_t** avail_buf_ptr) {
- if (avail_buf_ptr != NULL) {
+ if (avail_buf_ptr) {
*avail_buf_ptr = NULL;
if (((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) {
*avail_buf_ptr =
« no previous file with comments | « core/src/fpdfdoc/doc_vt.cpp ('k') | core/src/fxcrt/fx_basic_bstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698