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

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

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 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 | « core/src/fxcodec/codec/fx_codec_flate.cpp ('k') | core/src/fxcodec/codec/fx_codec_jbig.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 da503c03fd1a09b0bbb471e9f5de33b89bd53bd4..6009b626ccc6c48513f4627b5e152a30a5ea3046 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -14,7 +14,7 @@ const FX_DWORD N_COMPONENT_RGB = 3;
const FX_DWORD N_COMPONENT_CMYK = 4;
const FX_DWORD N_COMPONENT_DEFAULT = 3;
-FX_BOOL MD5ComputeID( const void* buf, FX_DWORD dwSize, uint8_t ID[16] )
+bool MD5ComputeID( const void* buf, FX_DWORD dwSize, uint8_t ID[16] )
{
return cmsMD5computeIDExt(buf, dwSize, ID);
}
@@ -22,49 +22,49 @@ struct CLcmsCmm {
cmsHTRANSFORM m_hTransform;
int m_nSrcComponents;
int m_nDstComponents;
- FX_BOOL m_bLab;
+ bool m_bLab;
};
extern "C" {
int ourHandler(int ErrorCode, const char *ErrorText)
{
- return TRUE;
+ return true;
}
};
-FX_BOOL CheckComponents(cmsColorSpaceSignature cs, int nComponents, FX_BOOL bDst)
+bool CheckComponents(cmsColorSpaceSignature cs, int nComponents, bool bDst)
{
if (nComponents <= 0 || nComponents > 15) {
- return FALSE;
+ return false;
}
switch(cs) {
case cmsSigLabData:
if (nComponents < 3) {
- return FALSE;
+ return false;
}
break;
case cmsSigGrayData:
if (bDst && nComponents != 1) {
- return FALSE;
+ return false;
} else if (!bDst && nComponents > 2) {
- return FALSE;
+ return false;
}
break;
case cmsSigRgbData:
if (bDst && nComponents != 3) {
- return FALSE;
+ return false;
}
break;
case cmsSigCmykData:
if (bDst && nComponents != 4) {
- return FALSE;
+ return false;
}
break;
default:
if (nComponents != 3) {
- return FALSE;
+ return false;
}
break;
}
- return TRUE;
+ return true;
}
int32_t GetCSComponents(cmsColorSpaceSignature cs)
{
@@ -111,12 +111,12 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSr
return NULL;
}
int srcFormat;
- FX_BOOL bLab = FALSE;
+ bool bLab = false;
cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
nSrcComponents = GetCSComponents(srcCS);
if (srcCS == cmsSigLabData) {
srcFormat = COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
- bLab = TRUE;
+ bLab = true;
} else {
srcFormat = COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
if (srcCS == cmsSigRgbData && T_DOSWAP(dwSrcFormat)) {
@@ -124,7 +124,7 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSr
}
}
cmsColorSpaceSignature dstCS = cmsGetColorSpace(dstProfile);
- if (!CheckComponents(dstCS, nDstComponents, TRUE)) {
+ if (!CheckComponents(dstCS, nDstComponents, true)) {
cmsCloseProfile(srcProfile);
cmsCloseProfile(dstProfile);
return NULL;
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_flate.cpp ('k') | core/src/fxcodec/codec/fx_codec_jbig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698