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

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

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase 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/fxcodec/codec/fx_codec_flate.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpeg.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_icc.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp
index 862872010be25e09535d535a25f658f733e8f504..7ae59a651026500ef1b2ef6fa8c47493b7a6fdae 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -102,16 +102,16 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData,
CLcmsCmm* pCmm = NULL;
nSrcComponents = 0;
srcProfile = cmsOpenProfileFromMem((void*)pSrcProfileData, dwSrcProfileSize);
- if (srcProfile == NULL) {
+ if (!srcProfile) {
return NULL;
}
- if (pDstProfileData == NULL && dwDstProfileSize == 0 && nDstComponents == 3) {
+ if (!pDstProfileData && dwDstProfileSize == 0 && nDstComponents == 3) {
dstProfile = cmsCreate_sRGBProfile();
} else {
dstProfile =
cmsOpenProfileFromMem((void*)pDstProfileData, dwDstProfileSize);
}
- if (dstProfile == NULL) {
+ if (!dstProfile) {
cmsCloseProfile(srcProfile);
return NULL;
}
@@ -153,7 +153,7 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData,
default:
break;
}
- if (hTransform == NULL) {
+ if (!hTransform) {
cmsCloseProfile(srcProfile);
cmsCloseProfile(dstProfile);
return NULL;
@@ -176,7 +176,7 @@ void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData,
0, 3, intent, dwSrcFormat);
}
void IccLib_DestroyTransform(void* pTransform) {
- if (pTransform == NULL) {
+ if (!pTransform) {
return;
}
cmsDeleteTransform(((CLcmsCmm*)pTransform)->m_hTransform);
@@ -186,7 +186,7 @@ void IccLib_Translate(void* pTransform,
FX_DWORD nSrcComponents,
FX_FLOAT* pSrcValues,
FX_FLOAT* pDestValues) {
- if (pTransform == NULL) {
+ if (!pTransform) {
return;
}
CLcmsCmm* p = (CLcmsCmm*)pTransform;
@@ -242,7 +242,7 @@ void* CreateProfile_Gray(double gamma) {
return NULL;
}
cmsToneCurve* curve = cmsBuildGamma(NULL, gamma);
- if (curve == NULL) {
+ if (!curve) {
return NULL;
}
void* profile = cmsCreateGrayProfile(D50, curve);
@@ -250,7 +250,7 @@ void* CreateProfile_Gray(double gamma) {
return profile;
}
ICodec_IccModule::IccCS GetProfileCSFromHandle(void* pProfile) {
- if (pProfile == NULL) {
+ if (!pProfile) {
return ICodec_IccModule::IccCS_Unknown;
}
switch (cmsGetColorSpace(pProfile)) {
@@ -286,7 +286,7 @@ ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(
ICodec_IccModule::IccCS cs;
cmsHPROFILE hProfile =
cmsOpenProfileFromMem((void*)pProfileData, dwProfileSize);
- if (hProfile == NULL) {
+ if (!hProfile) {
return IccCS_Unknown;
}
cs = GetProfileCSFromHandle(hProfile);
@@ -296,7 +296,7 @@ ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(
return cs;
}
ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(IFX_FileRead* pFile) {
- if (pFile == NULL) {
+ if (!pFile) {
return IccCS_Unknown;
}
ICodec_IccModule::IccCS cs;
@@ -476,11 +476,11 @@ void* CCodec_IccModule::CreateTransform(
ASSERT(pInputParam && pOutputParam);
CFX_ByteStringKey key;
void* pInputProfile = CreateProfile(pInputParam, Icc_CLASS_INPUT, &key);
- if (pInputProfile == NULL) {
+ if (!pInputProfile) {
return NULL;
}
void* pOutputProfile = CreateProfile(pOutputParam, Icc_CLASS_OUTPUT, &key);
- if (pOutputProfile == NULL) {
+ if (!pOutputProfile) {
return NULL;
}
FX_DWORD dwInputProfileType =
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_flate.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698