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/json_parse.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/json_parse.cc')
-rw-r--r-- | libtests/json_parse.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libtests/json_parse.cc b/libtests/json_parse.cc index a2f004f5..13d29b65 100644 --- a/libtests/json_parse.cc +++ b/libtests/json_parse.cc @@ -2,25 +2,22 @@ #include <qpdf/QUtil.hh> #include <iostream> -int main(int argc, char* argv[]) +int +main(int argc, char* argv[]) { - if (argc != 2) - { + if (argc != 2) { std::cerr << "Usage: json_parse file" << std::endl; return 2; } char const* filename = argv[1]; - try - { + try { PointerHolder<char> buf; size_t size; QUtil::read_file_into_memory(filename, buf, size); std::string s(buf.get(), size); std::cout << JSON::parse(s).unparse() << std::endl; - } - catch (std::exception& e) - { - std::cerr << "exception: " << filename<< ": " << e.what() << std::endl; + } catch (std::exception& e) { + std::cerr << "exception: " << filename << ": " << e.what() << std::endl; return 2; } return 0; |