Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkenbilt committed Feb 4, 2024
1 parent 532cc58 commit 7caa9dd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions libqpdf/QPDF.cc
Expand Up @@ -711,8 +711,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
QPDFObjGen last_og{-1, 0};
for (auto const& item: m->xref_table) {
auto id = item.first.getObj();
if (id == last_og.getObj() && id > 0)
if (id == last_og.getObj() && id > 0) {
removeObject(last_og);
}
last_og = item.first;
}
}
Expand Down Expand Up @@ -2413,9 +2414,10 @@ QPDF::getCompressibleObjGens()
if (obj.getObjectID() > 0) {
QPDFObjGen og = obj.getObjGen();
const size_t id = toS(og.getObj() - 1);
if (id >= max_obj)
if (id >= max_obj) {
throw std::logic_error(
"unexpected object id encountered in getCompressibleObjGens");
}
if (visited[id]) {
QTC::TC("qpdf", "QPDF loop detected traversing objects");
continue;
Expand Down
7 changes: 3 additions & 4 deletions libqpdf/QPDFJob.cc
Expand Up @@ -3097,10 +3097,9 @@ QPDFJob::writeOutfile(QPDF& pdf)
try {
QUtil::remove_file(backup.c_str());
} catch (QPDFSystemError& e) {
*m->log->getError()
<< m->message_prefix << ": unable to delete original file (" << e.what() << ");"
<< " original file left in " << backup
<< ", but the input was successfully replaced\n";
*m->log->getError() << m->message_prefix << ": unable to delete original file ("
<< e.what() << ");" << " original file left in " << backup
<< ", but the input was successfully replaced\n";
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion libqpdf/QPDFParser.cc
Expand Up @@ -253,8 +253,9 @@ QPDFParser::parseRemainder(bool content_stream)
dict[frame->key] = QPDF_Null::create();
}

if (!frame->olist.empty())
if (!frame->olist.empty()) {
fixMissingKeys();
}

if (!frame->contents_string.empty() && dict.count("/Type") &&
dict["/Type"].isNameAndEquals("/Sig") && dict.count("/ByteRange") &&
Expand Down
2 changes: 1 addition & 1 deletion libqpdf/QPDF_Array.cc
@@ -1,8 +1,8 @@
#include <qpdf/QPDF_Array.hh>

#include <qpdf/QTC.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QPDFObject_private.hh>
#include <qpdf/QTC.hh>

static const QPDFObjectHandle null_oh = QPDFObjectHandle::newNull();

Expand Down
2 changes: 1 addition & 1 deletion libqpdf/qpdf/Pl_TIFFPredictor.hh
Expand Up @@ -6,7 +6,7 @@

#include <qpdf/Pipeline.hh>

#include<vector>
#include <vector>

class Pl_TIFFPredictor: public Pipeline
{
Expand Down
2 changes: 1 addition & 1 deletion libtests/json.cc
Expand Up @@ -137,7 +137,7 @@ test_main()
// Check default constructed JSON object (order as per JSON.hh).
JSON uninitialized;
std::string ws;
auto pl = Pl_String ("", nullptr, ws);
auto pl = Pl_String("", nullptr, ws);
uninitialized.write(&pl);
assert(ws == "null");
assert(uninitialized.unparse() == "null");
Expand Down

0 comments on commit 7caa9dd

Please sign in to comment.