diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-05 15:33:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-06 13:53:19 +0000 |
commit | 81f9eeef041f2974274751d7508598049ae32db2 (patch) | |
tree | 00bdcdddc9d141e4929005a14372bde65c68ee81 /core/fxcrt/fx_system.h | |
parent | 3ef61c73a97b31000a21e323e04ad5397e517c4c (diff) | |
download | pdfium-81f9eeef041f2974274751d7508598049ae32db2.tar.xz |
Convert FX_STRSIZE int->size_t
Change the underlying type for FX_STRSIZE to size_t from int. This
will make the value unsigned and thus all values in the range of the
type will be valid. This allows for the final remove of negative
length strings, but also introduces a some casting and functional
errors, since many parts of the code base assume that FX_STRSIZE is
int or another signed type. This also CL fixes these errors.
BUG=pdfium:828
Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b
Reviewed-on: https://pdfium-review.googlesource.com/11830
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_system.h')
-rw-r--r-- | core/fxcrt/fx_system.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h index 1f63e6d9aa..600d71c72b 100644 --- a/core/fxcrt/fx_system.h +++ b/core/fxcrt/fx_system.h @@ -76,10 +76,9 @@ extern "C" { #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) -// PDFium string sizes are limited to 2^31-1, and the value is signed to -// allow -1 as a placeholder for "unknown". -// TODO(palmer): it should be a |size_t|, or at least unsigned. -typedef int FX_STRSIZE; +// 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 |