From c5dc6d80675aa40f1d02dfabe87c39191f4895d1 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 10 Aug 2017 18:17:24 -0400 Subject: [PATCH] Remove unused PointerHolder interface Also fix a bug resulting from incorrect use of PointerHolder because of this unused parameter. --- ChangeLog | 13 +++++++++++++ include/qpdf/PointerHolder.hh | 3 +-- qpdf/qpdf.cc | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f790baa1..e04bdd8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2017-08-10 Jay Berkenbilt + + * Remove unused "tracing" parameter from PointerHolder's + (T*, bool) constructor. This change breaks source code + compatibility, but since this argument to PointerHolder has not + used for a long time and the presence of a boolean parameter in + the primary constructor makes it too easy to use that by mistake + when trying to use PointerHolder for arrays, it seems like it's + finally time to take it out. If you have a compile error because + of this change, please check to see whether you intended to use + the (bool, T*) version of the constructor instead. If not, just + remove the second parameter. + 2017-08-05 Jay Berkenbilt * Add --single-pages option to cause output to be written to a diff --git a/include/qpdf/PointerHolder.hh b/include/qpdf/PointerHolder.hh index 856897d4..7a2a3b83 100644 --- a/include/qpdf/PointerHolder.hh +++ b/include/qpdf/PointerHolder.hh @@ -69,8 +69,7 @@ class PointerHolder }; public: - // "tracing" is not used but is kept for interface backward compatbility - PointerHolder(T* pointer = 0, bool tracing = false) + PointerHolder(T* pointer = 0) { this->init(new Data(pointer, false)); } diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index 86753945..604b8363 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -1103,7 +1103,7 @@ static void read_args_from_file(char const* filename, iter != lines.end(); ++iter) { new_argv.push_back( - PointerHolder(QUtil::copy_string((*iter).c_str()), true)); + PointerHolder(true, QUtil::copy_string((*iter).c_str()))); } }