summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-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
10 files changed, 19 insertions, 4 deletions
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"