aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-09-27 02:10:08 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-11-19 20:10:42 +0100
commit3a86b893f710453ba935903d68200a7bee4cbad2 (patch)
tree9aa074f7a6bd141523a7e87ad430caeb9357bc48
parent69e67b45bba0ab2c2ee83d87581ad89f6f03181c (diff)
downloadqpdf-3a86b893f710453ba935903d68200a7bee4cbad2.tar.zst
Remove redundant parameters from QPDF_Stream::warn
-rw-r--r--libqpdf/QPDF_Stream.cc50
-rw-r--r--libqpdf/qpdf/QPDF_Stream.hh5
2 files changed, 15 insertions, 40 deletions
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<Pl_Flate*>(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);
}
diff --git a/libqpdf/qpdf/QPDF_Stream.hh b/libqpdf/qpdf/QPDF_Stream.hh
index 2a9a7592..cb5c9256 100644
--- a/libqpdf/qpdf/QPDF_Stream.hh
+++ b/libqpdf/qpdf/QPDF_Stream.hh
@@ -98,10 +98,7 @@ class QPDF_Stream: public QPDFValue
std::vector<std::shared_ptr<QPDFStreamFilter>>& filters,
bool& specialized_compression,
bool& lossy_compression);
- void warn(
- qpdf_error_code_e error_code,
- qpdf_offset_t offset,
- std::string const& message);
+ void warn(std::string const& message);
void setDictDescription();
bool filter_on_write;