diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-02-24 03:46:21 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-03-04 22:45:16 +0100 |
commit | 30027481f7f9e9191f7c8deea51850b7a76b1b1f (patch) | |
tree | 815af293c2f6e38994e6096a4499be0dc9a476f9 /include | |
parent | babb47948a408ebad12c452ba3fdd78782360167 (diff) | |
download | qpdf-30027481f7f9e9191f7c8deea51850b7a76b1b1f.tar.zst |
Remove all old-style casts from C++ code
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDF.hh | 2 | ||||
-rw-r--r-- | include/qpdf/QUtil.hh | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index eab64072..a1644f84 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -931,7 +931,7 @@ class QPDF void readHPageOffset(BitStream); void readHSharedObject(BitStream); void readHGeneric(BitStream, HGeneric&); - int maxEnd(ObjUser const& ou); + qpdf_offset_t maxEnd(ObjUser const& ou); qpdf_offset_t getLinearizationOffset(ObjGen const&); QPDFObjectHandle getUncompressedObject( QPDFObjectHandle&, std::map<int, int> const& object_stream_data); diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index 9639917d..5b71a362 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -27,6 +27,17 @@ namespace QUtil QPDF_DLL long long string_to_ll(char const* str); + // Pipeline's write method wants unsigned char*, but we often have + // some other type of string. These methods do combinations of + // const_cast and reinterpret_cast to give us an unsigned char*. + // They should only be used when it is known that it is safe. + // None of the pipelines in qpdf modify the data passed to them, + // so within qpdf, it should always be safe. + QPDF_DLL + unsigned char* unsigned_char_pointer(std::string const& str); + QPDF_DLL + unsigned char* unsigned_char_pointer(char const* str); + // Throw std::runtime_error with a string formed by appending to // "description: " the standard string corresponding to the // current value of errno. |