From 3a86b893f710453ba935903d68200a7bee4cbad2 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 27 Sep 2022 01:10:08 +0100 Subject: Remove redundant parameters from QPDF_Stream::warn --- libqpdf/QPDF_Stream.cc | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) (limited to 'libqpdf/QPDF_Stream.cc') diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index fbd1e47e..ec22b964 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -415,10 +415,7 @@ QPDF_Stream::filterable( if (!filters_okay) { QTC::TC("qpdf", "QPDF_Stream invalid filter"); - warn( - qpdf_e_damaged_pdf, - this->offset, - "stream filter type is not name or array"); + warn("stream filter type is not name or array"); return false; } @@ -466,11 +463,7 @@ QPDF_Stream::filterable( // one case of a file whose /DecodeParms was [ << >> ] when // /Filters was empty has been seen in the wild. if ((filters.size() != 0) && (decode_parms.size() != filters.size())) { - warn( - qpdf_e_damaged_pdf, - this->offset, - "stream /DecodeParms length is" - " inconsistent with filters"); + warn("stream /DecodeParms length is inconsistent with filters"); filterable = false; } @@ -582,9 +575,8 @@ QPDF_Stream::pipeStreamData( } Pl_Flate* flate = dynamic_cast(pipeline); if (flate != nullptr) { - flate->setWarnCallback([this](char const* msg, int code) { - warn(qpdf_e_damaged_pdf, this->offset, msg); - }); + flate->setWarnCallback( + [this](char const* msg, int code) { warn(msg); }); } } } @@ -647,28 +639,17 @@ QPDF_Stream::pipeStreamData( if (filter && (!suppress_warnings) && normalizer.get() && normalizer->anyBadTokens()) { - warn( - qpdf_e_damaged_pdf, - this->offset, - "content normalization encountered bad tokens"); + warn("content normalization encountered bad tokens"); if (normalizer->lastTokenWasBad()) { QTC::TC("qpdf", "QPDF_Stream bad token at end during normalize"); - warn( - qpdf_e_damaged_pdf, - this->offset, - "normalized content ended with a bad token;" - " you may be able to resolve this by" - " coalescing content streams in combination" - " with normalizing content. From the command" - " line, specify --coalesce-contents"); + warn("normalized content ended with a bad token; you may be able " + "to resolve this by coalescing content streams in combination " + "with normalizing content. From the command line, specify " + "--coalesce-contents"); } - warn( - qpdf_e_damaged_pdf, - this->offset, - "Resulting stream data may be corrupted but is" - " may still useful for manual inspection." - " For more information on this warning, search" - " for content normalization in the manual."); + warn("Resulting stream data may be corrupted but is may still useful " + "for manual inspection. For more information on this warning, " + "search for content normalization in the manual."); } return success; @@ -733,10 +714,7 @@ QPDF_Stream::replaceDict(QPDFObjectHandle const& new_dict) } void -QPDF_Stream::warn( - qpdf_error_code_e error_code, - qpdf_offset_t offset, - std::string const& message) +QPDF_Stream::warn(std::string const& message) { - this->qpdf->warn(error_code, "", offset, message); + this->qpdf->warn(qpdf_e_damaged_pdf, "", this->offset, message); } -- cgit v1.2.3-70-g09d2