From 12f1eb15ca3fed6310402847559a7c99d3c77847 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 2 Apr 2022 17:14:10 -0400 Subject: 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 --- libtests/runlength.cc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'libtests/runlength.cc') 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 #include -#include -#include #include +#include #include +#include -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); } } -- cgit v1.2.3-54-g00ecf