summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-28 09:35:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-28 09:35:49 -0700
commit71ba5883dd00145b2256935635492cbcc8d94bac (patch)
tree5b9a47d819d86ac820b867a333d35080e365f3f4
parent605c9f71d33540ba99983d89ac79b2ca250fc730 (diff)
downloadpdfium-71ba5883dd00145b2256935635492cbcc8d94bac.tar.xz
Fix more FX_BOOL / int noise in core/fpdfsdk
Review-Url: https://codereview.chromium.org/2454263002
-rw-r--r--core/fxcodec/codec/ccodec_jpegmodule.h2
-rw-r--r--core/fxcodec/codec/fx_codec_jpeg.cpp6
-rw-r--r--core/fxge/win32/fx_win32_device.cpp4
-rw-r--r--core/fxge/win32/fx_win32_gdipext.cpp2
-rw-r--r--fpdfsdk/javascript/Document.cpp2
5 files changed, 8 insertions, 8 deletions
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 {
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 0c2e3f7399..ea489c993b 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -733,7 +733,7 @@ FX_BOOL Document::mailDoc(IJS_Context* cc,
v8::Local<v8::Object> pObj = params[0].ToV8Object(pRuntime);
v8::Local<v8::Value> pValue = pRuntime->GetObjectProperty(pObj, L"bUI");
- bUI = CJS_Value(pRuntime, pValue).ToInt(pRuntime);
+ bUI = CJS_Value(pRuntime, pValue).ToBool(pRuntime);
pValue = pRuntime->GetObjectProperty(pObj, L"cTo");
cTo = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime);