diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-02 23:14:10 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-04 14:10:40 +0200 |
commit | 12f1eb15ca3fed6310402847559a7c99d3c77847 (patch) | |
tree | 8935675b623c6f3b4914b8b44f7fa5f2816a9241 /libtests/runlength.cc | |
parent | f20fa61eb4c323eb1642c69c236b3d9a1f8b2cdb (diff) | |
download | qpdf-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 'libtests/runlength.cc')
-rw-r--r-- | libtests/runlength.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/libtests/runlength.cc b/libtests/runlength.cc index f54e7300..456e33a2 100644 --- a/libtests/runlength.cc +++ b/libtests/runlength.cc @@ -2,15 +2,15 @@ #include <qpdf/Pl_StdioFile.hh> #include <qpdf/QUtil.hh> -#include <stdio.h> -#include <string.h> #include <iostream> +#include <stdio.h> #include <stdlib.h> +#include <string.h> -int main(int argc, char* argv[]) +int +main(int argc, char* argv[]) { - if (argc != 4) - { + if (argc != 4) { std::cerr << "Usage: runlength {-encode|-decode} infile outfile" << std::endl; exit(2); @@ -26,17 +26,14 @@ int main(int argc, char* argv[]) unsigned char buf[100]; bool done = false; Pl_RunLength rl( - "runlength", &out, + "runlength", + &out, (encode ? Pl_RunLength::a_encode : Pl_RunLength::a_decode)); - while (! done) - { + while (!done) { size_t len = fread(buf, 1, sizeof(buf), infile); - if (len <= 0) - { + if (len <= 0) { done = true; - } - else - { + } else { rl.write(buf, len); } } |