aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/hex.cc
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 /libtests/hex.cc
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 'libtests/hex.cc')
-rw-r--r--libtests/hex.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/libtests/hex.cc b/libtests/hex.cc
index 0480c7ea..9e708204 100644
--- a/libtests/hex.cc
+++ b/libtests/hex.cc
@@ -4,33 +4,27 @@
#include <iostream>
#include <stdlib.h>
-int main()
+int
+main()
{
Pl_StdioFile out("stdout", stdout);
Pl_ASCIIHexDecoder decode("decode", &out);
- try
- {
+ try {
unsigned char buf[10000];
bool done = false;
- while (! done)
- {
+ while (!done) {
size_t len = fread(buf, 1, sizeof(buf), stdin);
- if (len <= 0)
- {
+ if (len <= 0) {
done = true;
- }
- else
- {
+ } else {
decode.write(buf, len);
}
}
decode.finish();
- }
- catch (std::exception& e)
- {
+ } catch (std::exception& e) {
std::cerr << e.what() << std::endl;
- exit(2);
+ exit(2);
}
return 0;