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

Unified Diff: core/include/fxge/fx_dib.h

Issue 1405723003: Sanity check the values of TRUE and FALSE. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 2 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: core/include/fxge/fx_dib.h
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index 818aaac5209adbd867aee6ca91b5cc81bd1ccd33..66ff1304b069d887b971252bae6e6b485e0adec3 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -198,11 +198,11 @@ class CFX_DIBSource {
FX_BOOL IsAlphaMask() const { return m_AlphaFlag == 1; }
Tom Sepez 2015/10/15 17:08:31 This one feels wrong. If its a mask, all bits sho
Lei Zhang 2015/10/19 08:56:18 I looked at this briefly and added comments. With
- FX_BOOL HasAlpha() const { return m_AlphaFlag & 2 ? TRUE : FALSE; }
+ FX_BOOL HasAlpha() const { return m_AlphaFlag & 2; }
Tom Sepez 2015/10/15 17:08:31 Actually, what you want is { return !!(m_AlphaFlag
Lei Zhang 2015/10/19 08:56:18 Done.
FX_BOOL IsOpaqueImage() const { return !(m_AlphaFlag & 3); }
- FX_BOOL IsCmykImage() const { return m_AlphaFlag & 4 ? TRUE : FALSE; }
+ FX_BOOL IsCmykImage() const { return m_AlphaFlag & 4; }
int GetPaletteSize() const {
return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0));

Powered by Google App Engine
This is Rietveld 408576698