summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-11-21 13:50:32 -0500
committerdan sinclair <dsinclair@chromium.org>2016-11-21 18:51:10 +0000
commit85c8e7f788512ce5b5b43cd816e8091b57c3d5e7 (patch)
treee727d747684b9db2632ef250b55046cfce2b55a3 /core
parent7daa6fb286d1b5d65f99521f3314083e86d93e3f (diff)
downloadpdfium-85c8e7f788512ce5b5b43cd816e8091b57c3d5e7.tar.xz
Fixup lint flags.
The -build/include setting was masking out build/include_what_you_use. This CL restores them, fixes any build errors, and adds NOLINT as needed. As well, the runtime/explicit and runtime/printf flags are aslo enabled and NOLINT'd. lint cleanups Change-Id: Ib013b3eb29c8d0e48cad74c5df9028684130719f Reviewed-on: https://pdfium-review.googlesource.com/2030 Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/cpdf_modulemgr.h1
-rw-r--r--core/fpdfapi/font/fpdf_font.cpp3
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.cpp3
-rw-r--r--core/fpdfapi/page/cpdf_contentmarkitem.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_page.cpp1
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.h2
-rw-r--r--core/fpdfapi/page/cpdf_shadingpattern.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp1
-rw-r--r--core/fpdfapi/parser/cpdf_array_unittest.cpp1
-rw-r--r--core/fpdfapi/parser/cpdf_boolean.h2
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.h2
-rw-r--r--core/fpdfapi/parser/cpdf_document.h3
-rw-r--r--core/fpdfapi/parser/cpdf_indirect_object_holder.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_linearized_header.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_name.h2
-rw-r--r--core/fpdfapi/parser/cpdf_null.h2
-rw-r--r--core/fpdfapi/parser/cpdf_number.h2
-rw-r--r--core/fpdfapi/parser/cpdf_reference.h1
-rw-r--r--core/fpdfapi/parser/cpdf_simple_parser.h2
-rw-r--r--core/fpdfdoc/cpdf_apsettings.cpp2
-rw-r--r--core/fpdfdoc/cpdf_bookmark.cpp2
-rw-r--r--core/fpdfdoc/cpdf_defaultappearance.cpp2
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp1
-rw-r--r--core/fpdfdoc/cpdf_variabletext.cpp2
-rw-r--r--core/fxcodec/codec/fx_codec_jbig.cpp1
-rw-r--r--core/fxcodec/codec/fx_codec_jpeg.cpp2
-rw-r--r--core/fxcodec/codec/fx_codec_jpx_opj.cpp1
-rw-r--r--core/fxcrt/cfx_shared_copy_on_write.h1
-rw-r--r--core/fxcrt/cfx_string_c_template.h2
-rw-r--r--core/fxcrt/cfx_weak_ptr.h4
-rw-r--r--core/fxcrt/fx_basic.h4
-rw-r--r--core/fxcrt/fx_basic_bstring_unittest.cpp2
-rw-r--r--core/fxcrt/fx_ext.h1
-rw-r--r--core/fxcrt/fx_extension.cpp2
-rw-r--r--core/fxcrt/fx_string.h4
-rw-r--r--core/fxcrt/fx_xml.h2
-rw-r--r--core/fxcrt/fx_xml_parser.cpp1
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp1
-rw-r--r--core/fxge/apple/fx_mac_imp.cpp2
-rw-r--r--core/fxge/cfx_facecache.h1
-rw-r--r--core/fxge/cfx_fontmapper.h1
-rw-r--r--core/fxge/dib/fx_dib_convert.cpp3
-rw-r--r--core/fxge/dib/fx_dib_main.cpp3
-rw-r--r--core/fxge/dib/fx_dib_transform.cpp3
-rw-r--r--core/fxge/fx_font.h2
-rw-r--r--core/fxge/ge/cfx_facecache.cpp2
-rw-r--r--core/fxge/ge/cfx_folderfontinfo.cpp2
-rw-r--r--core/fxge/ge/cfx_font.cpp6
-rw-r--r--core/fxge/ge/cfx_fontcache.cpp3
-rw-r--r--core/fxge/ge/cfx_fontmgr.cpp3
-rw-r--r--core/fxge/ge/cfx_renderdevice.cpp5
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp2
-rw-r--r--core/fxge/ifx_systemfontinfo.h2
-rw-r--r--core/fxge/skia/fx_skia_device.cpp1
-rw-r--r--core/fxge/skia/fx_skia_device.h3
56 files changed, 116 insertions, 5 deletions
diff --git a/core/fpdfapi/cpdf_modulemgr.h b/core/fpdfapi/cpdf_modulemgr.h
index bc54a9b2fb..57c266619e 100644
--- a/core/fpdfapi/cpdf_modulemgr.h
+++ b/core/fpdfapi/cpdf_modulemgr.h
@@ -8,6 +8,7 @@
#define CORE_FPDFAPI_CPDF_MODULEMGR_H_
#include <memory>
+#include <utility>
#include "core/fxcrt/fx_basic.h"
diff --git a/core/fpdfapi/font/fpdf_font.cpp b/core/fpdfapi/font/fpdf_font.cpp
index b681edf70b..bf1fac4518 100644
--- a/core/fpdfapi/font/fpdf_font.cpp
+++ b/core/fpdfapi/font/fpdf_font.cpp
@@ -6,6 +6,9 @@
#include "core/fpdfapi/font/font_int.h"
+#include <memory>
+#include <utility>
+
#include "core/fpdfapi/cpdf_modulemgr.h"
#include "core/fpdfapi/page/cpdf_form.h"
#include "core/fpdfapi/page/cpdf_pagemodule.h"
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index a867409335..07f0bd931d 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -6,6 +6,9 @@
#include "core/fpdfapi/page/cpdf_contentmark.h"
+#include <memory>
+#include <utility>
+
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "third_party/base/stl_util.h"
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.cpp b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
index 48a9679251..2c370141e2 100644
--- a/core/fpdfapi/page/cpdf_contentmarkitem.cpp
+++ b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/page/cpdf_contentmarkitem.h"
+#include <utility>
+
#include "core/fpdfapi/parser/cpdf_dictionary.h"
CPDF_ContentMarkItem::CPDF_ContentMarkItem()
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp
index 2143ddb015..a29d9713dd 100644
--- a/core/fpdfapi/page/cpdf_page.cpp
+++ b/core/fpdfapi/page/cpdf_page.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include <set>
+#include <utility>
#include "core/fpdfapi/cpdf_pagerendercontext.h"
#include "core/fpdfapi/page/cpdf_pageobject.h"
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index a52d97f27e..9726fa216f 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/page/cpdf_pageobjectholder.h"
+#include <algorithm>
+
#include "core/fpdfapi/page/cpdf_pageobject.h"
#include "core/fpdfapi/page/pageint.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h
index ce5424e009..aee7617c1f 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.h
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_
#define CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_
+#include <memory>
+
#include "core/fpdfapi/page/cpdf_pageobjectlist.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_system.h"
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index 3b0b439a31..e19ffaf0c4 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/page/cpdf_shadingpattern.h"
+#include <algorithm>
+
#include "core/fpdfapi/page/cpdf_docpagedata.h"
#include "core/fpdfapi/page/pageint.h"
#include "core/fpdfapi/parser/cpdf_array.h"
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index 0973cb6bc6..64010e19e8 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/parser/cpdf_array.h"
#include <set>
+#include <utility>
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_number.h"
diff --git a/core/fpdfapi/parser/cpdf_array_unittest.cpp b/core/fpdfapi/parser/cpdf_array_unittest.cpp
index 866e961351..46777289b5 100644
--- a/core/fpdfapi/parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_array_unittest.cpp
@@ -5,6 +5,7 @@
#include "core/fpdfapi/parser/cpdf_array.h"
#include <memory>
+#include <utility>
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
diff --git a/core/fpdfapi/parser/cpdf_boolean.h b/core/fpdfapi/parser/cpdf_boolean.h
index 808f9ee6f0..afebc29448 100644
--- a/core/fpdfapi/parser/cpdf_boolean.h
+++ b/core/fpdfapi/parser/cpdf_boolean.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_BOOLEAN_H_
#define CORE_FPDFAPI_PARSER_CPDF_BOOLEAN_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
diff --git a/core/fpdfapi/parser/cpdf_data_avail.h b/core/fpdfapi/parser/cpdf_data_avail.h
index 0f10ceb6fc..809b23fe59 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.h
+++ b/core/fpdfapi/parser/cpdf_data_avail.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_
#define CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_
+#include <memory>
+#include <set>
#include <vector>
#include "core/fpdfapi/parser/cpdf_parser.h"
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index 1fd13a1c8e..59154d3ab3 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -9,6 +9,9 @@
#include <functional>
#include <memory>
+#include <set>
+#include <utility>
+#include <vector>
#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
#include "core/fpdfapi/parser/cpdf_object.h"
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
index d1183ebaf4..efb9f84059 100644
--- a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
+++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
@@ -6,6 +6,9 @@
#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
+#include <algorithm>
+#include <utility>
+
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.cpp b/core/fpdfapi/parser/cpdf_linearized_header.cpp
index 9ecc051f8a..a56d64f259 100644
--- a/core/fpdfapi/parser/cpdf_linearized_header.cpp
+++ b/core/fpdfapi/parser/cpdf_linearized_header.cpp
@@ -6,6 +6,9 @@
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
+#include <algorithm>
+#include <utility>
+
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_number.h"
diff --git a/core/fpdfapi/parser/cpdf_name.h b/core/fpdfapi/parser/cpdf_name.h
index 6aac24ed88..61318d4afb 100644
--- a/core/fpdfapi/parser/cpdf_name.h
+++ b/core/fpdfapi/parser/cpdf_name.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_NAME_H_
#define CORE_FPDFAPI_PARSER_CPDF_NAME_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fxcrt/cfx_string_pool_template.h"
#include "core/fxcrt/cfx_weak_ptr.h"
diff --git a/core/fpdfapi/parser/cpdf_null.h b/core/fpdfapi/parser/cpdf_null.h
index df985b92c0..4f8420f29d 100644
--- a/core/fpdfapi/parser/cpdf_null.h
+++ b/core/fpdfapi/parser/cpdf_null.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_NULL_H_
#define CORE_FPDFAPI_PARSER_CPDF_NULL_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_object.h"
class CPDF_Null : public CPDF_Object {
diff --git a/core/fpdfapi/parser/cpdf_number.h b/core/fpdfapi/parser/cpdf_number.h
index 0a8f187244..85a78e5f1a 100644
--- a/core/fpdfapi/parser/cpdf_number.h
+++ b/core/fpdfapi/parser/cpdf_number.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_NUMBER_H_
#define CORE_FPDFAPI_PARSER_CPDF_NUMBER_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
diff --git a/core/fpdfapi/parser/cpdf_reference.h b/core/fpdfapi/parser/cpdf_reference.h
index 93bab00334..5597142b95 100644
--- a/core/fpdfapi/parser/cpdf_reference.h
+++ b/core/fpdfapi/parser/cpdf_reference.h
@@ -7,6 +7,7 @@
#ifndef CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_
#define CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_
+#include <memory>
#include <set>
#include "core/fpdfapi/parser/cpdf_object.h"
diff --git a/core/fpdfapi/parser/cpdf_simple_parser.h b/core/fpdfapi/parser/cpdf_simple_parser.h
index c638b8a04b..0ff6985660 100644
--- a/core/fpdfapi/parser/cpdf_simple_parser.h
+++ b/core/fpdfapi/parser/cpdf_simple_parser.h
@@ -13,7 +13,7 @@
class CPDF_SimpleParser {
public:
CPDF_SimpleParser(const uint8_t* pData, uint32_t dwSize);
- CPDF_SimpleParser(const CFX_ByteStringC& str);
+ explicit CPDF_SimpleParser(const CFX_ByteStringC& str);
CFX_ByteStringC GetWord();
diff --git a/core/fpdfdoc/cpdf_apsettings.cpp b/core/fpdfdoc/cpdf_apsettings.cpp
index f9127a2720..9fc9c1aa06 100644
--- a/core/fpdfdoc/cpdf_apsettings.cpp
+++ b/core/fpdfdoc/cpdf_apsettings.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfdoc/cpdf_apsettings.h"
+#include <algorithm>
+
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfdoc/cpdf_formcontrol.h"
diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp
index 303f0fcce3..c2c3705717 100644
--- a/core/fpdfdoc/cpdf_bookmark.cpp
+++ b/core/fpdfdoc/cpdf_bookmark.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfdoc/cpdf_bookmark.h"
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_nametree.h"
diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp
index 130115bdfb..daf93414bf 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.cpp
+++ b/core/fpdfdoc/cpdf_defaultappearance.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfdoc/cpdf_defaultappearance.h"
+#include <algorithm>
+
#include "core/fpdfapi/parser/cpdf_simple_parser.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfdoc/cpdf_formcontrol.h"
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 377a360d9e..00365c7224 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -364,6 +364,7 @@ bool RetrieveSpecificFont(uint8_t charSet,
lf.lfPitchAndFamily = pitchAndFamily;
if (pcsFontName) {
// TODO(dsinclair): Should this be strncpy?
+ // NOLINTNEXTLINE(runtime/printf)
strcpy(lf.lfFaceName, pcsFontName);
}
return RetrieveSpecificFont(lf);
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 5fe8c0137e..5cc7e9bf11 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfdoc/cpdf_variabletext.h"
+#include <algorithm>
+
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfdoc/cline.h"
#include "core/fpdfdoc/cpvt_section.h"
diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp
index 3d3fe74eb1..8d20894231 100644
--- a/core/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/fxcodec/codec/fx_codec_jbig.cpp
@@ -7,6 +7,7 @@
#include "core/fxcodec/codec/ccodec_jbig2module.h"
#include <list>
+#include <memory>
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fxcodec/JBig2_DocumentContext.h"
diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp
index 775ebfb9c6..873b52a81c 100644
--- a/core/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/fxcodec/codec/fx_codec_jpeg.cpp
@@ -6,6 +6,8 @@
#include <setjmp.h>
+#include <memory>
+
#include "core/fxcodec/codec/codec_int.h"
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/fx_safe_types.h"
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index bb46da4d26..fa163567f4 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -6,6 +6,7 @@
#include <algorithm>
#include <limits>
+#include <memory>
#include <vector>
#include "core/fpdfapi/page/cpdf_colorspace.h"
diff --git a/core/fxcrt/cfx_shared_copy_on_write.h b/core/fxcrt/cfx_shared_copy_on_write.h
index cd6cf6adc5..c87d96509d 100644
--- a/core/fxcrt/cfx_shared_copy_on_write.h
+++ b/core/fxcrt/cfx_shared_copy_on_write.h
@@ -56,6 +56,7 @@ class CFX_SharedCopyOnWrite {
class CountedObj : public ObjClass {
public:
template <typename... Args>
+ // NOLINTNEXTLINE(runtime/explicit)
CountedObj(Args... params) : ObjClass(params...), m_RefCount(0) {}
CountedObj(const CountedObj& src) : ObjClass(src), m_RefCount(0) {}
diff --git a/core/fxcrt/cfx_string_c_template.h b/core/fxcrt/cfx_string_c_template.h
index 4a3dae7e7e..3bfcc915fb 100644
--- a/core/fxcrt/cfx_string_c_template.h
+++ b/core/fxcrt/cfx_string_c_template.h
@@ -24,6 +24,7 @@ class CFX_StringCTemplate {
CFX_StringCTemplate() : m_Ptr(nullptr), m_Length(0) {}
// Deliberately implicit to avoid calling on every string literal.
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_StringCTemplate(const CharType* ptr)
: m_Ptr(reinterpret_cast<const UnsignedType*>(ptr)),
m_Length(ptr ? FXSYS_len(ptr) : 0) {}
@@ -41,6 +42,7 @@ class CFX_StringCTemplate {
// Deliberately implicit to avoid calling on every string literal.
// |ch| must be an lvalue that outlives the the CFX_StringCTemplate.
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_StringCTemplate(CharType& ch) {
m_Ptr = reinterpret_cast<const UnsignedType*>(&ch);
m_Length = 1;
diff --git a/core/fxcrt/cfx_weak_ptr.h b/core/fxcrt/cfx_weak_ptr.h
index f679696992..43ae5b881d 100644
--- a/core/fxcrt/cfx_weak_ptr.h
+++ b/core/fxcrt/cfx_weak_ptr.h
@@ -9,6 +9,7 @@
#include <cstddef>
#include <memory>
+#include <utility>
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_system.h"
@@ -19,10 +20,11 @@ class CFX_WeakPtr {
CFX_WeakPtr() {}
CFX_WeakPtr(const CFX_WeakPtr& that) : m_pHandle(that.m_pHandle) {}
CFX_WeakPtr(CFX_WeakPtr&& that) { Swap(that); }
- CFX_WeakPtr(std::unique_ptr<T, D> pObj)
+ explicit CFX_WeakPtr(std::unique_ptr<T, D> pObj)
: m_pHandle(new Handle(std::move(pObj))) {}
// Deliberately implicit to allow passing nullptr.
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_WeakPtr(std::nullptr_t arg) {}
explicit operator bool() const { return m_pHandle && !!m_pHandle->Get(); }
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h
index 9c8b4e146e..9034398983 100644
--- a/core/fxcrt/fx_basic.h
+++ b/core/fxcrt/fx_basic.h
@@ -455,7 +455,7 @@ class CFX_MapPtrToPtr {
};
public:
- CFX_MapPtrToPtr(int nBlockSize = 10);
+ explicit CFX_MapPtrToPtr(int nBlockSize = 10);
~CFX_MapPtrToPtr();
int GetCount() const { return m_nCount; }
@@ -554,7 +554,7 @@ class CFX_PtrList {
};
public:
- CFX_PtrList(int nBlockSize = 10);
+ explicit CFX_PtrList(int nBlockSize = 10);
FX_POSITION GetHeadPosition() const { return (FX_POSITION)m_pNodeHead; }
FX_POSITION GetTailPosition() const { return (FX_POSITION)m_pNodeTail; }
diff --git a/core/fxcrt/fx_basic_bstring_unittest.cpp b/core/fxcrt/fx_basic_bstring_unittest.cpp
index f314c652ba..503e68458a 100644
--- a/core/fxcrt/fx_basic_bstring_unittest.cpp
+++ b/core/fxcrt/fx_basic_bstring_unittest.cpp
@@ -649,6 +649,7 @@ TEST(fxcrt, ByteStringGetBuffer) {
{
CFX_ByteString str;
FX_CHAR* buffer = str.GetBuffer(12);
+ // NOLINTNEXTLINE(runtime/printf)
strcpy(buffer, "clams");
str.ReleaseBuffer();
EXPECT_EQ("clams", str);
@@ -656,6 +657,7 @@ TEST(fxcrt, ByteStringGetBuffer) {
{
CFX_ByteString str("cl");
FX_CHAR* buffer = str.GetBuffer(12);
+ // NOLINTNEXTLINE(runtime/printf)
strcpy(buffer + 2, "ams");
str.ReleaseBuffer();
EXPECT_EQ("clams", str);
diff --git a/core/fxcrt/fx_ext.h b/core/fxcrt/fx_ext.h
index b7fd6f67f7..7d8529e333 100644
--- a/core/fxcrt/fx_ext.h
+++ b/core/fxcrt/fx_ext.h
@@ -9,6 +9,7 @@
#include <cctype>
#include <cwctype>
+#include <memory>
#include "core/fxcrt/fx_basic.h"
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 0a378f32e5..39bf028205 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -6,6 +6,8 @@
#include "core/fxcrt/extension.h"
+#include <algorithm>
+#include <memory>
#include <utility>
#include "core/fxcrt/fx_basic.h"
diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h
index 0b6d8064d4..540c0c4330 100644
--- a/core/fxcrt/fx_string.h
+++ b/core/fxcrt/fx_string.h
@@ -41,7 +41,9 @@ class CFX_ByteString {
CFX_ByteString(CFX_ByteString&& other);
// Deliberately implicit to avoid calling on every string literal.
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_ByteString(char ch);
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_ByteString(const FX_CHAR* ptr);
CFX_ByteString(const FX_CHAR* ptr, FX_STRSIZE len);
@@ -242,7 +244,9 @@ class CFX_WideString {
CFX_WideString(CFX_WideString&& other);
// Deliberately implicit to avoid calling on every string literal.
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_WideString(FX_WCHAR ch);
+ // NOLINTNEXTLINE(runtime/explicit)
CFX_WideString(const FX_WCHAR* ptr);
CFX_WideString(const FX_WCHAR* ptr, FX_STRSIZE len);
diff --git a/core/fxcrt/fx_xml.h b/core/fxcrt/fx_xml.h
index 6c6e6178af..a7375b9e90 100644
--- a/core/fxcrt/fx_xml.h
+++ b/core/fxcrt/fx_xml.h
@@ -66,7 +66,7 @@ class CXML_Element {
FX_FILESIZE* pParsedSize = nullptr);
CXML_Element(const CFX_ByteStringC& qSpace, const CFX_ByteStringC& tagName);
- CXML_Element(const CFX_ByteStringC& qTagName);
+ explicit CXML_Element(const CFX_ByteStringC& qTagName);
CXML_Element();
~CXML_Element();
diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp
index e1a209a701..3391086e90 100644
--- a/core/fxcrt/fx_xml_parser.cpp
+++ b/core/fxcrt/fx_xml_parser.cpp
@@ -6,6 +6,7 @@
#include "core/fxcrt/xml_int.h"
+#include <algorithm>
#include <vector>
#include "core/fxcrt/fx_ext.h"
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 3634d96d91..e341e8c045 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -7,6 +7,7 @@
#include "core/fxge/agg/fx_agg_driver.h"
#include <algorithm>
+#include <utility>
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/fx_memory.h"
diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp
index 7c3cb04105..c05aea34f5 100644
--- a/core/fxge/apple/fx_mac_imp.cpp
+++ b/core/fxge/apple/fx_mac_imp.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <memory>
+
#include "core/fxge/apple/apple_int.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/ge/cfx_folderfontinfo.h"
diff --git a/core/fxge/cfx_facecache.h b/core/fxge/cfx_facecache.h
index 60528ba6a5..44ed0b287a 100644
--- a/core/fxge/cfx_facecache.h
+++ b/core/fxge/cfx_facecache.h
@@ -8,6 +8,7 @@
#define CORE_FXGE_CFX_FACECACHE_H_
#include <map>
+#include <memory>
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_freetype.h"
diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h
index fa3bc02eb0..96630a77df 100644
--- a/core/fxge/cfx_fontmapper.h
+++ b/core/fxge/cfx_fontmapper.h
@@ -8,6 +8,7 @@
#define CORE_FXGE_CFX_FONTMAPPER_H_
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxge/cfx_fontmgr.h"
diff --git a/core/fxge/dib/fx_dib_convert.cpp b/core/fxge/dib/fx_dib_convert.cpp
index 5eac2ac8e4..f5ae563d57 100644
--- a/core/fxge/dib/fx_dib_convert.cpp
+++ b/core/fxge/dib/fx_dib_convert.cpp
@@ -4,6 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <memory>
+#include <utility>
+
#include "core/fxcodec/fx_codec.h"
#include "core/fxge/fx_dib.h"
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index 9c91c74366..63db7adb91 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -7,7 +7,10 @@
#include "core/fxge/fx_dib.h"
#include <limits.h>
+
#include <algorithm>
+#include <memory>
+#include <utility>
#include "core/fxcodec/fx_codec.h"
#include "core/fxge/cfx_gemodule.h"
diff --git a/core/fxge/dib/fx_dib_transform.cpp b/core/fxge/dib/fx_dib_transform.cpp
index e2b95237d5..b938d648a8 100644
--- a/core/fxge/dib/fx_dib_transform.cpp
+++ b/core/fxge/dib/fx_dib_transform.cpp
@@ -6,6 +6,9 @@
#include "core/fxge/dib/dib_int.h"
+#include <memory>
+#include <utility>
+
#include "core/fxge/fx_dib.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index c0d204199c..6bb4bdea34 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -8,6 +8,7 @@
#define CORE_FXGE_FX_FONT_H_
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxcrt/fx_system.h"
@@ -169,6 +170,7 @@ class CFX_Font {
static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize];
#ifdef PDF_ENABLE_XFA
+
protected:
CFX_BinaryBuf m_OtfFontData;
bool m_bShallowCopy;
diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp
index 942814b75a..cbaa07e449 100644
--- a/core/fxge/ge/cfx_facecache.cpp
+++ b/core/fxge/ge/cfx_facecache.cpp
@@ -7,6 +7,8 @@
#include "core/fxge/cfx_facecache.h"
#include <algorithm>
+#include <limits>
+#include <memory>
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
diff --git a/core/fxge/ge/cfx_folderfontinfo.cpp b/core/fxge/ge/cfx_folderfontinfo.cpp
index 9ccccbc635..776a37319b 100644
--- a/core/fxge/ge/cfx_folderfontinfo.cpp
+++ b/core/fxge/ge/cfx_folderfontinfo.cpp
@@ -6,6 +6,8 @@
#include "core/fxge/ge/cfx_folderfontinfo.h"
+#include <limits>
+
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/fx_font.h"
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp
index b778031606..b85709040b 100644
--- a/core/fxge/ge/cfx_font.cpp
+++ b/core/fxge/ge/cfx_font.cpp
@@ -6,6 +6,12 @@
#include "core/fxge/fx_font.h"
+#include <algorithm>
+#include <limits>
+#include <memory>
+#include <utility>
+#include <vector>
+
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fxge/cfx_facecache.h"
#include "core/fxge/cfx_fontcache.h"
diff --git a/core/fxge/ge/cfx_fontcache.cpp b/core/fxge/ge/cfx_fontcache.cpp
index 2a4d243719..58cee06d42 100644
--- a/core/fxge/ge/cfx_fontcache.cpp
+++ b/core/fxge/ge/cfx_fontcache.cpp
@@ -6,6 +6,9 @@
#include "core/fxge/cfx_fontcache.h"
+#include <memory>
+#include <utility>
+
#include "core/fxge/cfx_facecache.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_freetype.h"
diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp
index 1d1ebca4a4..64f647e3f6 100644
--- a/core/fxge/ge/cfx_fontmgr.cpp
+++ b/core/fxge/ge/cfx_fontmgr.cpp
@@ -6,6 +6,9 @@
#include "core/fxge/cfx_fontmgr.h"
+#include <memory>
+#include <utility>
+
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fontdata/chromefontdata/chromefontdata.h"
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp
index a4ce6b7d5e..10135273c6 100644
--- a/core/fxge/ge/cfx_renderdevice.cpp
+++ b/core/fxge/ge/cfx_renderdevice.cpp
@@ -6,6 +6,11 @@
#include "core/fxge/cfx_renderdevice.h"
+#include <algorithm>
+#include <memory>
+#include <utility>
+#include <vector>
+
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_facecache.h"
#include "core/fxge/cfx_fxgedevice.h"
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index f8c36d8f07..7ac4fada5c 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <memory>
+
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/ifx_systemfontinfo.h"
diff --git a/core/fxge/ifx_systemfontinfo.h b/core/fxge/ifx_systemfontinfo.h
index 640a11a57b..1ab0ab677c 100644
--- a/core/fxge/ifx_systemfontinfo.h
+++ b/core/fxge/ifx_systemfontinfo.h
@@ -7,6 +7,8 @@
#ifndef CORE_FXGE_IFX_SYSTEMFONTINFO_H_
#define CORE_FXGE_IFX_SYSTEMFONTINFO_H_
+#include <memory>
+
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/fx_font.h"
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index d525c470af..973c4f2b34 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <algorithm>
+#include <utility>
#include <vector>
#include "core/fxcodec/fx_codec.h"
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index bbbbdaa2dd..f2576a888d 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -7,6 +7,9 @@
#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
+#include <memory>
+#include <vector>
+
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/ifx_renderdevicedriver.h"