Commit 9044a24097565c1a8eb542ae0eabb2539b3cc62b

Authored by Jay Berkenbilt
1 parent f727bc94

PointerHolder: deprecate getPointer() and getRefcount()

Use get() and use_count() instead. Add #define
NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these
only.

This commit also removes all deprecated PointerHolder API calls from
qpdf's code except in PointerHolder's test suite, which must continue
to test the deprecated APIs.
ChangeLog
1 1 2022-02-04 Jay Berkenbilt <ejb@ql.org>
2 2  
  3 + * PointerHolder: deprecate getPointer() and getRefcount(). If you
  4 + don't want to disable deprecation warnings in general but are not
  5 + ready to tackle this change yet, you can define
  6 + NO_POINTERHOLDER_DEPRECATION to suppress those.
  7 +
3 8 * PointerHolder: add a get() method and a use_count() method for
4 9 compatibility with std::shared_ptr. In qpdf 11, qpdf's APIs will
5 10 switch to using std::shared_ptr instead of PointerHolder, though
... ...
fuzz/standalone_fuzz_target_runner.cc
... ... @@ -12,7 +12,7 @@ int main(int argc, char **argv)
12 12 size_t size = 0;
13 13 QUtil::read_file_into_memory(argv[i], file_buf, size);
14 14 LLVMFuzzerTestOneInput(
15   - reinterpret_cast<unsigned char*>(file_buf.getPointer()), size);
  15 + reinterpret_cast<unsigned char*>(file_buf.get()), size);
16 16 std::cout << argv[i] << " successful" << std::endl;
17 17 }
18 18 return 0;
... ...
include/qpdf/PointerHolder.hh
... ... @@ -135,14 +135,23 @@ class PointerHolder
135 135  
136 136 // NOTE: The pointer returned by getPointer turns into a pumpkin
137 137 // when the last PointerHolder that contains it disappears.
  138 +#ifndef NO_POINTERHOLDER_DEPRECATION
  139 + [[deprecated("use PointerHolder<T>::get() instead of getPointer()")]]
  140 +#endif
138 141 T* getPointer()
139 142 {
140 143 return this->data->pointer;
141 144 }
  145 +#ifndef NO_POINTERHOLDER_DEPRECATION
  146 + [[deprecated("use PointerHolder<T>::get() instead of getPointer()")]]
  147 +#endif
142 148 T const* getPointer() const
143 149 {
144 150 return this->data->pointer;
145 151 }
  152 +#ifndef NO_POINTERHOLDER_DEPRECATION
  153 + [[deprecated("use use_count() instead of getRefcount()")]]
  154 +#endif
