From 81e8752362eeab80f156eb74d1b523eba20a0366 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 21 Jun 2012 19:32:21 -0400 Subject: Use qpdf_offset_t in place of off_t in public APIs. off_t is used internally only when needed to talk to standard libraries. This requires that the "long long" type be supported by the compiler. --- libqpdf/Pl_Count.cc | 2 +- libqpdf/QPDF.cc | 70 +++++++++++++++++++++++-------------------- libqpdf/QPDFExc.cc | 6 ++-- libqpdf/QPDFObjectHandle.cc | 2 +- libqpdf/QPDFWriter.cc | 54 +++++++++++++++++---------------- libqpdf/QPDFXRefEntry.cc | 4 +-- libqpdf/QPDF_Stream.cc | 6 ++-- libqpdf/QPDF_linearization.cc | 8 ++--- libqpdf/QUtil.cc | 22 ++++++++++---- libqpdf/qpdf/QPDF_Stream.hh | 4 +-- 10 files changed, 97 insertions(+), 81 deletions(-) (limited to 'libqpdf') diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc index 78516343..c76a5e23 100644 --- a/libqpdf/Pl_Count.cc +++ b/libqpdf/Pl_Count.cc @@ -28,7 +28,7 @@ Pl_Count::finish() getNext()->finish(); } -off_t +qpdf_offset_t Pl_Count::getCount() const { return this->count; diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index dd572fd3..e97da295 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -18,12 +18,12 @@ std::string QPDF::qpdf_version = "2.3.1"; void -QPDF::InputSource::setLastOffset(off_t offset) +QPDF::InputSource::setLastOffset(qpdf_offset_t offset) { this->last_offset = offset; } -off_t +qpdf_offset_t QPDF::InputSource::getLastOffset() const { return this->last_offset; @@ -36,7 +36,7 @@ QPDF::InputSource::readLine() // without caring what the exact terminator is. Consume the // trailing newline characters but don't return them. - off_t offset = this->tell(); + qpdf_offset_t offset = this->tell(); std::string buf; enum { st_before_nl, st_at_nl } state = st_before_nl; char ch; @@ -126,14 +126,14 @@ QPDF::FileInputSource::getName() const return this->filename; } -off_t +qpdf_offset_t QPDF::FileInputSource::tell() { return QUtil::ftell_off_t(this->file); } void -QPDF::FileInputSource::seek(off_t offset, int whence) +QPDF::FileInputSource::seek(qpdf_offset_t offset, int whence) { QUtil::os_wrapper(std::string("seek to ") + this->filename + ", offset " + QUtil::int_to_string(offset) + " (" + @@ -193,14 +193,14 @@ QPDF::BufferInputSource::getName() const return this->description; } -off_t +qpdf_offset_t QPDF::BufferInputSource::tell() { return this->cur_offset; } void -QPDF::BufferInputSource::seek(off_t offset, int whence) +QPDF::BufferInputSource::seek(qpdf_offset_t offset, int whence) { switch (whence) { @@ -209,7 +209,7 @@ QPDF::BufferInputSource::seek(off_t offset, int whence) break; case SEEK_END: - this->cur_offset = (off_t)this->buf->getSize() + offset; + this->cur_offset = (qpdf_offset_t)this->buf->getSize() + offset; break; case SEEK_CUR: @@ -232,7 +232,7 @@ QPDF::BufferInputSource::rewind() size_t QPDF::BufferInputSource::read(char* buffer, size_t length) { - off_t end_pos = (off_t) this->buf->getSize(); + qpdf_offset_t end_pos = (qpdf_offset_t) this->buf->getSize(); if (this->cur_offset >= end_pos) { this->last_offset = end_pos; @@ -453,7 +453,7 @@ QPDF::parse(char const* password) throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, "can't find startxref"); } - off_t xref_offset = atol(m2.getMatch(1).c_str()); + qpdf_offset_t xref_offset = QUtil::string_to_ll(m2.getMatch(1).c_str()); read_xref(xref_offset); } catch (QPDFExc& e) @@ -524,7 +524,7 @@ QPDF::reconstruct_xref(QPDFExc& e) } this->file->seek(0, SEEK_END); - off_t eof = this->file->tell(); + qpdf_offset_t eof = this->file->tell(); this->file->seek(0, SEEK_SET); bool in_obj = false; while (this->file->tell() < eof) @@ -591,7 +591,7 @@ QPDF::reconstruct_xref(QPDFExc& e) } void -QPDF::read_xref(off_t xref_offset) +QPDF::read_xref(qpdf_offset_t xref_offset) { std::map free_table; while (xref_offset) @@ -634,7 +634,7 @@ QPDF::read_xref(off_t xref_offset) } int -QPDF::read_xrefTable(off_t xref_offset) +QPDF::read_xrefTable(qpdf_offset_t xref_offset) { PCRE xref_first_re("^\\s*(\\d+)\\s+(\\d+)"); PCRE xref_entry_re("(?s:(^\\d{10}) (\\d{5}) ([fn])[ \r\n]{2}$)"); @@ -692,7 +692,7 @@ QPDF::read_xrefTable(off_t xref_offset) insertXrefEntry(i, 1, f1, f2); } } - off_t pos = this->file->tell(); + qpdf_offset_t pos = this->file->tell(); QPDFTokenizer::Token t = readToken(this->file); if (t == QPDFTokenizer::Token(QPDFTokenizer::tt_word, "trailer")) { @@ -791,7 +791,7 @@ QPDF::read_xrefTable(off_t xref_offset) } int -QPDF::read_xrefStream(off_t xref_offset) +QPDF::read_xrefStream(qpdf_offset_t xref_offset) { bool found = false; if (! this->ignore_xref_streams) @@ -830,7 +830,7 @@ QPDF::read_xrefStream(off_t xref_offset) } int -QPDF::processXRefStream(off_t xref_offset, QPDFObjectHandle& xref_obj) +QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) { QPDFObjectHandle dict = xref_obj.getDict(); QPDFObjectHandle W_obj = dict.getKey("/W"); @@ -1123,7 +1123,7 @@ QPDF::readObject(PointerHolder input, int objid, int generation, bool in_object_stream) { setLastObjectDescription(description, objid, generation); - off_t offset = input->tell(); + qpdf_offset_t offset = input->tell(); QPDFObjectHandle object = readObjectInternal( input, objid, generation, in_object_stream, false, false); // Override last_offset so that it points to the beginning of the @@ -1149,7 +1149,7 @@ QPDF::readObjectInternal(PointerHolder input, QPDFObjectHandle object; - off_t offset = input->tell(); + qpdf_offset_t offset = input->tell(); std::vector olist; bool done = false; while (! done) @@ -1347,7 +1347,7 @@ QPDF::readObjectInternal(PointerHolder input, if (! in_object_stream) { // check for stream - off_t cur_offset = input->tell(); + qpdf_offset_t cur_offset = input->tell(); if (readToken(input) == QPDFTokenizer::Token(QPDFTokenizer::tt_word, "stream")) { @@ -1416,7 +1416,7 @@ QPDF::readObjectInternal(PointerHolder input, // Must get offset before accessing any additional // objects since resolving a previously unresolved // indirect object will change file position. - off_t stream_offset = input->tell(); + qpdf_offset_t stream_offset = input->tell(); size_t length = 0; try @@ -1440,7 +1440,8 @@ QPDF::readObjectInternal(PointerHolder input, } length = length_obj.getIntValue(); - input->seek(stream_offset + (off_t)length, SEEK_SET); + input->seek( + stream_offset + (qpdf_offset_t)length, SEEK_SET); if (! (readToken(input) == QPDFTokenizer::Token( QPDFTokenizer::tt_word, "endstream"))) @@ -1480,7 +1481,8 @@ QPDF::readObjectInternal(PointerHolder input, size_t QPDF::recoverStreamLength(PointerHolder input, - int objid, int generation, off_t stream_offset) + int objid, int generation, + qpdf_offset_t stream_offset) { PCRE endobj_re("^\\s*endobj\\b"); @@ -1491,10 +1493,10 @@ QPDF::recoverStreamLength(PointerHolder input, "attempting to recover stream length")); input->seek(0, SEEK_END); - off_t eof = input->tell(); + qpdf_offset_t eof = input->tell(); input->seek(stream_offset, SEEK_SET); std::string last_line; - off_t last_line_offset = 0; + qpdf_offset_t last_line_offset = 0; size_t length = 0; while (input->tell() < eof) { @@ -1568,7 +1570,7 @@ QPDF::recoverStreamLength(PointerHolder input, QPDFTokenizer::Token QPDF::readToken(PointerHolder input) { - off_t offset = input->tell(); + qpdf_offset_t offset = input->tell(); QPDFTokenizer::Token token; bool unread_char; char char_to_unread; @@ -1611,7 +1613,7 @@ QPDF::readToken(PointerHolder input) QPDFObjectHandle QPDF::readObjectAtOffset(bool try_recovery, - off_t offset, std::string const& description, + qpdf_offset_t offset, std::string const& description, int exp_objid, int exp_generation, int& objid, int& generation) { @@ -1663,7 +1665,7 @@ QPDF::readObjectAtOffset(bool try_recovery, if (this->xref_table.count(og) && (this->xref_table[og].getType() == 1)) { - off_t new_offset = this->xref_table[og].getOffset(); + qpdf_offset_t new_offset = this->xref_table[og].getOffset(); QPDFObjectHandle result = readObjectAtOffset( false, new_offset, description, exp_objid, exp_generation, objid, generation); @@ -1717,7 +1719,7 @@ QPDF::readObjectAtOffset(bool try_recovery, // linearization hint tables. Offsets and lengths of objects // may imply the end of an object to be anywhere between these // values. - off_t end_before_space = this->file->tell(); + qpdf_offset_t end_before_space = this->file->tell(); // skip over spaces while (true) @@ -1738,7 +1740,7 @@ QPDF::readObjectAtOffset(bool try_recovery, "EOF after endobj"); } } - off_t end_after_space = this->file->tell(); + qpdf_offset_t end_after_space = this->file->tell(); this->obj_cache[og] = ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), @@ -1768,7 +1770,7 @@ QPDF::resolve(int objid, int generation) { case 1: { - off_t offset = entry.getOffset(); + qpdf_offset_t offset = entry.getOffset(); // Object stored in cache by readObjectAtOffset int aobjid; int ageneration; @@ -1812,8 +1814,10 @@ QPDF::resolveObjectsInStream(int obj_stream_number) // For linearization data in the object, use the data from the // object stream for the objects in the stream. ObjGen stream_og(obj_stream_number, 0); - off_t end_before_space = this->obj_cache[stream_og].end_before_space; - off_t end_after_space = this->obj_cache[stream_og].end_after_space; + qpdf_offset_t end_before_space = + this->obj_cache[stream_og].end_before_space; + qpdf_offset_t end_after_space = + this->obj_cache[stream_og].end_after_space; QPDFObjectHandle dict = obj_stream.getDict(); if (! (dict.getKey("/Type").isName() && @@ -2102,7 +2106,7 @@ QPDF::getCompressibleObjects() void QPDF::pipeStreamData(int objid, int generation, - off_t offset, size_t length, + qpdf_offset_t offset, size_t length, QPDFObjectHandle stream_dict, Pipeline* pipeline) { diff --git a/libqpdf/QPDFExc.cc b/libqpdf/QPDFExc.cc index 1fc9d724..8bbfb0b4 100644 --- a/libqpdf/QPDFExc.cc +++ b/libqpdf/QPDFExc.cc @@ -4,7 +4,7 @@ QPDFExc::QPDFExc(qpdf_error_code_e error_code, std::string const& filename, std::string const& object, - off_t offset, + qpdf_offset_t offset, std::string const& message) : std::runtime_error(createWhat(filename, object, offset, message)), error_code(error_code), @@ -22,7 +22,7 @@ QPDFExc::~QPDFExc() throw () std::string QPDFExc::createWhat(std::string const& filename, std::string const& object, - off_t offset, + qpdf_offset_t offset, std::string const& message) { std::string result; @@ -73,7 +73,7 @@ QPDFExc::getObject() const return this->object; } -off_t +qpdf_offset_t QPDFExc::getFilePosition() const { return this->offset; diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 4e28c405..1c2481f8 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -632,7 +632,7 @@ QPDFObjectHandle::newDictionary( QPDFObjectHandle QPDFObjectHandle::newStream(QPDF* qpdf, int objid, int generation, QPDFObjectHandle stream_dict, - off_t offset, size_t length) + qpdf_offset_t offset, size_t length) { return QPDFObjectHandle(new QPDF_Stream( qpdf, objid, generation, diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 2de7d724..3a08c726 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -879,7 +879,7 @@ QPDFWriter::writeTrailer(trailer_e which, int size, bool xref_stream, int prev) if (which == t_lin_first) { writeString(" /Prev "); - off_t pos = this->pipeline->getCount(); + qpdf_offset_t pos = this->pipeline->getCount(); writeString(QUtil::int_to_string(prev)); int nspaces = (int)(pos - this->pipeline->getCount() + 11); assert(nspaces >= 0); @@ -1165,7 +1165,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level, } void -QPDFWriter::writeObjectStreamOffsets(std::vector& offsets, +QPDFWriter::writeObjectStreamOffsets(std::vector& offsets, int first_obj) { for (unsigned int i = 0; i < offsets.size(); ++i) @@ -1191,8 +1191,8 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) int old_id = object.getObjectID(); int new_id = obj_renumber[old_id]; - std::vector offsets; - off_t first = 0; + std::vector offsets; + qpdf_offset_t first = 0; // Generate stream itself. We have to do this in two passes so we // can calculate offsets in the first pass. @@ -1210,7 +1210,7 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) // Adjust offsets to skip over comment before first object first = offsets[0]; - for (std::vector::iterator iter = offsets.begin(); + for (std::vector::iterator iter = offsets.begin(); iter != offsets.end(); ++iter) { *iter -= first; @@ -1820,13 +1820,14 @@ QPDFWriter::writeXRefTable(trailer_e which, int first, int last, int size) int QPDFWriter::writeXRefTable(trailer_e which, int first, int last, int size, int prev, bool suppress_offsets, - int hint_id, off_t hint_offset, off_t hint_length) + int hint_id, qpdf_offset_t hint_offset, + qpdf_offset_t hint_length) { writeString("xref\n"); writeString(QUtil::int_to_string(first)); writeString(" "); writeString(QUtil::int_to_string(last - first + 1)); - off_t space_before_zero = this->pipeline->getCount(); + qpdf_offset_t space_before_zero = this->pipeline->getCount(); writeString("\n"); for (int i = first; i <= last; ++i) { @@ -1868,10 +1869,11 @@ int QPDFWriter::writeXRefStream(int xref_id, int max_id, int max_offset, trailer_e which, int first, int last, int size, int prev, int hint_id, - off_t hint_offset, off_t hint_length, + qpdf_offset_t hint_offset, + qpdf_offset_t hint_length, bool skip_compression) { - off_t xref_offset = this->pipeline->getCount(); + qpdf_offset_t xref_offset = this->pipeline->getCount(); int space_before_zero = xref_offset - 1; // field 1 contains offsets and object stream identifiers @@ -2081,13 +2083,13 @@ QPDFWriter::writeLinearized() int part4_end_marker = part4.back().getObjectID(); int part6_end_marker = part6.back().getObjectID(); - off_t space_before_zero = 0; - off_t file_size = 0; - off_t part6_end_offset = 0; - off_t first_half_max_obj_offset = 0; - off_t second_xref_offset = 0; - off_t first_xref_end = 0; - off_t second_xref_end = 0; + qpdf_offset_t space_before_zero = 0; + qpdf_offset_t file_size = 0; + qpdf_offset_t part6_end_offset = 0; + qpdf_offset_t first_half_max_obj_offset = 0; + qpdf_offset_t second_xref_offset = 0; + qpdf_offset_t first_xref_end = 0; + qpdf_offset_t second_xref_end = 0; this->next_objid = part4_first_obj; enqueuePart(part4); @@ -2101,7 +2103,7 @@ QPDFWriter::writeLinearized() enqueuePart(part9); assert(this->next_objid == after_second_half); - off_t hint_length = 0; + qpdf_offset_t hint_length = 0; PointerHolder hint_buffer; // Write file in two passes. Part numbers refer to PDF spec 1.4. @@ -2122,7 +2124,7 @@ QPDFWriter::writeLinearized() // space if all numerical values in the parameter dictionary // are 10 digits long plus a few extra characters for safety. - off_t pos = this->pipeline->getCount(); + qpdf_offset_t pos = this->pipeline->getCount(); openObject(lindict_id); writeString("<<"); if (pass == 2) @@ -2158,8 +2160,8 @@ QPDFWriter::writeLinearized() // Part 3: first page cross reference table and trailer. - off_t first_xref_offset = this->pipeline->getCount(); - off_t hint_offset = 0; + qpdf_offset_t first_xref_offset = this->pipeline->getCount(); + qpdf_offset_t hint_offset = 0; if (pass == 2) { hint_offset = this->xref[hint_id].getOffset(); @@ -2187,7 +2189,7 @@ QPDFWriter::writeLinearized() hint_length + second_xref_offset, hint_id, hint_offset, hint_length, (pass == 1)); - off_t endpos = this->pipeline->getCount(); + qpdf_offset_t endpos = this->pipeline->getCount(); if (pass == 1) { // Pad so we have enough room for the real xref @@ -2264,7 +2266,7 @@ QPDFWriter::writeLinearized() t_lin_second, 0, second_half_end, second_trailer_size, 0, 0, 0, 0, (pass == 1)); - off_t endpos = this->pipeline->getCount(); + qpdf_offset_t endpos = this->pipeline->getCount(); if (pass == 1) { @@ -2278,14 +2280,14 @@ QPDFWriter::writeLinearized() else { // Make the file size the same. - off_t pos = this->pipeline->getCount(); + qpdf_offset_t pos = this->pipeline->getCount(); writePad(second_xref_end + hint_length - 1 - pos); writeString("\n"); // If this assertion fails, maybe we didn't have // enough padding above. assert(this->pipeline->getCount() == - (off_t)(second_xref_end + hint_length)); + (qpdf_offset_t)(second_xref_end + hint_length)); } } else @@ -2313,7 +2315,7 @@ QPDFWriter::writeLinearized() activatePipelineStack(); writeHintStream(hint_id); popPipelineStack(&hint_buffer); - hint_length = (off_t)hint_buffer->getSize(); + hint_length = (qpdf_offset_t)hint_buffer->getSize(); // Restore hint offset this->xref[hint_id] = QPDFXRefEntry(1, hint_offset, 0); @@ -2358,7 +2360,7 @@ QPDFWriter::writeStandard() } // Now write out xref. next_objid is now the number of objects. - off_t xref_offset = this->pipeline->getCount(); + qpdf_offset_t xref_offset = this->pipeline->getCount(); if (this->object_stream_to_objects.empty()) { // Write regular cross-reference table diff --git a/libqpdf/QPDFXRefEntry.cc b/libqpdf/QPDFXRefEntry.cc index dea3aab6..847fc8e6 100644 --- a/libqpdf/QPDFXRefEntry.cc +++ b/libqpdf/QPDFXRefEntry.cc @@ -9,7 +9,7 @@ QPDFXRefEntry::QPDFXRefEntry() : { } -QPDFXRefEntry::QPDFXRefEntry(int type, off_t field1, int field2) : +QPDFXRefEntry::QPDFXRefEntry(int type, qpdf_offset_t field1, int field2) : type(type), field1(field1), field2(field2) @@ -27,7 +27,7 @@ QPDFXRefEntry::getType() const return this->type; } -off_t +qpdf_offset_t QPDFXRefEntry::getOffset() const { if (this->type != 1) diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index dc6692bb..ed5fb5be 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -22,7 +22,7 @@ std::map QPDF_Stream::filter_abbreviations; QPDF_Stream::QPDF_Stream(QPDF* qpdf, int objid, int generation, QPDFObjectHandle stream_dict, - off_t offset, size_t length) : + qpdf_offset_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); - off_t actual_length = count.getCount(); - off_t desired_length = + qpdf_offset_t actual_length = count.getCount(); + qpdf_offset_t desired_length = this->stream_dict.getKey("/Length").getIntValue(); if (actual_length == desired_length) { diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index d4e98dde..48bb4d2b 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -305,15 +305,15 @@ QPDF::readLinearizationData() } QPDFObjectHandle -QPDF::readHintStream(Pipeline& pl, off_t offset, size_t length) +QPDF::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) { int obj; int gen; QPDFObjectHandle H = readObjectAtOffset( false, offset, "linearization hint stream", -1, 0, obj, gen); ObjCache& oc = this->obj_cache[ObjGen(obj, gen)]; - off_t min_end_offset = oc.end_before_space; - off_t max_end_offset = oc.end_after_space; + qpdf_offset_t min_end_offset = oc.end_before_space; + qpdf_offset_t max_end_offset = oc.end_after_space; if (! H.isStream()) { throw QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), @@ -345,7 +345,7 @@ QPDF::readHintStream(Pipeline& pl, off_t offset, size_t length) { QTC::TC("qpdf", "QPDF hint table length direct"); } - off_t computed_end = offset + (off_t)length; + qpdf_offset_t computed_end = offset + (qpdf_offset_t)length; if ((computed_end < min_end_offset) || (computed_end > max_end_offset)) { diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index e1071940..3c3bf011 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -82,6 +82,16 @@ QUtil::double_to_string(double num, int decimal_places) return std::string(t); } +long long +QUtil::string_to_ll(char const* str) +{ +#ifdef _MSC_VER + return _strtoi64(str, 0, 10); +#else + return strtoll(str, 0, 10); +#endif +} + void QUtil::throw_system_error(std::string const& description) { @@ -109,22 +119,22 @@ QUtil::fopen_wrapper(std::string const& description, FILE* f) } int -QUtil::fseek_off_t(FILE* stream, off_t offset, int whence) +QUtil::fseek_off_t(FILE* stream, qpdf_offset_t offset, int whence) { #if HAVE_FSEEKO - return fseeko(stream, offset, whence); + return fseeko(stream, (off_t)offset, whence); #else - return fseek(stream, offset, whence); + return fseek(stream, (long)offset, whence); #endif } -off_t +qpdf_offset_t QUtil::ftell_off_t(FILE* stream) { #if HAVE_FSEEKO - return ftello(stream); + return (qpdf_offset_t)ftello(stream); #else - return ftell(stream); + return (qpdf_offset_t)ftell(stream); #endif } diff --git a/libqpdf/qpdf/QPDF_Stream.hh b/libqpdf/qpdf/QPDF_Stream.hh index 49db4d47..e74ae201 100644 --- a/libqpdf/qpdf/QPDF_Stream.hh +++ b/libqpdf/qpdf/QPDF_Stream.hh @@ -14,7 +14,7 @@ class QPDF_Stream: public QPDFObject public: QPDF_Stream(QPDF*, int objid, int generation, QPDFObjectHandle stream_dict, - off_t offset, size_t length); + qpdf_offset_t offset, size_t length); virtual ~QPDF_Stream(); virtual std::string unparse(); QPDFObjectHandle getDict() const; @@ -51,7 +51,7 @@ class QPDF_Stream: public QPDFObject int objid; int generation; QPDFObjectHandle stream_dict; - off_t offset; + qpdf_offset_t offset; size_t length; PointerHolder stream_data; PointerHolder stream_provider; -- cgit v1.2.3-54-g00ecf