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/pointer_holder.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/pointer_holder.cc')
-rw-r--r-- | libtests/pointer_holder.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libtests/pointer_holder.cc b/libtests/pointer_holder.cc index 67c13d5a..70c83aeb 100644 --- a/libtests/pointer_holder.cc +++ b/libtests/pointer_holder.cc @@ -6,8 +6,8 @@ #include <qpdf/PointerHolder.hh> #include <iostream> -#include <stdlib.h> #include <list> +#include <stdlib.h> class Object { @@ -22,7 +22,6 @@ class Object int id; }; - int Object::next_id = 0; Object::Object() @@ -50,21 +49,24 @@ Object::hello() const typedef PointerHolder<Object> ObjectHolder; -void callHello(ObjectHolder& oh) +void +callHello(ObjectHolder& oh) { oh.getPointer()->hello(); oh->hello(); (*oh).hello(); } -void callHelloWithGet(ObjectHolder const& oh) +void +callHelloWithGet(ObjectHolder const& oh) { oh.get()->hello(); oh->hello(); (*oh).hello(); } -int main(int argc, char* argv[]) +int +main(int argc, char* argv[]) { std::list<ObjectHolder> ol1; @@ -81,18 +83,15 @@ int main(int argc, char* argv[]) ObjectHolder oh4; ObjectHolder oh5; std::cout << "oh5 refcount = " << oh5.getRefcount() << std::endl; - if (oh4 == oh5) - { + if (oh4 == oh5) { std::cout << "nulls equal" << std::endl; } oh3 = oh1; oh4 = oh2; - if (oh3 == oh4) - { + if (oh3 == oh4) { std::cout << "equal okay" << std::endl; } - if ((! (oh3 < oh4)) && (! (oh4 < oh3))) - { + if ((!(oh3 < oh4)) && (!(oh4 < oh3))) { std::cout << "less than okay" << std::endl; } ol1.push_back(oh3); |