summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_system.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-27 10:53:11 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-27 16:11:38 +0000
commit875e98c581952478f3a3ccef9b2f2e3ed06c5346 (patch)
tree8e0d7e032056bf4c73d6da43c0f3ce4eadb74dfd /core/fxcrt/fx_system.h
parentcc3a3ee3ebcc1baabdfa7ffca5876dbbfa3980c1 (diff)
downloadpdfium-875e98c581952478f3a3ccef9b2f2e3ed06c5346.tar.xz
Remove FX_STRSIZE and replace with size_t
BUG=pdfium:828 Change-Id: I5c40237433ebabaeabdb43aec9cdf783e41dfe16 Reviewed-on: https://pdfium-review.googlesource.com/13230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_system.h')
-rw-r--r--core/fxcrt/fx_system.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h
index 426dc085fc..2c84b02238 100644
--- a/core/fxcrt/fx_system.h
+++ b/core/fxcrt/fx_system.h
@@ -76,10 +76,6 @@ extern "C" {
#define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
#define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb))
-// Unsigned value used to represent a location or range in a string.
-// TODO(rharrison): Remove and use size_t directly once int->size_t stabilizes.
-typedef size_t FX_STRSIZE;
-
// PDFium file sizes match the platform, but PDFium itself does not support
// files larger than 2GB even if the platform does. The value must be signed
// to support -1 error returns.
@@ -120,15 +116,15 @@ typedef size_t FX_STRSIZE;
#include "third_party/base/numerics/safe_conversions.h"
-#define FXSYS_strlen(ptr) pdfium::base::checked_cast<FX_STRSIZE>(strlen(ptr))
-#define FXSYS_wcslen(ptr) pdfium::base::checked_cast<FX_STRSIZE>(wcslen(ptr))
+#define FXSYS_strlen(ptr) (strlen(ptr))
+#define FXSYS_wcslen(ptr) (wcslen(ptr))
// Overloaded functions for C++ templates
-inline FX_STRSIZE FXSYS_len(const char* ptr) {
+inline size_t FXSYS_len(const char* ptr) {
return FXSYS_strlen(ptr);
}
-inline FX_STRSIZE FXSYS_len(const wchar_t* ptr) {
+inline size_t FXSYS_len(const wchar_t* ptr) {
return FXSYS_wcslen(ptr);
}
@@ -150,8 +146,8 @@ inline const wchar_t* FXSYS_chr(const wchar_t* ptr, wchar_t ch, size_t len) {
extern "C" {
#else
-#define FXSYS_strlen(ptr) ((FX_STRSIZE)strlen(ptr))
-#define FXSYS_wcslen(ptr) ((FX_STRSIZE)wcslen(ptr))
+#define FXSYS_strlen(ptr) (strlen(ptr))
+#define FXSYS_wcslen(ptr) (wcslen(ptr))
#endif // __cplusplus
#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_