aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/NNTree.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-03 22:10:27 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-05 20:56:19 +0200
commit77e889495f7c513ba8677df5fe662f08053709eb (patch)
tree06191e152c3d7a4e398837ebc4f87038b1797bc9 /libqpdf/NNTree.cc
parent12f1eb15ca3fed6310402847559a7c99d3c77847 (diff)
downloadqpdf-77e889495f7c513ba8677df5fe662f08053709eb.tar.zst
Update some code manually to get better formatting results
Add comments to force line breaks, parenthesize function arguments that are contatenated strings, etc. -- these kinds of changes improve clang-format's results and also cause emacs cc-mode to match clang-format. After this type of change, most of the time, when clang-format and emacs disagree, clang-format is better.
Diffstat (limited to 'libqpdf/NNTree.cc')
-rw-r--r--libqpdf/NNTree.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/libqpdf/NNTree.cc b/libqpdf/NNTree.cc
index c85ac4cf..8c6b4bab 100644
--- a/libqpdf/NNTree.cc
+++ b/libqpdf/NNTree.cc
@@ -21,12 +21,14 @@ warn(QPDF* qpdf, QPDFObjectHandle& node, std::string const& msg)
// ABI: in qpdf 11, change to a reference.
if (qpdf) {
- qpdf->warn(QPDFExc(
- qpdf_e_damaged_pdf,
- qpdf->getFilename(),
- get_description(node),
- 0,
- msg));
+ qpdf->warn(
+ // line-break
+ QPDFExc(
+ qpdf_e_damaged_pdf,
+ qpdf->getFilename(),
+ get_description(node),
+ 0,
+ msg));
}
}
@@ -122,8 +124,8 @@ NNTreeIterator::getNextKid(PathElement& pe, bool backward)
warn(
impl.qpdf,
pe.node,
- "skipping over invalid kid at index " +
- QUtil::int_to_string(pe.kid_number));
+ ("skipping over invalid kid at index " +
+ QUtil::int_to_string(pe.kid_number)));
}
} else {
result = QPDFObjectHandle::newNull();
@@ -179,8 +181,8 @@ NNTreeIterator::increment(bool backward)
warn(
impl.qpdf,
this->node,
- "item " + QUtil::int_to_string(this->item_number) +
- " has the wrong type");
+ ("item " + QUtil::int_to_string(this->item_number) +
+ " has the wrong type"));
} else {
found_valid_key = true;
}
@@ -708,9 +710,9 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
warn(
impl.qpdf,
node,
- "converting kid number " +
- QUtil::int_to_string(kid_number) +
- " to an indirect object");
+ ("converting kid number " +
+ QUtil::int_to_string(kid_number) +
+ " to an indirect object"));
next = impl.qpdf->makeIndirectObject(next);
kids.setArrayItem(kid_number, next);
} else {
@@ -718,8 +720,8 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
warn(
impl.qpdf,
node,
- "kid number " + QUtil::int_to_string(kid_number) +
- " is not an indirect object");
+ ("kid number " + QUtil::int_to_string(kid_number) +
+ " is not an indirect object"));
}
}
node = next;
@@ -732,8 +734,8 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
warn(
impl.qpdf,
node,
- "name/number tree node has neither non-empty " +
- impl.details.itemsKey() + " nor /Kids");
+ ("name/number tree node has neither non-empty " +
+ impl.details.itemsKey() + " nor /Kids"));
failed = true;
break;
}
@@ -876,8 +878,8 @@ NNTreeImpl::compareKeyItem(
error(
qpdf,
this->oh,
- "item at index " + QUtil::int_to_string(2 * idx) +
- " is not the right type");
+ ("item at index " + QUtil::int_to_string(2 * idx) +
+ " is not the right type"));
}
return details.compareKeys(key, items.getArrayItem(2 * idx));
}