summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp22
-rw-r--r--core/src/fxcrt/fx_basic_gcc.cpp24
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp15
-rw-r--r--core/src/fxcrt/fx_system_unittest.cpp1
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp2
5 files changed, 33 insertions, 31 deletions
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 8b4442e823..5d38d57757 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -4,7 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include <stddef.h> // For offsetof().
+#include <stddef.h>
+
#include <cctype>
#include "core/include/fxcrt/fx_basic.h"
@@ -22,15 +23,15 @@ static int _Buffer_itoa(char* buf, int i, FX_DWORD flags) {
u = -i;
}
int base = 10;
- const FX_CHAR* string = "0123456789abcdef";
+ const FX_CHAR* str = "0123456789abcdef";
if (flags & FXFORMAT_HEX) {
base = 16;
if (flags & FXFORMAT_CAPITAL) {
- string = "0123456789ABCDEF";
+ str = "0123456789ABCDEF";
}
}
while (u != 0) {
- buf1[buf_pos--] = string[u % base];
+ buf1[buf_pos--] = str[u % base];
u = u / base;
}
if ((flags & FXFORMAT_SIGNED) && i < 0) {
@@ -202,19 +203,18 @@ const CFX_ByteString& CFX_ByteString::operator+=(char ch) {
ConcatInPlace(1, &ch);
return *this;
}
-const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& string) {
- if (!string.m_pData) {
+const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& str) {
+ if (!str.m_pData) {
return *this;
}
- ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
+ ConcatInPlace(str.m_pData->m_nDataLength, str.m_pData->m_String);
return *this;
}
-const CFX_ByteString& CFX_ByteString::operator+=(
- const CFX_ByteStringC& string) {
- if (string.IsEmpty()) {
+const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteStringC& str) {
+ if (str.IsEmpty()) {
return *this;
}
- ConcatInPlace(string.GetLength(), string.GetCStr());
+ ConcatInPlace(str.GetLength(), str.GetCStr());
return *this;
}
bool CFX_ByteString::Equal(const char* ptr) const {
diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp
index e2ec939e7d..2c9c54c8b6 100644
--- a/core/src/fxcrt/fx_basic_gcc.cpp
+++ b/core/src/fxcrt/fx_basic_gcc.cpp
@@ -33,20 +33,20 @@ IntType FXSYS_StrToInt(const CharType* str) {
}
template <typename T, typename UT, typename STR_T>
-STR_T FXSYS_IntToStr(T value, STR_T string, int radix) {
+STR_T FXSYS_IntToStr(T value, STR_T str, int radix) {
if (radix < 2 || radix > 16) {
- string[0] = 0;
- return string;
+ str[0] = 0;
+ return str;
}
if (value == 0) {
- string[0] = '0';
- string[1] = 0;
- return string;
+ str[0] = '0';
+ str[1] = 0;
+ return str;
}
int i = 0;
UT uvalue;
if (value < 0) {
- string[i++] = '-';
+ str[i++] = '-';
// Standard trick to avoid undefined behaviour when negating INT_MIN.
uvalue = static_cast<UT>(-(value + 1)) + 1;
} else {
@@ -59,11 +59,11 @@ STR_T FXSYS_IntToStr(T value, STR_T string, int radix) {
order = order / radix;
}
for (int d = digits - 1; d > -1; d--) {
- string[d + i] = "0123456789abcdef"[uvalue % radix];
+ str[d + i] = "0123456789abcdef"[uvalue % radix];
uvalue /= radix;
}
- string[digits + i] = 0;
- return string;
+ str[digits + i] = 0;
+ return str;
}
#ifdef __cplusplus
@@ -191,8 +191,8 @@ int FXSYS_wcsicmp(const FX_WCHAR* dst, const FX_WCHAR* src) {
} while (f && (f == l));
return (f - l);
}
-char* FXSYS_itoa(int value, char* string, int radix) {
- return FXSYS_IntToStr<int32_t, uint32_t, FX_CHAR*>(value, string, radix);
+char* FXSYS_itoa(int value, char* str, int radix) {
+ return FXSYS_IntToStr<int32_t, uint32_t, FX_CHAR*>(value, str, radix);
}
#ifdef __cplusplus
}
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index 8df72466e8..11a840a806 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include <stddef.h> // For offsetof().
+#include <stddef.h>
#include <algorithm>
#include <cctype>
@@ -184,19 +184,18 @@ const CFX_WideString& CFX_WideString::operator+=(const FX_WCHAR* lpsz) {
}
return *this;
}
-const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& string) {
- if (!string.m_pData) {
+const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& str) {
+ if (!str.m_pData) {
return *this;
}
- ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
+ ConcatInPlace(str.m_pData->m_nDataLength, str.m_pData->m_String);
return *this;
}
-const CFX_WideString& CFX_WideString::operator+=(
- const CFX_WideStringC& string) {
- if (string.IsEmpty()) {
+const CFX_WideString& CFX_WideString::operator+=(const CFX_WideStringC& str) {
+ if (str.IsEmpty()) {
return *this;
}
- ConcatInPlace(string.GetLength(), string.GetPtr());
+ ConcatInPlace(str.GetLength(), str.GetPtr());
return *this;
}
bool CFX_WideString::Equal(const wchar_t* ptr) const {
diff --git a/core/src/fxcrt/fx_system_unittest.cpp b/core/src/fxcrt/fx_system_unittest.cpp
index 4a07a77ad2..f877eb2aa5 100644
--- a/core/src/fxcrt/fx_system_unittest.cpp
+++ b/core/src/fxcrt/fx_system_unittest.cpp
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <limits>
#include <string>
#include "core/include/fxcrt/fx_system.h"
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 59c3de444e..da2b26b5b8 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -6,6 +6,8 @@
#include "core/src/fxcrt/xml_int.h"
+#include <vector>
+
#include "core/include/fxcrt/fx_ext.h"
#include "core/include/fxcrt/fx_xml.h"
#include "third_party/base/stl_util.h"