aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-06-25 14:29:07 +0200
committerJay Berkenbilt <ejb@ql.org>2022-06-25 17:11:24 +0200
commit6c4537885e89f69b9368251759f75127e6dcc4d6 (patch)
treeee3ad1d6bf306e7121d8f31328613b1e5934c629
parent7836e1974726f379b96d980cfa39561cfab2e0ff (diff)
downloadqpdf-6c4537885e89f69b9368251759f75127e6dcc4d6.tar.zst
Reformat code
-rw-r--r--examples/qpdfjob-c-save-attachment.c3
-rw-r--r--libqpdf/QPDFJob.cc7
-rw-r--r--libqpdf/QPDFObjectHandle.cc2
-rw-r--r--libqpdf/qpdfjob-c.cc9
-rw-r--r--libtests/pl_function.cc16
5 files changed, 19 insertions, 18 deletions
diff --git a/examples/qpdfjob-c-save-attachment.c b/examples/qpdfjob-c-save-attachment.c
index 950e297b..6f67e25b 100644
--- a/examples/qpdfjob-c-save-attachment.c
+++ b/examples/qpdfjob-c-save-attachment.c
@@ -88,8 +88,7 @@ main(int argc, char* argv[])
l, qpdf_log_dest_custom, save_to_file, (void*)outfile, 0);
qpdflogger_cleanup(&l);
j = qpdfjob_init();
- status = (qpdfjob_initialize_from_argv(j, j_argv) ||
- qpdfjob_run(j));
+ status = (qpdfjob_initialize_from_argv(j, j_argv) || qpdfjob_run(j));
qpdfjob_cleanup(&j);
free(attachment_arg);
fclose(outfile);
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc
index 7227bd1b..c5f0eb2d 100644
--- a/libqpdf/QPDFJob.cc
+++ b/libqpdf/QPDFJob.cc
@@ -465,7 +465,8 @@ QPDFJob::setOutputStreams(std::ostream* out, std::ostream* err)
}
void
-QPDFJob::registerProgressReporter(std::function<void(int)> handler) {
+QPDFJob::registerProgressReporter(std::function<void(int)> handler)
+{
this->m->progress_handler = handler;
}
@@ -1239,8 +1240,8 @@ QPDFJob::doJSONPageLabels(Pipeline* p, bool& first, QPDF& pdf)
{
JSON j_labels = JSON::makeArray();
QPDFPageLabelDocumentHelper pldh(pdf);
- long long npages = QIntC::to_longlong(
- QPDFPageDocumentHelper(pdf).getAllPages().size());
+ long long npages =
+ QIntC::to_longlong(QPDFPageDocumentHelper(pdf).getAllPages().size());
if (pldh.hasPageLabels()) {
std::vector<QPDFObjectHandle> labels;
pldh.getLabelsForPageRange(0, npages - 1, 0, labels);
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 62739675..b3f21a27 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -1552,7 +1552,7 @@ QPDFObjectHandle::getObjGen() const
std::string
QPDFObjectHandle::getObjGenAsStr() const
{
- return QUtil::int_to_string(this->objid) + " " +
+ return QUtil::int_to_string(this->objid) + " " +
QUtil::int_to_string(this->generation);
}
diff --git a/libqpdf/qpdfjob-c.cc b/libqpdf/qpdfjob-c.cc
index 4f7bd92c..9367547c 100644
--- a/libqpdf/qpdfjob-c.cc
+++ b/libqpdf/qpdfjob-c.cc
@@ -85,7 +85,8 @@ qpdfjob_run(qpdfjob_handle j)
});
}
-static int run_with_handle(std::function<int(qpdfjob_handle)> fn)
+static int
+run_with_handle(std::function<int(qpdfjob_handle)> fn)
{
auto j = qpdfjob_init();
int status = fn(j);
@@ -96,7 +97,8 @@ static int run_with_handle(std::function<int(qpdfjob_handle)> fn)
return status;
}
-int qpdfjob_run_from_argv(char const* const argv[])
+int
+qpdfjob_run_from_argv(char const* const argv[])
{
return run_with_handle([argv](qpdfjob_handle j) {
return qpdfjob_initialize_from_argv(j, argv);
@@ -113,7 +115,8 @@ qpdfjob_run_from_wide_argv(wchar_t const* const argv[])
}
#endif /* QPDF_NO_WCHAR_T */
-int qpdfjob_run_from_json(char const* json)
+int
+qpdfjob_run_from_json(char const* json)
{
return run_with_handle([json](qpdfjob_handle j) {
return qpdfjob_initialize_from_json(j, json);
diff --git a/libtests/pl_function.cc b/libtests/pl_function.cc
index 960ad5cb..101ec02e 100644
--- a/libtests/pl_function.cc
+++ b/libtests/pl_function.cc
@@ -1,26 +1,24 @@
#include <qpdf/assert_test.h>
+#include <qpdf/Pl_Base64.hh>
#include <qpdf/Pl_Function.hh>
#include <qpdf/Pl_String.hh>
-#include <qpdf/Pl_Base64.hh>
#include <iostream>
int
main(int argc, char* argv[])
{
- Pl_Function p1(
- "p1", nullptr, [](unsigned char const* data, size_t len) {
- std::cout << "p1: " << len << ": " << data << std::endl;
- });
+ Pl_Function p1("p1", nullptr, [](unsigned char const* data, size_t len) {
+ std::cout << "p1: " << len << ": " << data << std::endl;
+ });
p1.write(reinterpret_cast<unsigned char const*>("potato"), 6);
std::string s;
Pl_String ps("string", nullptr, s);
Pl_Base64 b("base64", &ps, Pl_Base64::a_encode);
- Pl_Function p2(
- "p2", &b, [](unsigned char const* data, size_t len) {
- std::cout << "p2: " << len << ": " << data << std::endl;
- });
+ Pl_Function p2("p2", &b, [](unsigned char const* data, size_t len) {
+ std::cout << "p2: " << len << ": " << data << std::endl;
+ });
p2.write(reinterpret_cast<unsigned char const*>("salad"), 5);
p2.finish();
assert(s == "c2FsYWQ=");