diff options
author | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
commit | 97da97662417085774f75c26e535c6fbe70266ae (patch) | |
tree | 9654be693dfb20b49be80911fa8089ff319757f3 /core/src/fxge | |
parent | 55265016faac358266af280db6c62afa34ce2891 (diff) | |
download | pdfium-97da97662417085774f75c26e535c6fbe70266ae.tar.xz |
Re-enable MSVC warning 4800 for compiling with chromium_code
Mainly change the code to avoid the warnings; in a few cases we have
to use explicit casts.
BUG=pdfium:29
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1783023002 .
Diffstat (limited to 'core/src/fxge')
-rw-r--r-- | core/src/fxge/agg/fx_agg_driver.cpp | 30 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 11 |
2 files changed, 21 insertions, 20 deletions
diff --git a/core/src/fxge/agg/fx_agg_driver.cpp b/core/src/fxge/agg/fx_agg_driver.cpp index 16cf705585..2f376b2b19 100644 --- a/core/src/fxge/agg/fx_agg_driver.cpp +++ b/core/src/fxge/agg/fx_agg_driver.cpp @@ -1799,37 +1799,37 @@ CFX_FxgeDevice::CFX_FxgeDevice() { m_bOwnedBitmap = FALSE; } -FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, - int dither_bits, - FX_BOOL bRgbByteOrder, - CFX_DIBitmap* pOriDevice, - FX_BOOL bGroupKnockout) { +bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, + int dither_bits, + bool bRgbByteOrder, + CFX_DIBitmap* pOriDevice, + bool bGroupKnockout) { if (!pBitmap) { - return FALSE; + return false; } SetBitmap(pBitmap); IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver( pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout); SetDeviceDriver(pDriver); - return TRUE; + return true; } -FX_BOOL CFX_FxgeDevice::Create(int width, - int height, - FXDIB_Format format, - int dither_bits, - CFX_DIBitmap* pOriDevice) { - m_bOwnedBitmap = TRUE; +bool CFX_FxgeDevice::Create(int width, + int height, + FXDIB_Format format, + int dither_bits, + CFX_DIBitmap* pOriDevice) { + m_bOwnedBitmap = true; CFX_DIBitmap* pBitmap = new CFX_DIBitmap; if (!pBitmap->Create(width, height, format)) { delete pBitmap; - return FALSE; + return false; } SetBitmap(pBitmap); IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); SetDeviceDriver(pDriver); - return TRUE; + return true; } CFX_FxgeDevice::~CFX_FxgeDevice() { diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index cd46148b7f..2ad1e5c9de 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -387,19 +387,20 @@ int32_t GetSimilarValue(int weight, int pitch_family, FX_DWORD style) { int32_t iSimilarValue = 0; - if ((style & FXFONT_BOLD) == (weight > 400)) { + if (!!(style & FXFONT_BOLD) == (weight > 400)) { iSimilarValue += 16; } - if ((style & FXFONT_ITALIC) == bItalic) { + if (!!(style & FXFONT_ITALIC) == bItalic) { iSimilarValue += 16; } - if ((style & FXFONT_SERIF) == (pitch_family & FXFONT_FF_ROMAN)) { + if (!!(style & FXFONT_SERIF) == !!(pitch_family & FXFONT_FF_ROMAN)) { iSimilarValue += 16; } - if ((style & FXFONT_SCRIPT) == (pitch_family & FXFONT_FF_SCRIPT)) { + if (!!(style & FXFONT_SCRIPT) == !!(pitch_family & FXFONT_FF_SCRIPT)) { iSimilarValue += 8; } - if ((style & FXFONT_FIXED_PITCH) == (pitch_family & FXFONT_FF_FIXEDPITCH)) { + if (!!(style & FXFONT_FIXED_PITCH) == + !!(pitch_family & FXFONT_FF_FIXEDPITCH)) { iSimilarValue += 8; } return iSimilarValue; |