diff options
author | Jay Berkenbilt <ejb@ql.org> | 2012-06-20 17:20:57 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-06-20 21:20:26 +0200 |
commit | 5d4cad9c02e9d4f31477fed0e3b20b35c83936f8 (patch) | |
tree | 38768f5e4a797e09de304b1e184021f5b280da29 /include/qpdf/Buffer.hh | |
parent | 24e2b2b76f1f0051f240c8371b2352c4cde85bf9 (diff) | |
download | qpdf-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 'include/qpdf/Buffer.hh')
-rw-r--r-- | include/qpdf/Buffer.hh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/qpdf/Buffer.hh b/include/qpdf/Buffer.hh index 31db93e2..234d6ec0 100644 --- a/include/qpdf/Buffer.hh +++ b/include/qpdf/Buffer.hh @@ -9,6 +9,7 @@ #define __BUFFER_HH__ #include <qpdf/DLL.h> +#include <cstring> // for size_t class Buffer { @@ -19,12 +20,12 @@ class Buffer // Create a Buffer object whose memory is owned by the class and // will be freed when the Buffer object is destroyed. QPDF_DLL - Buffer(unsigned long size); + Buffer(size_t size); // Create a Buffer object whose memory is owned by the caller and // will not be freed when the Buffer is destroyed. QPDF_DLL - Buffer(unsigned char* buf, unsigned long size); + Buffer(unsigned char* buf, size_t size); QPDF_DLL Buffer(Buffer const&); @@ -33,19 +34,19 @@ class Buffer QPDF_DLL ~Buffer(); QPDF_DLL - unsigned long getSize() const; + size_t getSize() const; QPDF_DLL unsigned char const* getBuffer() const; QPDF_DLL unsigned char* getBuffer(); private: - void init(unsigned long size, unsigned char* buf, bool own_memory); + void init(size_t size, unsigned char* buf, bool own_memory); void copy(Buffer const&); void destroy(); bool own_memory; - unsigned long size; + size_t size; unsigned char* buf; }; |