From 8318d81ada86d4ec8e343c47103932b6bbe45a42 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 24 Jun 2012 15:26:28 -0400 Subject: Fix and test support for files >= 4 GB --- libqpdf/QPDF_linearization.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'libqpdf/QPDF_linearization.cc') diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index 48bb4d2b..fdd0d702 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -18,10 +18,10 @@ #include #include -template +template static void load_vector_int(BitStream& bit_stream, int nitems, std::vector& vec, - int bits_wanted, int T::*field) + int bits_wanted, int_type T::*field) { // nitems times, read bits_wanted from the given bit stream, // storing results in the ith vector entry. @@ -144,7 +144,7 @@ QPDF::isLinearized() QPDFObjectHandle L = candidate.getKey("/L"); if (L.isInteger()) { - int Li = L.getIntValue(); + qpdf_offset_t Li = L.getIntValue(); this->file->seek(0, SEEK_END); if (Li != this->file->tell()) { @@ -649,11 +649,11 @@ QPDF::maxEnd(ObjUser const& ou) return end; } -int +qpdf_offset_t QPDF::getLinearizationOffset(ObjGen const& og) { QPDFXRefEntry entry = this->xref_table[og]; - int result = 0; + qpdf_offset_t result = 0; switch (entry.getType()) { case 1: @@ -1787,7 +1787,7 @@ static inline int nbits(int val) int QPDF::outputLengthNextN( int in_object, int n, - std::map const& lengths, + std::map const& lengths, std::map const& obj_renumber) { // Figure out the length of a series of n consecutive objects in @@ -1808,7 +1808,7 @@ QPDF::outputLengthNextN( void QPDF::calculateHPageOffset( std::map const& xref, - std::map const& lengths, + std::map const& lengths, std::map const& obj_renumber) { // Page Offset Hint Table @@ -1900,7 +1900,7 @@ QPDF::calculateHPageOffset( void QPDF::calculateHSharedObject( std::map const& xref, - std::map const& lengths, + std::map const& lengths, std::map const& obj_renumber) { CHSharedObject& cso = this->c_shared_object_data; @@ -1946,7 +1946,7 @@ QPDF::calculateHSharedObject( void QPDF::calculateHOutline( std::map const& xref, - std::map const& lengths, + std::map const& lengths, std::map const& obj_renumber) { HGeneric& cho = this->c_outline_data; @@ -1967,10 +1967,10 @@ QPDF::calculateHOutline( cho.first_object, ho.nobjects, lengths, obj_renumber); } -template +template static void write_vector_int(BitWriter& w, int nitems, std::vector& vec, - int bits, int T::*field) + int bits, int_type T::*field) { // nitems times, write bits bits from the given field of the ith // vector to the given bit writer. @@ -2095,7 +2095,7 @@ QPDF::writeHGeneric(BitWriter& w, HGeneric& t) void QPDF::generateHintStream(std::map const& xref, - std::map const& lengths, + std::map const& lengths, std::map const& obj_renumber, PointerHolder& hint_buffer, int& S, int& O) -- cgit v1.2.3-54-g00ecf