summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
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/fpdfapi/page
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/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_streamparser.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 4c08336e3a..d722c22fb5 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -171,7 +171,7 @@ void CPDF_Image::SetImage(const RetainPtr<CFX_DIBitmap>& pBitmap) {
pDict->SetNewFor<CPDF_Number>("Height", BitmapHeight);
const int32_t bpp = pBitmap->GetBPP();
- FX_STRSIZE dest_pitch = 0;
+ size_t dest_pitch = 0;
bool bCopyWithoutAlpha = true;
if (bpp == 1) {
int32_t reset_a = 0;
@@ -285,7 +285,7 @@ void CPDF_Image::SetImage(const RetainPtr<CFX_DIBitmap>& pBitmap) {
int32_t src_pitch = pBitmap->GetPitch();
uint8_t* dest_buf = FX_Alloc2D(uint8_t, dest_pitch, BitmapHeight);
// Safe as checked alloc returned.
- FX_STRSIZE dest_size = dest_pitch * BitmapHeight;
+ size_t dest_size = dest_pitch * BitmapHeight;
uint8_t* pDest = dest_buf;
if (bCopyWithoutAlpha) {
for (int32_t i = 0; i < BitmapHeight; i++) {
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index e9320cbc6f..aa1d227de0 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -34,7 +34,7 @@ namespace {
const uint32_t kMaxNestedParsingLevel = 512;
const uint32_t kMaxWordBuffer = 256;
-const FX_STRSIZE kMaxStringLength = 32767;
+const size_t kMaxStringLength = 32767;
uint32_t DecodeAllScanlines(std::unique_ptr<CCodec_ScanlineDecoder> pDecoder,
uint8_t** dest_buf,
@@ -478,9 +478,9 @@ ByteString CPDF_StreamParser::ReadString() {
case 0:
if (ch == ')') {
if (parlevel == 0) {
- return ByteString(buf.str().c_str(),
- std::min(static_cast<FX_STRSIZE>(buf.tellp()),
- kMaxStringLength));
+ return ByteString(
+ buf.str().c_str(),
+ std::min(static_cast<size_t>(buf.tellp()), kMaxStringLength));
}
parlevel--;
buf << ')';
@@ -557,7 +557,7 @@ ByteString CPDF_StreamParser::ReadString() {
return ByteString(
buf.str().c_str(),
- std::min(static_cast<FX_STRSIZE>(buf.tellp()), kMaxStringLength));
+ std::min(static_cast<size_t>(buf.tellp()), kMaxStringLength));
}
ByteString CPDF_StreamParser::ReadHexString() {
@@ -590,7 +590,7 @@ ByteString CPDF_StreamParser::ReadHexString() {
return ByteString(
buf.str().c_str(),
- std::min(static_cast<FX_STRSIZE>(buf.tellp()), kMaxStringLength));
+ std::min(static_cast<size_t>(buf.tellp()), kMaxStringLength));
}
bool CPDF_StreamParser::PositionIsInBounds() const {