summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-23 21:59:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-23 21:59:33 +0000
commita41801ee0e7c0d76feca2dfe20103d8b82391026 (patch)
treea50ee9dd4eeecd123ad03258898dee549b78d506 /core
parent3a3a3690bc4c0b8d50756014dbe2ea85f3075fdc (diff)
downloadpdfium-a41801ee0e7c0d76feca2dfe20103d8b82391026.tar.xz
Fix GCC build with V8 disabled.
- Remove set, but otherwise unused variables. - Mark some pdfium_test code as V8-enabled only. - Do not build one unit test with GCC. Change-Id: I3f04273a7731086e08386478a62769bf06f6d8a4 Reviewed-on: https://pdfium-review.googlesource.com/41271 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp9
-rw-r--r--core/fxcrt/fx_memory_unittest.cpp2
2 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
index 6f6aa7c404..1f43abec6e 100644
--- a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
+++ b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
@@ -49,12 +49,9 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext,
m_Matrix.Scale(1.0f, (float)(max_dpi) / (float)dpiv);
}
m_pBitmapDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
- FXDIB_Format dibFormat = FXDIB_Rgb;
- int32_t bpp = 24;
- if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT) {
- dibFormat = FXDIB_Argb;
- bpp = 32;
- }
+ bool bIsAlpha =
+ !!(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT);
+ FXDIB_Format dibFormat = bIsAlpha ? FXDIB_Argb : FXDIB_Rgb;
while (1) {
FX_RECT bitmap_rect =
m_Matrix.TransformRect(CFX_FloatRect(pRect)).GetOuterRect();
diff --git a/core/fxcrt/fx_memory_unittest.cpp b/core/fxcrt/fx_memory_unittest.cpp
index 2856bb9592..8036855898 100644
--- a/core/fxcrt/fx_memory_unittest.cpp
+++ b/core/fxcrt/fx_memory_unittest.cpp
@@ -59,6 +59,7 @@ TEST(fxcrt, DISABLED_FX_TryAllocOOM) {
FX_Free(ptr);
}
+#if !defined(__GNUC__)
TEST(fxcrt, FX_TryAllocOverflow) {
// |ptr| needs to be defined and used to avoid Clang optimizes away the
// calloc() statement overzealously for optimized builds.
@@ -70,6 +71,7 @@ TEST(fxcrt, FX_TryAllocOverflow) {
EXPECT_FALSE(FX_TryRealloc(int, ptr, kOverflowIntAlloc));
FX_Free(ptr);
}
+#endif
TEST(fxcrt, DISABLED_FXMEM_DefaultOOM) {
EXPECT_FALSE(FXMEM_DefaultAlloc(kMaxByteAlloc));