aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qpdfjob-c.c
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-02 23:14:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-04 14:10:40 +0200
commit12f1eb15ca3fed6310402847559a7c99d3c77847 (patch)
tree8935675b623c6f3b4914b8b44f7fa5f2816a9241 /examples/qpdfjob-c.c
parentf20fa61eb4c323eb1642c69c236b3d9a1f8b2cdb (diff)
downloadqpdf-12f1eb15ca3fed6310402847559a7c99d3c77847.tar.zst
Programmatically apply new formatting to code
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
Diffstat (limited to 'examples/qpdfjob-c.c')
-rw-r--r--examples/qpdfjob-c.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/examples/qpdfjob-c.c b/examples/qpdfjob-c.c
index ad81655a..ee2ef4ab 100644
--- a/examples/qpdfjob-c.c
+++ b/examples/qpdfjob-c.c
@@ -10,13 +10,15 @@
static char const* whoami = 0;
-static void usage()
+static void
+usage()
{
fprintf(stderr, "Usage: %s infile outfile\n", whoami);
exit(2);
}
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
{
char* infile = NULL;
char* outfile = NULL;
@@ -24,21 +26,15 @@ int main(int argc, char* argv[])
int r = 0;
char* p = 0;
- if ((p = strrchr(argv[0], '/')) != NULL)
- {
+ if ((p = strrchr(argv[0], '/')) != NULL) {
whoami = p + 1;
- }
- else if ((p = strrchr(argv[0], '\\')) != NULL)
- {
+ } else if ((p = strrchr(argv[0], '\\')) != NULL) {
whoami = p + 1;
- }
- else
- {
+ } else {
whoami = argv[0];
}
- if (argc != 3)
- {
+ if (argc != 3) {
usage();
}