summaryrefslogtreecommitdiff
path: root/core/fxcrt/include
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-19 14:11:59 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-19 14:11:59 -0700
commit4d31d0c653cf66f72bdef7cebbf7cff45d33f6c6 (patch)
tree63bd0f15c758b60a5ce577ac1a1f8bb24cb387c8 /core/fxcrt/include
parente3bbfa29b9d38dbbb77c12692eba3c40a7fb2870 (diff)
downloadpdfium-4d31d0c653cf66f72bdef7cebbf7cff45d33f6c6.tar.xz
Remove a few more char* members from structs/classes.
This is a result of looking for the anti-paterns /char\*\sm_/ and /m_.*=.*\.c_str/ which indicate that a class may be using the contents of a string without extending the lifetime of the underlying storage. Along the way, change to uint8_t in fx_dib; this is unrelated but avoids grep hits (it is binary, not chars anyways). Also remove two string operators that make it easy to assign in a manner that does not extend contents lifetime. Review URL: https://codereview.chromium.org/1902953002
Diffstat (limited to 'core/fxcrt/include')
-rw-r--r--core/fxcrt/include/fx_string.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index 2fabee39cf..10a70d9334 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -74,8 +74,6 @@ class CFX_ByteStringC {
return *this;
}
- CFX_ByteStringC& operator=(const CFX_ByteString& src);
-
bool operator==(const char* ptr) const {
return FXSYS_strlen(ptr) == m_Length &&
FXSYS_memcmp(ptr, m_Ptr, m_Length) == 0;
@@ -285,12 +283,6 @@ class CFX_ByteString {
friend class fxcrt_ByteStringConcat_Test;
};
-inline CFX_ByteStringC& CFX_ByteStringC::operator=(const CFX_ByteString& src) {
- m_Ptr = src.raw_str();
- m_Length = src.GetLength();
- return *this;
-}
-
inline bool operator==(const char* lhs, const CFX_ByteString& rhs) {
return rhs == lhs;
}
@@ -398,8 +390,6 @@ class CFX_WideStringC {
return *this;
}
- CFX_WideStringC& operator=(const CFX_WideString& src);
-
bool operator==(const wchar_t* ptr) const {
return FXSYS_wcslen(ptr) == m_Length && wmemcmp(ptr, m_Ptr, m_Length) == 0;
}
@@ -611,12 +601,6 @@ class CFX_WideString {
friend class fxcrt_WideStringConcatInPlace_Test;
};
-inline CFX_WideStringC& CFX_WideStringC::operator=(const CFX_WideString& src) {
- m_Ptr = src.c_str();
- m_Length = src.GetLength();
- return *this;
-}
-
inline CFX_WideString operator+(const CFX_WideStringC& str1,
const CFX_WideStringC& str2) {
return CFX_WideString(str1, str2);