summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn103
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp4
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp3
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp4
-rw-r--r--pdfium.gyp14
5 files changed, 44 insertions, 84 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 87405575c7..8c7e30cf03 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -48,8 +48,22 @@ config("pdfium_config") {
"/wd4146",
"/wd4333",
"/wd4345",
+ "/wd4267",
+ # TODO(thestig): Fix all instances, remove this, pdfium:29
+ "/wd4245",
+ "/wd4310",
+ "/wd4389",
+ "/wd4701",
+ "/wd4702",
+ "/wd4706",
+ "/wd4800",
]
}
+
+ if (is_clang) {
+ # TODO(thestig): Fix all instances, remove this, pdfium:29
+ cflags += [ "-Wno-sign-compare" ]
+ }
}
static_library("pdfium") {
@@ -97,11 +111,7 @@ static_library("pdfium") {
]
libs = []
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
deps = [
"third_party:bigint",
@@ -172,11 +182,7 @@ source_set("test_support") {
"//v8/include",
]
}
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
# Targets below this are only visible within this file (and to the
@@ -193,11 +199,7 @@ static_library("fdrm") {
"core/src/fdrm/crypto/fx_crypt_aes.cpp",
"core/src/fdrm/crypto/fx_crypt_sha.cpp",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fpdfdoc") {
@@ -226,11 +228,7 @@ static_library("fpdfdoc") {
"core/src/fpdfdoc/pdf_vt.h",
"core/src/fpdfdoc/tagged_int.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fpdfapi") {
@@ -346,11 +344,7 @@ static_library("fpdfapi") {
"core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp",
"core/src/fpdfapi/fpdf_render/render_int.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fpdftext") {
@@ -365,11 +359,7 @@ static_library("fpdftext") {
"core/src/fpdftext/unicodenormalizationdata.cpp",
"core/src/fpdftext/unicodenormalizationdata.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fxcodec") {
@@ -443,17 +433,13 @@ static_library("fxcodec") {
"core/src/fxcodec/lgif/fx_gif.cpp",
"core/src/fxcodec/lgif/fx_gif.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
if (is_posix) {
# core/src/fxcodec/fx_libopenjpeg/src/fx_mct.c does an pointer-to-int
# conversion to check that an address is 16-bit aligned (benign).
cflags_c = [ "-Wno-pointer-to-int-cast" ]
}
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
config("fxge_warnings") {
@@ -509,11 +495,7 @@ static_library("fxcrt") {
"core/src/fxcrt/plex.h",
"core/src/fxcrt/xml_int.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fxge") {
@@ -579,12 +561,9 @@ static_library("fxge") {
"core/src/fxge/ge/text_int.h",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- # Must be after no_chromium_code for warning flags to be ordered correctly.
":fxge_warnings",
+ ":pdfium_config",
]
if (pdf_use_skia) {
@@ -634,11 +613,7 @@ static_library("fxedit") {
"fpdfsdk/src/fxedit/fxet_module.cpp",
"fpdfsdk/src/fxedit/fxet_pageobjs.cpp",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("pdfwindow") {
@@ -680,11 +655,7 @@ static_library("pdfwindow") {
"fpdfsdk/src/pdfwindow/PWL_Utils.cpp",
"fpdfsdk/src/pdfwindow/PWL_Wnd.cpp",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("javascript") {
@@ -745,11 +716,7 @@ static_library("javascript") {
} else {
sources += [ "fpdfsdk/src/javascript/JS_Runtime_Stub.cpp" ]
}
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("formfiller") {
@@ -774,11 +741,7 @@ static_library("formfiller") {
"fpdfsdk/src/formfiller/FFL_RadioButton.cpp",
"fpdfsdk/src/formfiller/FFL_TextField.cpp",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
static_library("fpdfxfa") {
@@ -1498,11 +1461,7 @@ test("pdfium_unittests") {
":test_support",
]
include_dirs = [ "." ]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
test("pdfium_embeddertests") {
@@ -1546,9 +1505,5 @@ test("pdfium_embeddertests") {
"//v8/include",
]
}
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- ":pdfium_config",
- "//build/config/compiler:no_chromium_code",
- ]
+ configs += [ ":pdfium_config" ]
}
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 93c2fd6836..a32f9ade78 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -358,7 +358,7 @@ void* CFX_Win32FontInfo::MapFont(int weight,
OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face);
char facebuf[100];
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, hFont);
- int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
+ ::GetTextFaceA(m_hDC, 100, facebuf);
::SelectObject(m_hDC, hOldFont);
if (face.EqualNoCase(facebuf)) {
return hFont;
@@ -536,7 +536,6 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1,
return FALSE;
}
int width = pSrcRect->Width(), height = pSrcRect->Height();
- int pitch = pBitmap->GetPitch();
LPBYTE pBuffer = pBitmap->GetBuffer();
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
((BITMAPINFOHEADER*)info.c_str())->biHeight *= -1;
@@ -556,7 +555,6 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1,
return FALSE;
}
int width = pSrcRect->Width(), height = pSrcRect->Height();
- int pitch = pBitmap->GetPitch();
LPBYTE pBuffer = pBitmap->GetBuffer();
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
::SetDIBitsToDevice(m_hDC, left, top, width, height, pSrcRect->left,
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index 4beef9a177..42f8a4a29f 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -482,9 +482,6 @@ static CFX_DIBitmap* _StretchMonoToGray(int dest_width,
LPBYTE dest_buf = pStretched->GetBuffer();
int src_width = pSource->GetWidth();
int src_height = pSource->GetHeight();
- int src_count = src_width * src_height;
- int dest_count = dest_width * dest_height;
- int ratio = 255 * dest_count / src_count;
int y_unit = src_height / dest_height;
int x_unit = src_width / dest_width;
int area_unit = y_unit * x_unit;
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index 18fe1eb6fa..0f75d493a4 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -138,8 +138,6 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc,
pSrc->GetFormat() == FXDIB_1bppCmyk);
CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
FX_RECT full_rect = unit_rect.GetOutterRect();
- int full_left = full_rect.left;
- int full_top = full_rect.top;
CFX_DIBExtractor src_bitmap(pSrc);
CFX_DIBitmap* pSrcBitmap = src_bitmap;
if (pSrcBitmap == NULL) {
@@ -297,7 +295,7 @@ void CPSOutput::OutputPS(const FX_CHAR* string, int len) {
int send_len = len > 1024 ? 1024 : len;
*(FX_WORD*)m_pBuf = send_len;
FXSYS_memcpy(m_pBuf + 2, string + sent_len, send_len);
- int ret = ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL);
+ ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL);
sent_len += send_len;
len -= send_len;
}
diff --git a/pdfium.gyp b/pdfium.gyp
index 1445871499..cc3b225623 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -1,5 +1,7 @@
{
'variables': {
+ # TODO(thakis): Enable this, pdfium:29
+ #'chromium_code': 1,
'pdf_use_skia%': 0,
'pdf_enable_v8%': 1,
'pdf_enable_xfa%': 1,
@@ -48,8 +50,18 @@
}],
],
'msvs_disabled_warnings': [
- 4005, 4018, 4146, 4333, 4345, 4267
+ 4005, 4018, 4146, 4333, 4345, 4267,
+ # TODO(thestig): Fix all instances, remove this, pdfium:29
+ 4245, 4310, 4389, 4701, 4702, 4706, 4800,
],
+ 'variables': {
+ 'clang_warning_flags': [
+ # TODO(thestig): Fix all instances, remove this, pdfium:29
+ '-Wno-sign-compare',
+ ],
+ # Make sure Chromium's build/common.gypi doesn't re-add the flag on linux.
+ 'cflags_cc!': [ '-Wsign-compare' ],
+ },
},
'targets': [
{