summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Stream.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-06-20 17:20:57 +0200
committerJay Berkenbilt <ejb@ql.org>2012-06-20 21:20:26 +0200
commit5d4cad9c02e9d4f31477fed0e3b20b35c83936f8 (patch)
tree38768f5e4a797e09de304b1e184021f5b280da29 /libqpdf/QPDF_Stream.cc
parent24e2b2b76f1f0051f240c8371b2352c4cde85bf9 (diff)
downloadqpdf-5d4cad9c02e9d4f31477fed0e3b20b35c83936f8.tar.zst
ABI change: fix use of off_t, size_t, and integer types
Significantly improve the code's use of off_t for file offsets, size_t for memory sizes, and integer types in cases where there has to be compatibility with external interfaces. Rework sections of the code that would have prevented qpdf from working on files larger than 2 (or maybe 4) GB in size.
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r--libqpdf/QPDF_Stream.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc
index dc8c7f93..dc6692bb 100644
--- a/libqpdf/QPDF_Stream.cc
+++ b/libqpdf/QPDF_Stream.cc
@@ -22,7 +22,7 @@ std::map<std::string, std::string> QPDF_Stream::filter_abbreviations;
QPDF_Stream::QPDF_Stream(QPDF* qpdf, int objid, int generation,
QPDFObjectHandle stream_dict,
- off_t offset, int length) :
+ off_t offset, size_t length) :
qpdf(qpdf),
objid(objid),
generation(generation),
@@ -379,8 +379,8 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool filter,
Pl_Count count("stream provider count", pipeline);
this->stream_provider->provideStreamData(
this->objid, this->generation, &count);
- size_t actual_length = count.getCount();
- size_t desired_length =
+ off_t actual_length = count.getCount();
+ off_t desired_length =
this->stream_dict.getKey("/Length").getIntValue();
if (actual_length == desired_length)
{
@@ -446,5 +446,5 @@ QPDF_Stream::replaceFilterData(QPDFObjectHandle const& filter,
this->stream_dict.replaceOrRemoveKey("/Filter", filter);
this->stream_dict.replaceOrRemoveKey("/DecodeParms", decode_parms);
this->stream_dict.replaceKey("/Length",
- QPDFObjectHandle::newInteger(length));
+ QPDFObjectHandle::newInteger((int)length));
}