146 155 int getRefcount() const
147 156 {
148 157 return this->data->refcount;
... ...
libqpdf/ClosedFileInputSource.cc
... ... @@ -24,7 +24,7 @@ ClosedFileInputSource::~ClosedFileInputSource()
24 24 void
25 25 ClosedFileInputSource::before()
26 26 {
27   - if (0 == this->m->fis.getPointer())
  27 + if (0 == this->m->fis.get())
28 28 {
29 29 this->m->fis = new FileInputSource();
30 30 this->m->fis->setFilename(this->m->filename.c_str());
... ... @@ -81,7 +81,7 @@ void
81 81 ClosedFileInputSource::rewind()
82 82 {
83 83 this->m->offset = 0;
84   - if (this->m->fis.getPointer())
  84 + if (this->m->fis.get())
85 85 {
86 86 this->m->fis->rewind();
87 87 }
... ... @@ -109,7 +109,7 @@ void
109 109 ClosedFileInputSource::stayOpen(bool val)
110 110 {
111 111 this->m->stay_open = val;
112   - if ((! val) && this->m->fis.getPointer())
  112 + if ((! val) && this->m->fis.get())
113 113 {
114 114 after();
115 115 }
... ...
libqpdf/JSON.cc
... ... @@ -154,7 +154,7 @@ std::string JSON::JSON_null::unparse(size_t) const
154 154 std::string
155 155 JSON::unparse() const
156 156 {
157   - if (0 == this->m->value.getPointer())
  157 + if (0 == this->m->value.get())
158 158 {
159 159 return "null";
160 160 }
... ... @@ -219,13 +219,13 @@ JSON
219 219 JSON::addDictionaryMember(std::string const& key, JSON const& val)
220 220 {
221 221 JSON_dictionary* obj = dynamic_cast<JSON_dictionary*>(
222   - this->m->value.getPointer());
  222 + this->m->value.get());
223 223 if (0 == obj)
224 224 {
225 225 throw std::runtime_error(
226 226 "JSON::addDictionaryMember called on non-dictionary");
227 227 }
228   - if (val.m->value.getPointer())
  228 + if (val.m->value.get())
229 229 {
230 230 obj->members[encode_string(key)] = val.m->value;
231 231 }
... ... @@ -246,12 +246,12 @@ JSON
246 246 JSON::addArrayElement(JSON const& val)
247 247 {
248 248 JSON_array* arr = dynamic_cast<JSON_array*>(
249   - this->m->value.getPointer());
  249 + this->m->value.get());
250 250 if (0 == arr)
251 251 {
252 252 throw std::runtime_error("JSON::addArrayElement called on non-array");
253 253 }
254   - if (val.m->value.getPointer())
  254 + if (val.m->value.get())
255 255 {
256 256 arr->elements.push_back(val.m->value);
257 257 }
... ... @@ -302,20 +302,20 @@ bool
302 302 JSON::isArray() const
303 303 {
304 304 return nullptr != dynamic_cast<JSON_array const*>(
305   - this->m->value.getPointer());
  305 + this->m->value.get());
306 306 }
307 307  
308 308 bool
309 309 JSON::isDictionary() const
310 310 {
311 311 return nullptr != dynamic_cast<JSON_dictionary const*>(
312   - this->m->value.getPointer());
  312 + this->m->value.get());
313 313 }
314 314  
315 315 bool
316 316 JSON::getString(std::string& utf8) const
317 317 {
318   - auto v = dynamic_cast<JSON_string const*>(this->m->value.getPointer());
  318 + auto v = dynamic_cast<JSON_string const*>(this->m->value.get());
319 319 if (v == nullptr)
320 320 {
321 321 return false;
... ... @@ -327,7 +327,7 @@ JSON::getString(std::string&amp; utf8) const
327 327 bool
328 328 JSON::getNumber(std::string& value) const
329 329 {
330   - auto v = dynamic_cast<JSON_number const*>(this->m->value.getPointer());
  330 + auto v = dynamic_cast<JSON_number const*>(this->m->value.get());
331 331 if (v == nullptr)
332 332 {
333 333 return false;
... ... @@ -339,7 +339,7 @@ JSON::getNumber(std::string&amp; value) const
339 339 bool
340 340 JSON::getBool(bool& value) const
341 341 {
342   - auto v = dynamic_cast<JSON_bool const*>(this->m->value.getPointer());
  342 + auto v = dynamic_cast<JSON_bool const*>(this->m->value.get());
343 343 if (v == nullptr)
344 344 {
345 345 return false;
... ... @@ -351,7 +351,7 @@ JSON::getBool(bool&amp; value) const
351 351 bool
352 352 JSON::isNull() const
353 353 {
354   - if (dynamic_cast<JSON_null const*>(this->m->value.getPointer()))
  354 + if (dynamic_cast<JSON_null const*>(this->m->value.get()))
355 355 {
356 356 return true;
357 357 }
... ... @@ -362,7 +362,7 @@ bool
362 362 JSON::forEachDictItem(
363 363 std::function<void(std::string const& key, JSON value)> fn) const
364 364 {
365   - auto v = dynamic_cast<JSON_dictionary const*>(this->m->value.getPointer());
  365 + auto v = dynamic_cast<JSON_dictionary const*>(this->m->value.get());
366 366 if (v == nullptr)
367 367 {
368 368 return false;
... ... @@ -377,7 +377,7 @@ JSON::forEachDictItem(
377 377 bool
378 378 JSON::forEachArrayItem(std::function<void(JSON value)> fn) const
379 379 {
380   - auto v = dynamic_cast<JSON_array const*>(this->m->value.getPointer());
  380 + auto v = dynamic_cast<JSON_array const*>(this->m->value.get());
381 381 if (v == nullptr)
382 382 {
383 383 return false;
... ... @@ -392,8 +392,8 @@ JSON::forEachArrayItem(std::function&lt;void(JSON value)&gt; fn) const
392 392 bool
393 393 JSON::checkSchema(JSON schema, std::list<std::string>& errors)
394 394 {
395   - return checkSchemaInternal(this->m->value.getPointer(),
396   - schema.m->value.getPointer(),
  395 + return checkSchemaInternal(this->m->value.get(),
  396 + schema.m->value.get(),
397 397 0, errors, "");
398 398 }
399 399  
... ... @@ -401,8 +401,8 @@ bool
401 401 JSON::checkSchema(JSON schema, unsigned long flags,
402 402 std::list<std::string>& errors)
403 403 {
404   - return checkSchemaInternal(this->m->value.getPointer(),
405   - schema.m->value.getPointer(),
  404 + return checkSchemaInternal(this->m->value.get(),
  405 + schema.m->value.get(),
406 406 flags, errors, "");
407 407 }
408 408  
... ... @@ -452,12 +452,12 @@ JSON::checkSchemaInternal(JSON_value* this_v, JSON_value* sch_v,
452 452  
453 453 if (sch_dict && (! pattern_key.empty()))
454 454 {
455   - auto pattern_schema = sch_dict->members[pattern_key].getPointer();
  455 + auto pattern_schema = sch_dict->members[pattern_key].get();
456 456 for (auto const& iter: this_dict->members)
457 457 {
458 458 std::string const& key = iter.first;
459 459 checkSchemaInternal(
460   - this_dict->members[key].getPointer(), pattern_schema,
  460 + this_dict->members[key].get(), pattern_schema,
461 461 flags, errors, prefix + "." + key);
462 462 }
463 463 }
... ... @@ -469,8 +469,8 @@ JSON::checkSchemaInternal(JSON_value* this_v, JSON_value* sch_v,
469 469 if (this_dict->members.count(key))
470 470 {
471 471 checkSchemaInternal(
472   - this_dict->members[key].getPointer(),
473   - iter.second.getPointer(),
  472 + this_dict->members[key].get(),
  473 + iter.second.get(),
474 474 flags, errors, prefix + "." + key);
475 475 }
476 476 else
... ... @@ -523,8 +523,8 @@ JSON::checkSchemaInternal(JSON_value* this_v, JSON_value* sch_v,
523 523 iter != this_arr->elements.end(); ++iter, ++i)
524 524 {
525 525 checkSchemaInternal(
526   - (*iter).getPointer(),
527   - sch_arr->elements.at(0).getPointer(),
  526 + (*iter).get(),
  527 + sch_arr->elements.at(0).get(),
528 528 flags, errors, prefix + "." + QUtil::int_to_string(i));
529 529 }
530 530 }
... ... @@ -1067,7 +1067,7 @@ JSONParser::handleToken()
1067 1067 break;
1068 1068 }
1069 1069  
1070   - if ((item.getPointer() == nullptr) == (delimiter == '() == nullptr) == (delimiter == '\0'))'))
  1070 + if ((item.get() == nullptr) == (delimiter == '() == nullptr) == (delimiter == '\0'))'))
1071 1071 {
1072 1072 throw std::logic_error(
1073 1073 "JSONParser::handleToken: logic error: exactly one of item"
... ... @@ -1076,7 +1076,7 @@ JSONParser::handleToken()
1076 1076  
1077 1077 // See whether what we have is allowed at this point.
1078 1078  
1079   - if (item.getPointer())
  1079 + if (item.get())
1080 1080 {
1081 1081 switch (parser_state)
1082 1082 {
... ... @@ -1213,7 +1213,7 @@ JSONParser::handleToken()
1213 1213 throw std::logic_error(
1214 1214 "JSONParser::handleToken: unexpected delimiter in transition");
1215 1215 }
1216   - else if (item.getPointer())
  1216 + else if (item.get())
1217 1217 {
1218 1218 PointerHolder<JSON> tos;
1219 1219 if (! stack.empty())
... ... @@ -1259,7 +1259,7 @@ JSONParser::handleToken()
1259 1259 }
1260 1260  
1261 1261 // Prepare for next token
1262   - if (item.getPointer())
  1262 + if (item.get())
1263 1263 {
1264 1264 if (item->isDictionary())
1265 1265 {
... ...
libqpdf/Pl_Buffer.cc
... ... @@ -28,7 +28,7 @@ Pl_Buffer::~Pl_Buffer()
28 28 void
29 29 Pl_Buffer::write(unsigned char* buf, size_t len)
30 30 {
31   - if (this->m->data.getPointer() == 0)
  31 + if (this->m->data.get() == 0)
32 32 {
33 33 this->m->data = new Buffer(len);
34 34 }
... ...
libqpdf/Pl_DCT.cc
... ... @@ -285,7 +285,7 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b)
285 285 static int const BUF_SIZE = 65536;
286 286 PointerHolder<unsigned char> outbuffer_ph(
287 287 true, new unsigned char[BUF_SIZE]);
288   - unsigned char* outbuffer = outbuffer_ph.getPointer();
  288 + unsigned char* outbuffer = outbuffer_ph.get();
289 289 jpeg_pipeline_dest(cinfo, outbuffer, BUF_SIZE, this->getNext());
290 290  
291 291 cinfo->image_width = this->m->image_width;
... ...
libqpdf/Pl_Flate.cc
... ... @@ -37,7 +37,7 @@ Pl_Flate::Members::Members(size_t out_bufsize,
37 37 zstream.opaque = 0;
38 38 zstream.next_in = 0;
39 39 zstream.avail_in = 0;
40   - zstream.next_out = this->outbuf.getPointer();
  40 + zstream.next_out = this->outbuf.get();
41 41 zstream.avail_out = QIntC::to_uint(out_bufsize);
42 42 }
43 43  
... ... @@ -89,7 +89,7 @@ Pl_Flate::warn(char const* msg, int code)
89 89 void
90 90 Pl_Flate::write(unsigned char* data, size_t len)
91 91 {
92   - if (this->m->outbuf.getPointer() == 0)
  92 + if (this->m->outbuf.get() == 0)
93 93 {
94 94 throw std::logic_error(
95 95 this->identifier +
... ... @@ -208,8 +208,8 @@ Pl_Flate::handleData(unsigned char* data, size_t len, int flush)
208 208 QIntC::to_ulong(this->m->out_bufsize - zstream.avail_out);
209 209 if (ready > 0)
210 210 {
211   - this->getNext()->write(this->m->outbuf.getPointer(), ready);
212   - zstream.next_out = this->m->outbuf.getPointer();
  211 + this->getNext()->write(this->m->outbuf.get(), ready);
  212 + zstream.next_out = this->m->outbuf.get();
213 213 zstream.avail_out = QIntC::to_uint(this->m->out_bufsize);
214 214 }
215 215 }
... ... @@ -227,7 +227,7 @@ Pl_Flate::finish()
227 227 {
228 228 try
229 229 {
230   - if (this->m->outbuf.getPointer())
  230 + if (this->m->outbuf.get())
231 231 {
232 232 if (this->m->initialized)
233 233 {
... ...
libqpdf/Pl_PNGFilter.cc
... ... @@ -49,10 +49,10 @@ Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next,
49 49 true, new unsigned char[this->bytes_per_row + 1]);
50 50 this->buf2 = PointerHolder<unsigned char>(
51 51 true, new unsigned char[this->bytes_per_row + 1]);
52   - memset(this->buf1.getPointer(), 0, this->bytes_per_row + 1);
53   - memset(this->buf2.getPointer(), 0, this->bytes_per_row + 1);
54   - this->cur_row = this->buf1.getPointer();
55   - this->prev_row = this->buf2.getPointer();
  52 + memset(this->buf1.get(), 0, this->bytes_per_row + 1);
  53 + memset(this->buf2.get(), 0, this->bytes_per_row + 1);
  54 + this->cur_row = this->buf1.get();
  55 + this->prev_row = this->buf2.get();
56 56  
57 57 // number of bytes per incoming row
58 58 this->incoming = (action == a_encode ?
... ... @@ -81,7 +81,7 @@ Pl_PNGFilter::write(unsigned char* data, size_t len)
81 81 // Swap rows
82 82 unsigned char* t = this->prev_row;
83 83 this->prev_row = this->cur_row;
84   - this->cur_row = t ? t : this->buf2.getPointer();
  84 + this->cur_row = t ? t : this->buf2.get();
85 85 memset(this->cur_row, 0, this->bytes_per_row + 1);
86 86 left = this->incoming;
87 87 this->pos = 0;
... ... @@ -269,7 +269,7 @@ Pl_PNGFilter::finish()
269 269 processRow();
270 270 }
271 271 this->prev_row = 0;
272   - this->cur_row = buf1.getPointer();
  272 + this->cur_row = buf1.get();
273 273 this->pos = 0;
274 274 memset(this->cur_row, 0, this->bytes_per_row + 1);
275 275  
... ...
libqpdf/Pl_RC4.cc
... ... @@ -19,7 +19,7 @@ Pl_RC4::~Pl_RC4()
19 19 void
20 20 Pl_RC4::write(unsigned char* data, size_t len)
21 21 {
22   - if (this->outbuf.getPointer() == 0)
  22 + if (this->outbuf.get() == 0)
23 23 {
24 24 throw std::logic_error(
25 25 this->identifier +
... ... @@ -35,9 +35,9 @@ Pl_RC4::write(unsigned char* data, size_t len)
35 35 (bytes_left < this->out_bufsize ? bytes_left : out_bufsize);
36 36 bytes_left -= bytes;
37 37 // lgtm[cpp/weak-cryptographic-algorithm]
38   - rc4.process(p, bytes, outbuf.getPointer());
  38 + rc4.process(p, bytes, outbuf.get());
39 39 p += bytes;
40   - getNext()->write(outbuf.getPointer(), bytes);
  40 + getNext()->write(outbuf.get(), bytes);
41 41 }
42 42 }
43 43  
... ...
libqpdf/Pl_TIFFPredictor.cc
... ... @@ -39,7 +39,7 @@ Pl_TIFFPredictor::Pl_TIFFPredictor(char const* identifier, Pipeline* next,
39 39 this->bytes_per_row = bpr & UINT_MAX;
40 40 this->cur_row = PointerHolder<unsigned char>(
41 41 true, new unsigned char[this->bytes_per_row]);
42   - memset(this->cur_row.getPointer(), 0, this->bytes_per_row);
  42 + memset(this->cur_row.get(), 0, this->bytes_per_row);
43 43 }
44 44  
45 45 Pl_TIFFPredictor::~Pl_TIFFPredictor()
... ... @@ -54,20 +54,20 @@ Pl_TIFFPredictor::write(unsigned char* data, size_t len)
54 54 while (len >= left)
55 55 {
56 56 // finish off current row
57   - memcpy(this->cur_row.getPointer() + this->pos, data + offset, left);
  57 + memcpy(this->cur_row.get() + this->pos, data + offset, left);
58 58 offset += left;
59 59 len -= left;
60 60  
61 61 processRow();
62 62  
63 63 // Prepare for next row
64   - memset(this->cur_row.getPointer(), 0, this->bytes_per_row);
  64 + memset(this->cur_row.get(), 0, this->bytes_per_row);
65 65 left = this->bytes_per_row;
66 66 this->pos = 0;
67 67 }
68 68 if (len)
69 69 {
70   - memcpy(this->cur_row.getPointer() + this->pos, data + offset, len);
  70 + memcpy(this->cur_row.get() + this->pos, data + offset, len);
71 71 }
72 72 this->pos += len;
73 73 }
... ... @@ -78,7 +78,7 @@ Pl_TIFFPredictor::processRow()
78 78 QTC::TC("libtests", "Pl_TIFFPredictor processRow",
79 79 (action == a_decode ? 0 : 1));
80 80 BitWriter bw(this->getNext());
81   - BitStream in(this->cur_row.getPointer(), this->bytes_per_row);
  81 + BitStream in(this->cur_row.get(), this->bytes_per_row);
82 82 std::vector<long long> prev;
83 83 for (unsigned int i = 0; i < this->samples_per_pixel; ++i)
84 84 {
... ... @@ -117,6 +117,6 @@ Pl_TIFFPredictor::finish()
117 117 processRow();
118 118 }
119 119 this->pos = 0;
120   - memset(this->cur_row.getPointer(), 0, this->bytes_per_row);
  120 + memset(this->cur_row.get(), 0, this->bytes_per_row);
121 121 getNext()->finish();
122 122 }
... ...
libqpdf/QPDF.cc
... ... @@ -126,7 +126,7 @@ QPDF::CopiedStreamDataProvider::provideStreamData(
126 126 PointerHolder<ForeignStreamData> foreign_data =
127 127 this->foreign_stream_data[QPDFObjGen(objid, generation)];
128 128 bool result = false;
129   - if (foreign_data.getPointer())
  129 + if (foreign_data.get())
130 130 {
131 131 result = destination_qpdf.pipeForeignStreamData(
132 132 foreign_data, pipeline, suppress_warnings, will_retry);
... ... @@ -256,7 +256,7 @@ QPDF::~QPDF()
256 256 iter != this->m->obj_cache.end(); ++iter)
257 257 {
258 258 QPDFObject::ObjAccessor::releaseResolved(
259   - (*iter).second.object.getPointer());
  259 + (*iter).second.object.get());
260 260 }
261 261 }
262 262  
... ... @@ -1507,7 +1507,7 @@ QPDF::fixDanglingReferences(bool force)
1507 1507 {
1508 1508 QPDF_Array* arr =
1509 1509 dynamic_cast<QPDF_Array*>(
1510   - QPDFObjectHandle::ObjAccessor::getObject(obj).getPointer());
  1510 + QPDFObjectHandle::ObjAccessor::getObject(obj).get());
1511 1511 arr->addExplicitElementsToList(to_check);
1512 1512 }
1513 1513 for (std::list<QPDFObjectHandle>::iterator iter = to_check.begin();
... ... @@ -1604,7 +1604,7 @@ QPDF::readObject(PointerHolder&lt;InputSource&gt; input,
1604 1604 if (this->m->encp->encrypted && (! in_object_stream))
1605 1605 {
1606 1606 decrypter_ph = new StringDecrypter(this, objid, generation);
1607   - decrypter = decrypter_ph.getPointer();
  1607 + decrypter = decrypter_ph.get();
1608 1608 }
1609 1609 QPDFObjectHandle object = QPDFObjectHandle::parse(
1610 1610 input, this->m->last_object_description,
... ... @@ -2080,7 +2080,7 @@ QPDF::objectChanged(QPDFObjGen const&amp; og, PointerHolder&lt;QPDFObject&gt;&amp; oph)
2080 2080 {
2081 2081 return true;
2082 2082 }
2083   - return (c->second.object.getPointer() != oph.getPointer());
  2083 + return (c->second.object.get() != oph.get());
2084 2084 }
2085 2085  
2086 2086 PointerHolder<QPDFObject>
... ... @@ -2230,7 +2230,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
2230 2230 PointerHolder<InputSource> input = new BufferInputSource(
2231 2231 this->m->file->getName() +
2232 2232 " object stream " + QUtil::int_to_string(obj_stream_number),
2233   - bp.getPointer());
  2233 + bp.get());
2234 2234  
2235 2235 for (int i = 0; i < n; ++i)
2236 2236 {
... ... @@ -2640,7 +2640,7 @@ QPDF::copyStreamData(QPDFObjectHandle result, QPDFObjectHandle foreign)
2640 2640 QPDF_Stream* stream =
2641 2641 dynamic_cast<QPDF_Stream*>(
2642 2642 QPDFObjectHandle::ObjAccessor::getObject(
2643   - foreign).getPointer());
  2643 + foreign).get());
2644 2644 if (! stream)
2645 2645 {
2646 2646 throw std::logic_error("unable to retrieve underlying"
... ... @@ -2649,7 +2649,7 @@ QPDF::copyStreamData(QPDFObjectHandle result, QPDFObjectHandle foreign)
2649 2649 PointerHolder<Buffer> stream_buffer =
2650 2650 stream->getStreamDataBuffer();
2651 2651 if ((foreign_stream_qpdf->m->immediate_copy_from) &&
2652   - (stream_buffer.getPointer() == 0))
  2652 + (stream_buffer.get() == 0))
2653 2653 {
2654 2654 // Pull the stream data into a buffer before attempting
2655 2655 // the copy operation. Do it on the source stream so that
... ... @@ -2663,14 +2663,14 @@ QPDF::copyStreamData(QPDFObjectHandle result, QPDFObjectHandle foreign)
2663 2663 }
2664 2664 PointerHolder<QPDFObjectHandle::StreamDataProvider> stream_provider =
2665 2665 stream->getStreamDataProvider();
2666   - if (stream_buffer.getPointer())
  2666 + if (stream_buffer.get())
2667 2667 {
2668 2668 QTC::TC("qpdf", "QPDF copy foreign stream with buffer");
2669 2669 result.replaceStreamData(stream_buffer,
2670 2670 dict.getKey("/Filter"),
2671 2671 dict.getKey("/DecodeParms"));
2672 2672 }
2673   - else if (stream_provider.getPointer())
  2673 + else if (stream_provider.get())
2674 2674 {
2675 2675 // In this case, the remote stream's QPDF must stay in scope.
2676 2676 QTC::TC("qpdf", "QPDF copy foreign stream with provider");
... ...
libqpdf/QPDFAcroFormDocumentHelper.cc
... ... @@ -903,7 +903,7 @@ QPDFAcroFormDocumentHelper::transformAnnotations(
903 903 else if ((from_qpdf != &this->qpdf) && (! from_afdh))
904 904 {
905 905 afdhph = new QPDFAcroFormDocumentHelper(*from_qpdf);
906   - from_afdh = afdhph.getPointer();
  906 + from_afdh = afdhph.get();
907 907 }
908 908 bool foreign = (from_qpdf != &this->qpdf);
909 909  
... ...
libqpdf/QPDFJob_config.cc
... ... @@ -756,7 +756,7 @@ QPDFJob::Config::jobJsonFile(std::string const&amp; parameter)
756 756 QUtil::read_file_into_memory(parameter.c_str(), file_buf, size);
757 757 try
758 758 {
759   - o.initializeFromJson(std::string(file_buf.getPointer(), size), true);
  759 + o.initializeFromJson(std::string(file_buf.get(), size), true);
760 760 }
761 761 catch (std::exception& e)
762 762 {
... ...
libqpdf/QPDFObjectHandle.cc
... ... @@ -241,14 +241,14 @@ QPDFObjectHandle::releaseResolved()
241 241 // destruction. See comments in QPDF::~QPDF().
242 242 if (isIndirect())
243 243 {
244   - if (this->obj.getPointer())
  244 + if (this->obj.get())
245 245 {
246 246 this->obj = 0;
247 247 }
248 248 }
249 249 else
250 250 {
251   - QPDFObject::ObjAccessor::releaseResolved(this->obj.getPointer());
  251 + QPDFObject::ObjAccessor::releaseResolved(this->obj.get());
252 252 }
253 253 }
254 254  
... ... @@ -320,7 +320,7 @@ QPDFObjectHandle::isBool()
320 320 return false;
321 321 }
322 322 dereference();
323   - return QPDFObjectTypeAccessor<QPDF_Bool>::check(obj.getPointer());
  323 + return QPDFObjectTypeAccessor<QPDF_Bool>::check(obj.get());
324 324 }
325 325  
326 326 bool
... ... @@ -329,7 +329,7 @@ QPDFObjectHandle::isDirectNull() const
329 329 // Don't call dereference() -- this is a const method, and we know
330 330 // objid == 0, so there's nothing to resolve.
331 331 return (this->initialized && (this->objid == 0) &&
332   - QPDFObjectTypeAccessor<QPDF_Null>::check(obj.getPointer()));
  332 + QPDFObjectTypeAccessor<QPDF_Null>::check(obj.get()));
333 333 }
334 334  
335 335 bool
... ... @@ -340,7 +340,7 @@ QPDFObjectHandle::isNull()
340 340 return false;
341 341 }
342 342 dereference();
343   - return QPDFObjectTypeAccessor<QPDF_Null>::check(obj.getPointer());
  343 + return QPDFObjectTypeAccessor<QPDF_Null>::check(obj.get());
344 344 }
345 345  
346 346 bool
... ... @@ -351,7 +351,7 @@ QPDFObjectHandle::isInteger()
351 351 return false;
352 352 }
353 353 dereference();
354   - return QPDFObjectTypeAccessor<QPDF_Integer>::check(obj.getPointer());
  354 + return QPDFObjectTypeAccessor<QPDF_Integer>::check(obj.get());
355 355 }
356 356  
357 357 bool
... ... @@ -362,7 +362,7 @@ QPDFObjectHandle::isReal()
362 362 return false;
363 363 }
364 364 dereference();
365   - return QPDFObjectTypeAccessor<QPDF_Real>::check(obj.getPointer());
  365 + return QPDFObjectTypeAccessor<QPDF_Real>::check(obj.get());
366 366 }
367 367  
368 368 bool
... ... @@ -399,7 +399,7 @@ QPDFObjectHandle::isName()
399 399 return false;
400 400 }
401 401 dereference();
402   - return QPDFObjectTypeAccessor<QPDF_Name>::check(obj.getPointer());
  402 + return QPDFObjectTypeAccessor<QPDF_Name>::check(obj.get());
403 403 }
404 404  
405 405 bool
... ... @@ -410,7 +410,7 @@ QPDFObjectHandle::isString()
410 410 return false;
411 411 }
412 412 dereference();
413   - return QPDFObjectTypeAccessor<QPDF_String>::check(obj.getPointer());
  413 + return QPDFObjectTypeAccessor<QPDF_String>::check(obj.get());
414 414 }
415 415  
416 416 bool
... ... @@ -421,7 +421,7 @@ QPDFObjectHandle::isOperator()
421 421 return false;
422 422 }
423 423 dereference();
424   - return QPDFObjectTypeAccessor<QPDF_Operator>::check(obj.getPointer());
  424 + return QPDFObjectTypeAccessor<QPDF_Operator>::check(obj.get());
425 425 }
426 426  
427 427 bool
... ... @@ -432,7 +432,7 @@ QPDFObjectHandle::isInlineImage()
432 432 return false;
433 433 }
434 434 dereference();
435   - return QPDFObjectTypeAccessor<QPDF_InlineImage>::check(obj.getPointer());
  435 + return QPDFObjectTypeAccessor<QPDF_InlineImage>::check(obj.get());
436 436 }
437 437  
438 438 bool
... ... @@ -443,7 +443,7 @@ QPDFObjectHandle::isArray()
443 443 return false;
444 444 }
445 445 dereference();
446   - return QPDFObjectTypeAccessor<QPDF_Array>::check(obj.getPointer());
  446 + return QPDFObjectTypeAccessor<QPDF_Array>::check(obj.get());
447 447 }
448 448  
449 449 bool
... ... @@ -454,7 +454,7 @@ QPDFObjectHandle::isDictionary()
454 454 return false;
455 455 }
456 456 dereference();
457   - return QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj.getPointer());
  457 + return QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj.get());
458 458 }
459 459  
460 460 bool
... ... @@ -465,7 +465,7 @@ QPDFObjectHandle::isStream()
465 465 return false;
466 466 }
467 467 dereference();
468   - return QPDFObjectTypeAccessor<QPDF_Stream>::check(obj.getPointer());
  468 + return QPDFObjectTypeAccessor<QPDF_Stream>::check(obj.get());
469 469 }
470 470  
471 471 bool
... ... @@ -526,7 +526,7 @@ QPDFObjectHandle::getBoolValue()
526 526 {
527 527 if (isBool())
528 528 {
529   - return dynamic_cast<QPDF_Bool*>(obj.getPointer())->getVal();
  529 + return dynamic_cast<QPDF_Bool*>(obj.get())->getVal();
530 530 }
531 531 else
532 532 {
... ... @@ -543,7 +543,7 @@ QPDFObjectHandle::getIntValue()
543 543 {
544 544 if (isInteger())
545 545 {
546   - return dynamic_cast<QPDF_Integer*>(obj.getPointer())->getVal();
  546 + return dynamic_cast<QPDF_Integer*>(obj.get())->getVal();
547 547 }
548 548 else
549 549 {
... ... @@ -636,7 +636,7 @@ QPDFObjectHandle::getRealValue()
636 636 {
637 637 if (isReal())
638 638 {
639   - return dynamic_cast<QPDF_Real*>(obj.getPointer())->getVal();
  639 + return dynamic_cast<QPDF_Real*>(obj.get())->getVal();
640 640 }
641 641 else
642 642 {
... ... @@ -653,7 +653,7 @@ QPDFObjectHandle::getName()
653 653 {
654 654 if (isName())
655 655 {
656   - return dynamic_cast<QPDF_Name*>(obj.getPointer())->getName();
  656 + return dynamic_cast<QPDF_Name*>(obj.get())->getName();
657 657 }
658 658 else
659 659 {
... ... @@ -670,7 +670,7 @@ QPDFObjectHandle::getStringValue()
670 670 {
671 671 if (isString())
672 672 {
673   - return dynamic_cast<QPDF_String*>(obj.getPointer())->getVal();
  673 + return dynamic_cast<QPDF_String*>(obj.get())->getVal();
674 674 }
675 675 else
676 676 {
... ... @@ -685,7 +685,7 @@ QPDFObjectHandle::getUTF8Value()
685 685 {
686 686 if (isString())
687 687 {
688   - return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val();
  688 + return dynamic_cast<QPDF_String*>(obj.get())->getUTF8Val();
689 689 }
690 690 else
691 691 {
... ... @@ -702,7 +702,7 @@ QPDFObjectHandle::getOperatorValue()
702 702 {
703 703 if (isOperator())
704 704 {
705   - return dynamic_cast<QPDF_Operator*>(obj.getPointer())->getVal();
  705 + return dynamic_cast<QPDF_Operator*>(obj.get())->getVal();
706 706 }
707 707 else
708 708 {
... ... @@ -717,7 +717,7 @@ QPDFObjectHandle::getInlineImageValue()
717 717 {
718 718 if (isInlineImage())
719 719 {
720   - return dynamic_cast<QPDF_InlineImage*>(obj.getPointer())->getVal();
  720 + return dynamic_cast<QPDF_InlineImage*>(obj.get())->getVal();
721 721 }
722 722 else
723 723 {
... ... @@ -740,7 +740,7 @@ QPDFObjectHandle::getArrayNItems()
740 740 {
741 741 if (isArray())
742 742 {
743   - return dynamic_cast<QPDF_Array*>(obj.getPointer())->getNItems();
  743 + return dynamic_cast<QPDF_Array*>(obj.get())->getNItems();
744 744 }
745 745 else
746 746 {
... ... @@ -756,7 +756,7 @@ QPDFObjectHandle::getArrayItem(int n)
756 756 QPDFObjectHandle result;
757 757 if (isArray() && (n < getArrayNItems()) && (n >= 0))
758 758 {
759   - result = dynamic_cast<QPDF_Array*>(obj.getPointer())->getItem(n);
  759 + result = dynamic_cast<QPDF_Array*>(obj.get())->getItem(n);
760 760 }
761 761 else
762 762 {
... ... @@ -869,7 +869,7 @@ QPDFObjectHandle::getArrayAsVector()
869 869 std::vector<QPDFObjectHandle> result;
870 870 if (isArray())
871 871 {
872   - dynamic_cast<QPDF_Array*>(obj.getPointer())->getAsVector(result);
  872 + dynamic_cast<QPDF_Array*>(obj.get())->getAsVector(result);
873 873 }
874 874 else
875 875 {
... ... @@ -887,7 +887,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const&amp; item)
887 887 if (isArray())
888 888 {
889 889 checkOwnership(item);
890   - dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item);
  890 + dynamic_cast<QPDF_Array*>(obj.get())->setItem(n, item);
891 891 }
892 892 else
893 893 {
... ... @@ -905,7 +905,7 @@ QPDFObjectHandle::setArrayFromVector(std::vector&lt;QPDFObjectHandle&gt; const&amp; items)
905 905 {
906 906 checkOwnership(item);
907 907 }
908   - dynamic_cast<QPDF_Array*>(obj.getPointer())->setFromVector(items);
  908 + dynamic_cast<QPDF_Array*>(obj.get())->setFromVector(items);
909 909 }
910 910 else
911 911 {
... ... @@ -919,7 +919,7 @@ QPDFObjectHandle::insertItem(int at, QPDFObjectHandle const&amp; item)
919 919 {
920 920 if (isArray())
921 921 {
922   - dynamic_cast<QPDF_Array*>(obj.getPointer())->insertItem(at, item);
  922 + dynamic_cast<QPDF_Array*>(obj.get())->insertItem(at, item);
923 923 }
924 924 else
925 925 {
... ... @@ -934,7 +934,7 @@ QPDFObjectHandle::appendItem(QPDFObjectHandle const&amp; item)
934 934 if (isArray())
935 935 {
936 936 checkOwnership(item);
937   - dynamic_cast<QPDF_Array*>(obj.getPointer())->appendItem(item);
  937 + dynamic_cast<QPDF_Array*>(obj.get())->appendItem(item);
938 938 }
939 939 else
940 940 {
... ... @@ -948,7 +948,7 @@ QPDFObjectHandle::eraseItem(int at)
948 948 {
949 949 if (isArray() && (at < getArrayNItems()) && (at >= 0))
950 950 {
951   - dynamic_cast<QPDF_Array*>(obj.getPointer())->eraseItem(at);
  951 + dynamic_cast<QPDF_Array*>(obj.get())->eraseItem(at);
952 952 }
953 953 else
954 954 {
... ... @@ -978,7 +978,7 @@ QPDFObjectHandle::hasKey(std::string const&amp; key)
978 978 {
979 979 if (isDictionary())
980 980 {
981   - return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->hasKey(key);
  981 + return dynamic_cast<QPDF_Dictionary*>(obj.get())->hasKey(key);
982 982 }
983 983 else
984 984 {
... ... @@ -996,7 +996,7 @@ QPDFObjectHandle::getKey(std::string const&amp; key)
996 996 if (isDictionary())
997 997 {
998 998 result = dynamic_cast<QPDF_Dictionary*>(
999   - obj.getPointer())->getKey(key);
  999 + obj.get())->getKey(key);
1000 1000 }
1001 1001 else
1002 1002 {
... ... @@ -1024,7 +1024,7 @@ QPDFObjectHandle::getKeys()
1024 1024 std::set<std::string> result;
1025 1025 if (isDictionary())
1026 1026 {
1027   - result = dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->getKeys();
  1027 + result = dynamic_cast<QPDF_Dictionary*>(obj.get())->getKeys();
1028 1028 }
1029 1029 else
1030 1030 {
... ... @@ -1041,7 +1041,7 @@ QPDFObjectHandle::getDictAsMap()
1041 1041 if (isDictionary())
1042 1042 {
1043 1043 result = dynamic_cast<QPDF_Dictionary*>(
1044   - obj.getPointer())->getAsMap();
  1044 + obj.get())->getAsMap();
1045 1045 }
1046 1046 else
1047 1047 {
... ... @@ -1311,7 +1311,7 @@ QPDFObjectHandle::replaceKey(std::string const&amp; key,
1311 1311 {
1312 1312 checkOwnership(value);
1313 1313 dynamic_cast<QPDF_Dictionary*>(
1314   - obj.getPointer())->replaceKey(key, value);
  1314 + obj.get())->replaceKey(key, value);
1315 1315 }
1316 1316 else
1317 1317 {
... ... @@ -1325,7 +1325,7 @@ QPDFObjectHandle::removeKey(std::string const&amp; key)
1325 1325 {
1326 1326 if (isDictionary())
1327 1327 {
1328   - dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->removeKey(key);
  1328 + dynamic_cast<QPDF_Dictionary*>(obj.get())->removeKey(key);
1329 1329 }
1330 1330 else
1331 1331 {
... ... @@ -1342,7 +1342,7 @@ QPDFObjectHandle::replaceOrRemoveKey(std::string const&amp; key,
1342 1342 {
1343 1343 checkOwnership(value);
1344 1344 dynamic_cast<QPDF_Dictionary*>(
1345   - obj.getPointer())->replaceOrRemoveKey(key, value);
  1345 + obj.get())->replaceOrRemoveKey(key, value);
1346 1346 }
1347 1347 else
1348 1348 {
... ... @@ -1356,35 +1356,35 @@ QPDFObjectHandle
1356 1356 QPDFObjectHandle::getDict()
1357 1357 {
1358 1358 assertStream();
1359   - return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getDict();
  1359 + return dynamic_cast<QPDF_Stream*>(obj.get())->getDict();
1360 1360 }
1361 1361  
1362 1362 void
1363 1363 QPDFObjectHandle::setFilterOnWrite(bool val)
1364 1364 {
1365 1365 assertStream();
1366   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->setFilterOnWrite(val);
  1366 + dynamic_cast<QPDF_Stream*>(obj.get())->setFilterOnWrite(val);
1367 1367 }
1368 1368  
1369 1369 bool
1370 1370 QPDFObjectHandle::getFilterOnWrite()
1371 1371 {
1372 1372 assertStream();
1373   - return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getFilterOnWrite();
  1373 + return dynamic_cast<QPDF_Stream*>(obj.get())->getFilterOnWrite();
1374 1374 }
1375 1375  
1376 1376 bool
1377 1377 QPDFObjectHandle::isDataModified()
1378 1378 {
1379 1379 assertStream();
1380   - return dynamic_cast<QPDF_Stream*>(obj.getPointer())->isDataModified();
  1380 + return dynamic_cast<QPDF_Stream*>(obj.get())->isDataModified();
1381 1381 }
1382 1382  
1383 1383 void
1384 1384 QPDFObjectHandle::replaceDict(QPDFObjectHandle new_dict)
1385 1385 {
1386 1386 assertStream();
1387   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceDict(new_dict);
  1387 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceDict(new_dict);
1388 1388 }
1389 1389  
1390 1390 PointerHolder<Buffer>
... ... @@ -1392,14 +1392,14 @@ QPDFObjectHandle::getStreamData(qpdf_stream_decode_level_e level)
1392 1392 {
1393 1393 assertStream();
1394 1394 return dynamic_cast<QPDF_Stream*>(
1395   - obj.getPointer())->getStreamData(level);
  1395 + obj.get())->getStreamData(level);
1396 1396 }
1397 1397  
1398 1398 PointerHolder<Buffer>
1399 1399 QPDFObjectHandle::getRawStreamData()
1400 1400 {
1401 1401 assertStream();
1402   - return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getRawStreamData();
  1402 + return dynamic_cast<QPDF_Stream*>(obj.get())->getRawStreamData();
1403 1403 }
1404 1404  
1405 1405 bool
... ... @@ -1409,7 +1409,7 @@ QPDFObjectHandle::pipeStreamData(Pipeline* p, bool* filtering_attempted,
1409 1409 bool suppress_warnings, bool will_retry)
1410 1410 {
1411 1411 assertStream();
1412   - return dynamic_cast<QPDF_Stream*>(obj.getPointer())->pipeStreamData(
  1412 + return dynamic_cast<QPDF_Stream*>(obj.get())->pipeStreamData(
1413 1413 p, filtering_attempted, encode_flags, decode_level,
1414 1414 suppress_warnings, will_retry);
1415 1415 }
... ... @@ -1422,7 +1422,7 @@ QPDFObjectHandle::pipeStreamData(Pipeline* p,
1422 1422 {
1423 1423 assertStream();
1424 1424 bool filtering_attempted;
1425   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->pipeStreamData(
  1425 + dynamic_cast<QPDF_Stream*>(obj.get())->pipeStreamData(
1426 1426 p, &filtering_attempted, encode_flags, decode_level,
1427 1427 suppress_warnings, will_retry);
1428 1428 return filtering_attempted;
... ... @@ -1455,7 +1455,7 @@ QPDFObjectHandle::replaceStreamData(PointerHolder&lt;Buffer&gt; data,
1455 1455 QPDFObjectHandle const& decode_parms)
1456 1456 {
1457 1457 assertStream();
1458   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceStreamData(
  1458 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceStreamData(
1459 1459 data, filter, decode_parms);
1460 1460 }
1461 1461  
... ... @@ -1468,7 +1468,7 @@ QPDFObjectHandle::replaceStreamData(std::string const&amp; data,
1468 1468 PointerHolder<Buffer> b = new Buffer(data.length());
1469 1469 unsigned char* bp = b->getBuffer();
1470 1470 memcpy(bp, data.c_str(), data.length());
1471   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceStreamData(
  1471 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceStreamData(
1472 1472 b, filter, decode_parms);
1473 1473 }
1474 1474  
... ... @@ -1478,7 +1478,7 @@ QPDFObjectHandle::replaceStreamData(PointerHolder&lt;StreamDataProvider&gt; provider,
1478 1478 QPDFObjectHandle const& decode_parms)
1479 1479 {
1480 1480 assertStream();
1481   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceStreamData(
  1481 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceStreamData(
1482 1482 provider, filter, decode_parms);
1483 1483 }
1484 1484  
... ... @@ -1522,7 +1522,7 @@ QPDFObjectHandle::replaceStreamData(std::function&lt;void(Pipeline*)&gt; provider,
1522 1522 {
1523 1523 assertStream();
1524 1524 PointerHolder<StreamDataProvider> sdp = new FunctionProvider(provider);
1525   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceStreamData(
  1525 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceStreamData(
1526 1526 sdp, filter, decode_parms);
1527 1527 }
1528 1528  
... ... @@ -1534,7 +1534,7 @@ QPDFObjectHandle::replaceStreamData(
1534 1534 {
1535 1535 assertStream();
1536 1536 PointerHolder<StreamDataProvider> sdp = new FunctionProvider(provider);
1537   - dynamic_cast<QPDF_Stream*>(obj.getPointer())->replaceStreamData(
  1537 + dynamic_cast<QPDF_Stream*>(obj.get())->replaceStreamData(
1538 1538 sdp, filter, decode_parms);
1539 1539 }
1540 1540  
... ... @@ -1787,7 +1787,7 @@ QPDFObjectHandle::unparseBinary()
1787 1787 if (this->isString())
1788 1788 {
1789 1789 return dynamic_cast<QPDF_String*>(
1790   - this->obj.getPointer())->unparse(true);
  1790 + this->obj.get())->unparse(true);
1791 1791 }
1792 1792 else
1793 1793 {
... ... @@ -1988,7 +1988,7 @@ QPDFObjectHandle::parseContentStream_data(
1988 1988 {
1989 1989 size_t stream_length = stream_data->getSize();
1990 1990 PointerHolder<InputSource> input =
1991   - new BufferInputSource(description, stream_data.getPointer());
  1991 + new BufferInputSource(description, stream_data.get());
1992 1992 QPDFTokenizer tokenizer;
1993 1993 tokenizer.allowEOF();
1994 1994 bool empty = false;
... ... @@ -2055,7 +2055,7 @@ QPDFObjectHandle::addTokenFilter(PointerHolder&lt;TokenFilter&gt; filter)
2055 2055 {
2056 2056 assertStream();
2057 2057 return dynamic_cast<QPDF_Stream*>(
2058   - obj.getPointer())->addTokenFilter(filter);
  2058 + obj.get())->addTokenFilter(filter);
2059 2059 }
2060 2060  
2061 2061 QPDFObjectHandle
... ... @@ -2575,7 +2575,7 @@ QPDFObjectHandle::setParsedOffset(qpdf_offset_t offset)
2575 2575 {
2576 2576 // This is called during parsing on newly created direct objects,
2577 2577 // so we can't call dereference() here.
2578   - if (this->obj.getPointer())
  2578 + if (this->obj.get())
2579 2579 {
2580 2580 this->obj->setParsedOffset(offset);
2581 2581 }
... ... @@ -2777,7 +2777,7 @@ QPDFObjectHandle::newStream(QPDF* qpdf)
2777 2777 new QPDF_Stream(qpdf, 0, 0, stream_dict, 0, 0)));
2778 2778 result.dereference();
2779 2779 QPDF_Stream* stream =
2780   - dynamic_cast<QPDF_Stream*>(result.obj.getPointer());
  2780 + dynamic_cast<QPDF_Stream*>(result.obj.get());
2781 2781 stream->setObjGen(result.getObjectID(), result.getGeneration());
2782 2782 return result;
2783 2783 }
... ... @@ -2819,7 +2819,7 @@ QPDFObjectHandle::setObjectDescription(QPDF* owning_qpdf,
2819 2819 {
2820 2820 // This is called during parsing on newly created direct objects,
2821 2821 // so we can't call dereference() here.
2822   - if (isInitialized() && this->obj.getPointer())
  2822 + if (isInitialized() && this->obj.get())
2823 2823 {
2824 2824 this->obj->setDescription(owning_qpdf, object_description);
2825 2825 }
... ... @@ -2831,7 +2831,7 @@ QPDFObjectHandle::hasObjectDescription()
2831 2831 if (isInitialized())
2832 2832 {
2833 2833 dereference();
2834   - if (this->obj.getPointer())
  2834 + if (this->obj.get())
2835 2835 {
2836 2836 return this->obj->hasDescription();
2837 2837 }
... ... @@ -2872,7 +2872,7 @@ QPDFObjectHandle::shallowCopyInternal(QPDFObjectHandle&amp; new_obj,
2872 2872 {
2873 2873 QTC::TC("qpdf", "QPDFObjectHandle shallow copy array");
2874 2874 // No newArray for shallow copying the sparse array
2875   - QPDF_Array* arr = dynamic_cast<QPDF_Array*>(obj.getPointer());
  2875 + QPDF_Array* arr = dynamic_cast<QPDF_Array*>(obj.get());
2876 2876 new_obj = QPDFObjectHandle(
2877 2877 new QPDF_Array(arr->getElementsForShallowCopy()));
2878 2878 }
... ... @@ -3309,23 +3309,23 @@ QPDFObjectHandle::dereference()
3309 3309 throw std::logic_error(
3310 3310 "attempted to dereference an uninitialized QPDFObjectHandle");
3311 3311 }
3312   - if (this->obj.getPointer() && this->objid &&
  3312 + if (this->obj.get() && this->objid &&
3313 3313 QPDF::Resolver::objectChanged(
3314 3314 this->qpdf, QPDFObjGen(this->objid, this->generation), this->obj))
3315 3315 {
3316 3316 this->obj = nullptr;
3317 3317 }
3318   - if (this->obj.getPointer() == 0)
  3318 + if (this->obj.get() == 0)
3319 3319 {
3320 3320 PointerHolder<QPDFObject> obj = QPDF::Resolver::resolve(
3321 3321 this->qpdf, this->objid, this->generation);
3322   - if (obj.getPointer() == 0)
  3322 + if (obj.get() == 0)
3323 3323 {
3324 3324 // QPDF::resolve never returns an uninitialized object, but
3325 3325 // check just in case.
3326 3326 this->obj = new QPDF_Null();
3327 3327 }
3328   - else if (dynamic_cast<QPDF_Reserved*>(obj.getPointer()))
  3328 + else if (dynamic_cast<QPDF_Reserved*>(obj.get()))
3329 3329 {
3330 3330 // Do not resolve
3331 3331 }
... ...
libqpdf/QPDFOutlineDocumentHelper.cc
... ... @@ -104,7 +104,7 @@ QPDFOutlineDocumentHelper::resolveNamedDest(QPDFObjectHandle name)
104 104 }
105 105 else if (name.isString())
106 106 {
107   - if (0 == this->m->names_dest.getPointer())
  107 + if (0 == this->m->names_dest.get())
108 108 {
109 109 QPDFObjectHandle names = this->qpdf.getRoot().getKey("/Names");
110 110 if (names.isDictionary())
... ... @@ -117,7 +117,7 @@ QPDFOutlineDocumentHelper::resolveNamedDest(QPDFObjectHandle name)
117 117 }
118 118 }
119 119 }
120   - if (this->m->names_dest.getPointer())
  120 + if (this->m->names_dest.get())
121 121 {
122 122 if (this->m->names_dest->findObject(name.getUTF8Value(), result))
123 123 {
... ...
libqpdf/QPDFPageLabelDocumentHelper.cc
... ... @@ -24,7 +24,7 @@ QPDFPageLabelDocumentHelper::QPDFPageLabelDocumentHelper(QPDF&amp; qpdf) :
24 24 bool
25 25 QPDFPageLabelDocumentHelper::hasPageLabels()
26 26 {
27   - return 0 != this->m->labels.getPointer();
  27 + return 0 != this->m->labels.get();
28 28 }
29 29  
30 30 QPDFObjectHandle
... ...
libqpdf/QPDFPageObjectHelper.cc
... ... @@ -1222,7 +1222,7 @@ QPDFPageObjectHelper::flattenRotation(QPDFAcroFormDocumentHelper* afdh)
1222 1222 if (! afdh)
1223 1223 {
1224 1224 afdhph = new QPDFAcroFormDocumentHelper(*qpdf);
1225   - afdh = afdhph.getPointer();
  1225 + afdh = afdhph.get();
1226 1226 }
1227 1227 afdh->transformAnnotations(
1228 1228 annots, new_annots, new_fields, old_fields, cm);
... ... @@ -1270,7 +1270,7 @@ QPDFPageObjectHelper::copyAnnotations(
1270 1270 if (! afdh)
1271 1271 {
1272 1272 afdhph = new QPDFAcroFormDocumentHelper(*this_qpdf);
1273   - afdh = afdhph.getPointer();
  1273 + afdh = afdhph.get();
1274 1274 }
1275 1275 if (this_qpdf == from_qpdf)
1276 1276 {
... ... @@ -1288,7 +1288,7 @@ QPDFPageObjectHelper::copyAnnotations(
1288 1288 else
1289 1289 {
1290 1290 from_afdhph = new QPDFAcroFormDocumentHelper(*from_qpdf);
1291   - from_afdh = from_afdhph.getPointer();
  1291 + from_afdh = from_afdhph.get();
1292 1292 }
1293 1293  
1294 1294 afdh->transformAnnotations(
... ...
libqpdf/QPDFTokenizer.cc
... ... @@ -652,7 +652,7 @@ QPDFTokenizer::expectInlineImage(PointerHolder&lt;InputSource&gt; input)
652 652 void
653 653 QPDFTokenizer::findEI(PointerHolder<InputSource> input)
654 654 {
655   - if (! input.getPointer())
  655 + if (! input.get())
656 656 {
657 657 return;
658 658 }
... ...
libqpdf/QPDFWriter.cc
... ... @@ -3581,7 +3581,7 @@ QPDFWriter::indicateProgress(bool decrement, bool finished)
3581 3581  
3582 3582 ++this->m->events_seen;
3583 3583  
3584   - if (! this->m->progress_reporter.getPointer())
  3584 + if (! this->m->progress_reporter.get())
3585 3585 {
3586 3586 return;
3587 3587 }
... ...
libqpdf/QPDF_Stream.cc
... ... @@ -479,7 +479,7 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
479 479 {
480 480 normalizer = new ContentNormalizer();
481 481 pipeline = new Pl_QPDFTokenizer(
482   - "normalizer", normalizer.getPointer(), pipeline);
  482 + "normalizer", normalizer.get(), pipeline);
483 483 to_delete.push_back(pipeline);
484 484 }
485 485  
... ... @@ -489,7 +489,7 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
489 489 iter != this->token_filters.rend(); ++iter)
490 490 {
491 491 pipeline = new Pl_QPDFTokenizer(
492   - "token filter", (*iter).getPointer(), pipeline);
  492 + "token filter", (*iter).get(), pipeline);
493 493 to_delete.push_back(pipeline);
494 494 }
495 495  
... ... @@ -512,14 +512,14 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
512 512 }
513 513 }
514 514  
515   - if (this->stream_data.getPointer())
  515 + if (this->stream_data.get())
516 516 {
517 517 QTC::TC("qpdf", "QPDF_Stream pipe replaced stream data");
518 518 pipeline->write(this->stream_data->getBuffer(),
519 519 this->stream_data->getSize());
520 520 pipeline->finish();
521 521 }
522   - else if (this->stream_provider.getPointer())
  522 + else if (this->stream_provider.get())
523 523 {
524 524 Pl_Count count("stream provider count", pipeline);
525 525 if (this->stream_provider->supportsRetry())
... ... @@ -590,7 +590,7 @@ QPDF_Stream::pipeStreamData(Pipeline* pipeline, bool* filterp,
590 590  
591 591 if (filter &&
592 592 (! suppress_warnings) &&
593   - normalizer.getPointer() &&
  593 + normalizer.get() &&
594 594 normalizer->anyBadTokens())
595 595 {
596 596 warn(QPDFExc(qpdf_e_damaged_pdf, qpdf->getFilename(),
... ...
libqpdf/QPDF_encryption.cc
... ... @@ -206,7 +206,7 @@ iterate_rc4(unsigned char* data, size_t data_len,
206 206 {
207 207 PointerHolder<unsigned char> key_ph = PointerHolder<unsigned char>(
208 208 true, new unsigned char[QIntC::to_size(key_len)]);
209   - unsigned char* key = key_ph.getPointer();
  209 + unsigned char* key = key_ph.get();
210 210 for (int i = 0; i < iterations; ++i)
211 211 {
212 212 int const xor_value = (reverse ? iterations - 1 - i : i);
... ...
libqpdf/QPDF_linearization.cc
... ... @@ -314,7 +314,7 @@ QPDF::readLinearizationData()
314 314 QPDFObjectHandle HO = H0.getKey("/O"); // outline
315 315  
316 316 PointerHolder<Buffer> hbp = pb.getBuffer();
317   - Buffer* hb = hbp.getPointer();
  317 + Buffer* hb = hbp.get();
318 318 unsigned char const* h_buf = hb->getBuffer();
319 319 size_t h_size = hb->getSize();
320 320  
... ...
libqpdf/QUtil.cc
... ... @@ -470,7 +470,7 @@ win_convert_filename(char const* filename)
470 470 size_t len = u16.length();
471 471 size_t wlen = (len / 2) - 1;
472 472 PointerHolder<wchar_t> wfilenamep(true, new wchar_t[wlen + 1]);
473   - wchar_t* wfilename = wfilenamep.getPointer();
  473 + wchar_t* wfilename = wfilenamep.get();
474 474 wfilename[wlen] = 0;
475 475 for (unsigned int i = 2; i < len; i += 2)
476 476 {
... ... @@ -489,9 +489,9 @@ QUtil::safe_fopen(char const* filename, char const* mode)
489 489 FILE* f = 0;
490 490 #ifdef _WIN32
491 491 PointerHolder<wchar_t> wfilenamep = win_convert_filename(filename);
492   - wchar_t* wfilename = wfilenamep.getPointer();
  492 + wchar_t* wfilename = wfilenamep.get();
493 493 PointerHolder<wchar_t> wmodep(true, new wchar_t[strlen(mode) + 1]);
494   - wchar_t* wmode = wmodep.getPointer();
  494 + wchar_t* wmode = wmodep.get();
495 495 wmode[strlen(mode)] = 0;
496 496 for (size_t i = 0; i < strlen(mode); ++i)
497 497 {
... ... @@ -633,7 +633,7 @@ QUtil::remove_file(char const* path)
633 633 {
634 634 #ifdef _WIN32
635 635 PointerHolder<wchar_t> wpath = win_convert_filename(path);
636   - os_wrapper(std::string("remove ") + path, _wunlink(wpath.getPointer()));
  636 + os_wrapper(std::string("remove ") + path, _wunlink(wpath.get()));
637 637 #else
638 638 os_wrapper(std::string("remove ") + path, unlink(path));
639 639 #endif
... ... @@ -654,7 +654,7 @@ QUtil::rename_file(char const* oldname, char const* newname)
654 654 PointerHolder<wchar_t> wold = win_convert_filename(oldname);
655 655 PointerHolder<wchar_t> wnew = win_convert_filename(newname);
656 656 os_wrapper(std::string("rename ") + oldname + " " + newname,
657   - _wrename(wold.getPointer(), wnew.getPointer()));
  657 + _wrename(wold.get(), wnew.get()));
658 658 #else
659 659 os_wrapper(std::string("rename ") + oldname + " " + newname,
660 660 rename(oldname, newname));
... ... @@ -867,8 +867,8 @@ QUtil::get_env(std::string const&amp; var, std::string* value)
867 867 if (value)
868 868 {
869 869 PointerHolder<char> t = PointerHolder<char>(true, new char[len + 1]);
870   - ::GetEnvironmentVariable(var.c_str(), t.getPointer(), len);
871   - *value = t.getPointer();
  870 + ::GetEnvironmentVariable(var.c_str(), t.get(), len);
  871 + *value = t.get();
872 872 }
873 873  
874 874 return true;
... ... @@ -1261,7 +1261,7 @@ QUtil::read_file_into_memory(
1261 1261 size = QIntC::to_size(QUtil::tell(f));
1262 1262 fseek(f, 0, SEEK_SET);
1263 1263 file_buf = PointerHolder<char>(true, new char[size]);
1264   - char* buf_p = file_buf.getPointer();
  1264 + char* buf_p = file_buf.get();
1265 1265 size_t bytes_read = 0;
1266 1266 size_t len = 0;
1267 1267 while ((len = fread(buf_p + bytes_read, 1, size - bytes_read, f)) > 0)
... ...
libqpdf/qpdf-c.cc
... ... @@ -175,7 +175,7 @@ void qpdf_cleanup(qpdf_data* qpdf)
175 175 {
176 176 QTC::TC("qpdf", "qpdf-c called qpdf_cleanup");
177 177 qpdf_oh_release_all(*qpdf);
178   - if ((*qpdf)->error.getPointer())
  178 + if ((*qpdf)->error.get())
179 179 {
180 180 QTC::TC("qpdf", "qpdf-c cleanup warned about unhandled error");
181 181 std::cerr << "WARNING: application did not handle error: "
... ... @@ -216,12 +216,12 @@ QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf)
216 216 QPDF_BOOL qpdf_has_error(qpdf_data qpdf)
217 217 {
218 218 QTC::TC("qpdf", "qpdf-c called qpdf_has_error");
219   - return (qpdf->error.getPointer() ? QPDF_TRUE : QPDF_FALSE);
  219 + return (qpdf->error.get() ? QPDF_TRUE : QPDF_FALSE);
220 220 }
221 221  
222 222 qpdf_error qpdf_get_error(qpdf_data qpdf)
223 223 {
224   - if (qpdf->error.getPointer())
  224 + if (qpdf->error.get())
225 225 {
226 226 qpdf->tmp_error.exc = qpdf->error;
227 227 qpdf->error = 0;
... ... @@ -498,11 +498,11 @@ QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf)
498 498  
499 499 static void qpdf_init_write_internal(qpdf_data qpdf)
500 500 {
501   - if (qpdf->qpdf_writer.getPointer())
  501 + if (qpdf->qpdf_writer.get())
502 502 {
503 503 QTC::TC("qpdf", "qpdf-c called qpdf_init_write multiple times");
504 504 qpdf->qpdf_writer = 0;
505   - if (qpdf->output_buffer.getPointer())
  505 + if (qpdf->output_buffer.get())
506 506 {
507 507 qpdf->output_buffer = 0;
508 508 qpdf->write_memory = false;
... ... @@ -541,7 +541,7 @@ size_t qpdf_get_buffer_length(qpdf_data qpdf)
541 541 {
542 542 qpdf_get_buffer_internal(qpdf);
543 543 size_t result = 0;
544   - if (qpdf->output_buffer.getPointer())
  544 + if (qpdf->output_buffer.get())
545 545 {
546 546 result = qpdf->output_buffer->getSize();
547 547 }
... ... @@ -552,7 +552,7 @@ unsigned char const* qpdf_get_buffer(qpdf_data qpdf)
552 552 {
553 553 unsigned char const* result = 0;
554 554 qpdf_get_buffer_internal(qpdf);
555   - if (qpdf->output_buffer.getPointer())
  555 + if (qpdf->output_buffer.get())
556 556 {
557 557 result = qpdf->output_buffer->getBuffer();
558 558 }
... ... @@ -978,7 +978,7 @@ static RET do_with_oh(
978 978 qpdf, fallback, [fn, oh](qpdf_data q) {
979 979 auto i = q->oh_cache.find(oh);
980 980 bool result = ((i != q->oh_cache.end()) &&
981   - (i->second).getPointer());
  981 + (i->second).get());
982 982 if (! result)
983 983 {
984 984 QTC::TC("qpdf", "qpdf-c invalid object handle");
... ... @@ -1506,7 +1506,7 @@ qpdf_oh qpdf_oh_new_stream(qpdf_data qpdf)
1506 1506 {
1507 1507 QTC::TC("qpdf", "qpdf-c called qpdf_oh_new_stream");
1508 1508 return new_object(
1509   - qpdf, QPDFObjectHandle::newStream(qpdf->qpdf.getPointer()));
  1509 + qpdf, QPDFObjectHandle::newStream(qpdf->qpdf.get()));
1510 1510 }
1511 1511  
1512 1512 void qpdf_oh_make_direct(qpdf_data qpdf, qpdf_oh oh)
... ...
libtests/input_source.cc
... ... @@ -66,7 +66,7 @@ int main()
66 66 // of the next match
67 67 memcpy(b + 2037, "potato potato salad ", 20);
68 68 PointerHolder<InputSource> is =
69   - new BufferInputSource("test buffer input source", b1.getPointer());
  69 + new BufferInputSource("test buffer input source", b1.get());
70 70 Finder f1(is, "salad");
71 71 check("find potato salad", true,
72 72 is->findFirst("potato", 0, 0, f1));
... ...
libtests/json_parse.cc
... ... @@ -15,7 +15,7 @@ int main(int argc, char* argv[])
15 15 PointerHolder<char> buf;
16 16 size_t size;
17 17 QUtil::read_file_into_memory(filename, buf, size);
18   - std::string s(buf.getPointer(), size);
  18 + std::string s(buf.get(), size);
19 19 std::cout << JSON::parse(s).unparse() << std::endl;
20 20 }
21 21 catch (std::exception& e)
... ...
libtests/pointer_holder.cc
  1 +#define NO_POINTERHOLDER_DEPRECATION // we need to test the deprecated API
1 2 #include <qpdf/PointerHolder.hh>
2 3  
3 4 #include <iostream>
... ...
libtests/qutil.cc
... ... @@ -528,7 +528,7 @@ void read_from_file_test()
528 528 size_t size = 0;
529 529 QUtil::read_file_into_memory("other-file", buf, size);
530 530 std::cout << "read " << size << " bytes" << std::endl;
531   - char const* p = buf.getPointer();
  531 + char const* p = buf.get();
532 532 assert(size == 24652);
533 533 assert(memcmp(p, "This file is used for qutil testing.", 36) == 0);
534 534 assert(p[59] == static_cast<char>(13));
... ... @@ -609,11 +609,11 @@ void rename_delete_test()
609 609 fprintf(f1, "one");
610 610 fclose(f1);
611 611 QUtil::read_file_into_memory("old\xcf\x80", buf, size);
612   - assert(memcmp(buf.getPointer(), "one", 3) == 0);
  612 + assert(memcmp(buf.get(), "one", 3) == 0);
613 613 std::cout << "rename file" << std::endl;;
614 614 QUtil::rename_file("old\xcf\x80", "old\xcf\x80.~tmp");
615 615 QUtil::read_file_into_memory("old\xcf\x80.~tmp", buf, size);
616   - assert(memcmp(buf.getPointer(), "one", 3) == 0);
  616 + assert(memcmp(buf.get(), "one", 3) == 0);
617 617 assert_no_file("old\xcf\x80");
618 618 std::cout << "create file" << std::endl;;
619 619 f1 = QUtil::safe_fopen("old\xcf\x80", "w");
... ... @@ -622,7 +622,7 @@ void rename_delete_test()
622 622 std::cout << "rename over existing" << std::endl;;
623 623 QUtil::rename_file("old\xcf\x80", "old\xcf\x80.~tmp");
624 624 QUtil::read_file_into_memory("old\xcf\x80.~tmp", buf, size);
625   - assert(memcmp(buf.getPointer(), "two", 3) == 0);
  625 + assert(memcmp(buf.get(), "two", 3) == 0);
626 626 assert_no_file("old\xcf\x80");
627 627 std::cout << "delete file" << std::endl;;
628 628 QUtil::remove_file("old\xcf\x80.~tmp");
... ...
qpdf/test_driver.cc
... ... @@ -295,7 +295,7 @@ static void test_0_1(QPDF&amp; pdf, char const* arg2)
295 295 std::cout.flush();
296 296 QUtil::binary_stdout();
297 297 PointerHolder<Pl_StdioFile> out = new Pl_StdioFile("raw", stdout);
298   - qtest.pipeStreamData(out.getPointer(), 0, qpdf_dl_none);
  298 + qtest.pipeStreamData(out.get(), 0, qpdf_dl_none);
299 299  
300 300 std::cout << std::endl << "Uncompressed stream data:" << std::endl;
301 301 if (qtest.pipeStreamData(0, 0, qpdf_dl_all))
... ... @@ -303,7 +303,7 @@ static void test_0_1(QPDF&amp; pdf, char const* arg2)
303 303 std::cout.flush();
304 304 QUtil::binary_stdout();
305 305 out = new Pl_StdioFile("filtered", stdout);
306   - qtest.pipeStreamData(out.getPointer(), 0, qpdf_dl_all);
  306 + qtest.pipeStreamData(out.get(), 0, qpdf_dl_all);
307 307 std::cout << std::endl << "End of stream data" << std::endl;
308 308 }
309 309 else
... ... @@ -344,7 +344,7 @@ static void test_2(QPDF&amp; pdf, char const* arg2)
344 344 QPDFObjectHandle contents = page.getKey("/Contents");
345 345 QUtil::binary_stdout();
346 346 PointerHolder<Pl_StdioFile> out = new Pl_StdioFile("filtered", stdout);
347   - contents.pipeStreamData(out.getPointer(), 0, qpdf_dl_generalized);
  347 + contents.pipeStreamData(out.get(), 0, qpdf_dl_generalized);
348 348 }
349 349  
350 350 static void test_3(QPDF& pdf, char const* arg2)
... ... @@ -358,7 +358,7 @@ static void test_3(QPDF&amp; pdf, char const* arg2)
358 358 QUtil::binary_stdout();
359 359 PointerHolder<Pl_StdioFile> out =
360 360 new Pl_StdioFile("tokenized stream", stdout);
361   - stream.pipeStreamData(out.getPointer(),
  361 + stream.pipeStreamData(out.get(),
362 362 qpdf_ef_normalize, qpdf_dl_generalized);
363 363 }
364 364 }
... ... @@ -3154,7 +3154,7 @@ static void test_83(QPDF&amp; pdf, char const* arg2)
3154 3154 try
3155 3155 {
3156 3156 std::cout << "calling initializeFromJson" << std::endl;
3157   - j.initializeFromJson(std::string(file_buf.getPointer(), size));
  3157 + j.initializeFromJson(std::string(file_buf.get(), size));
3158 3158 std::cout << "called initializeFromJson" << std::endl;
3159 3159 }
3160 3160 catch (QPDFUsage& e)
... ... @@ -3278,7 +3278,7 @@ void runtest(int n, char const* filename1, char const* arg2)
3278 3278 std::string filename(std::string(filename1) + ".obfuscated");
3279 3279 size_t size = 0;
3280 3280 QUtil::read_file_into_memory(filename.c_str(), file_buf, size);
3281   - char* p = file_buf.getPointer();
  3281 + char* p = file_buf.get();
3282 3282 for (size_t i = 0; i < size; ++i)
3283 3283 {
3284 3284 p[i] = static_cast<char>(p[i] ^ 0xcc);
... ... @@ -3309,7 +3309,7 @@ void runtest(int n, char const* filename1, char const* arg2)
3309 3309 QTC::TC("qpdf", "exercise processMemoryFile");
3310 3310 size_t size = 0;
3311 3311 QUtil::read_file_into_memory(filename1, file_buf, size);
3312   - pdf.processMemoryFile(filename1, file_buf.getPointer(), size);
  3312 + pdf.processMemoryFile(filename1, file_buf.get(), size);
3313 3313 }
3314 3314  
3315 3315 std::map<int, void (*)(QPDF&, char const*)> test_functions = {
... ...
qpdf/test_tokenizer.cc
... ... @@ -222,7 +222,7 @@ static void process(char const* filename, bool include_ignorable,
222 222 (*iter).pipeContents(&plb);
223 223 PointerHolder<Buffer> content_data = plb.getBuffer();
224 224 BufferInputSource* bis = new BufferInputSource(
225   - "content data", content_data.getPointer());
  225 + "content data", content_data.get());
226 226 is = bis;
227 227 dump_tokens(is, "PAGE " + QUtil::int_to_string(pageno),
228 228 max_len, include_ignorable, false, true);
... ... @@ -240,7 +240,7 @@ static void process(char const* filename, bool include_ignorable,
240 240 PointerHolder<Buffer> b =
241 241 (*iter).getStreamData(qpdf_dl_specialized);
242 242 BufferInputSource* bis = new BufferInputSource(
243   - "object stream data", b.getPointer());
  243 + "object stream data", b.get());
244 244 is = bis;
245 245 dump_tokens(is, "OBJECT STREAM " +
246 246 QUtil::int_to_string((*iter).getObjectID()),
... ...
zlib-flate/zlib-flate.cc
... ... @@ -77,7 +77,7 @@ int main(int argc, char* argv[])
77 77 QUtil::binary_stdin();
78 78 PointerHolder<Pl_StdioFile> out = new Pl_StdioFile("stdout", stdout);
79 79 PointerHolder<Pl_Flate> flate =
80   - new Pl_Flate("flate", out.getPointer(), action);
  80 + new Pl_Flate("flate", out.get(), action);
81 81 bool warn = false;
82 82 flate->setWarnCallback([&warn](char const* msg, int code) {
83 83 warn = true;
... ...