From 71ba5883dd00145b2256935635492cbcc8d94bac Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 28 Oct 2016 09:35:49 -0700 Subject: Fix more FX_BOOL / int noise in core/fpdfsdk Review-Url: https://codereview.chromium.org/2454263002 --- core/fxcodec/codec/ccodec_jpegmodule.h | 2 +- core/fxcodec/codec/fx_codec_jpeg.cpp | 6 +++--- core/fxge/win32/fx_win32_device.cpp | 4 ++-- core/fxge/win32/fx_win32_gdipext.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/fxcodec/codec/ccodec_jpegmodule.h b/core/fxcodec/codec/ccodec_jpegmodule.h index 74071347cb..225fd98467 100644 --- a/core/fxcodec/codec/ccodec_jpegmodule.h +++ b/core/fxcodec/codec/ccodec_jpegmodule.h @@ -53,7 +53,7 @@ class CCodec_JpegModule { CFX_DIBAttribute* pAttribute); #endif // PDF_ENABLE_XFA - int StartScanline(FXJPEG_Context* pContext, int down_scale); + FX_BOOL StartScanline(FXJPEG_Context* pContext, int down_scale); FX_BOOL ReadScanline(FXJPEG_Context* pContext, uint8_t* dest_buf); uint32_t GetAvailInput(FXJPEG_Context* pContext, uint8_t** avail_buf_ptr); }; diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index 7670516a25..49b0aca3b8 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -449,12 +449,12 @@ int CCodec_JpegModule::ReadHeader(FXJPEG_Context* ctx, return 0; } -int CCodec_JpegModule::StartScanline(FXJPEG_Context* ctx, int down_scale) { +FX_BOOL CCodec_JpegModule::StartScanline(FXJPEG_Context* ctx, int down_scale) { if (setjmp(ctx->m_JumpMark) == -1) - return 0; + return FALSE; ctx->m_Info.scale_denom = down_scale; - return jpeg_start_decompress(&ctx->m_Info); + return !!jpeg_start_decompress(&ctx->m_Info); } FX_BOOL CCodec_JpegModule::ReadScanline(FXJPEG_Context* ctx, diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 0ef7829549..900828c3fc 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -933,7 +933,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(CFX_DIBitmap* pBitmap1, } FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { - return ::GetClipBox(m_hDC, (RECT*)pRect); + return !!(::GetClipBox(m_hDC, (RECT*)pRect)); } void* CGdiDeviceDriver::GetPlatformSurface() const { @@ -1137,7 +1137,7 @@ FX_BOOL CGdiDeviceDriver::SetClip_PathStroke( SetPathToDC(m_hDC, pPathData, pMatrix); WidenPath(m_hDC); SetPolyFillMode(m_hDC, WINDING); - FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND); + FX_BOOL ret = !!SelectClipPath(m_hDC, RGN_AND); hPen = (HPEN)SelectObject(m_hDC, hPen); DeleteObject(hPen); return ret; diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 2d19808517..927f0a32e2 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -1233,7 +1233,7 @@ FX_BOOL CGdiplusExt::DrawPath(HDC hDC, } if (pGraphState && stroke_argb) { GpPen* pPen = _GdipCreatePen(pGraphState, pObject2Device, stroke_argb, - fill_mode & FX_STROKE_TEXT_MODE); + !!(fill_mode & FX_STROKE_TEXT_MODE)); if (nSubPathes == 1) { CallFunc(GdipDrawPath)(pGraphics, pPen, pGpPath); } else { -- cgit v1.2.3