From aa49abdf239bae6065fddd0839ec67a404c9748c Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 15 Sep 2025 21:15:53 +0200 Subject: Add .clang-format Make it easier to keep a consistent style --- src/args.cc | 93 +++++++++++++++++++---------------- src/args.hh | 24 ++++----- src/buffer.cc | 28 +++++------ src/check.hh | 12 ++--- src/csv.cc | 7 +-- src/csv.hh | 2 +- src/decompress.hh | 2 +- src/decompress_lzma.cc | 3 +- src/decompress_z.cc | 10 ++-- src/gen_ugc.cc | 60 +++++++++++------------ src/io.cc | 26 +++++----- src/line.cc | 23 +++++---- src/line.hh | 2 +- src/main.cc | 4 +- src/str.cc | 4 +- src/u.hh | 12 ++--- src/u16.hh | 27 +++++----- src/u8.hh | 39 +++++++++------ src/uio.cc | 130 +++++++++++++++++++++++-------------------------- src/uio.hh | 20 ++++---- src/umod8.hh | 36 ++++++++------ src/unique_fd.hh | 21 +++----- 22 files changed, 291 insertions(+), 294 deletions(-) (limited to 'src') diff --git a/src/args.cc b/src/args.cc index 078db1a..1794941 100644 --- a/src/args.cc +++ b/src/args.cc @@ -26,10 +26,13 @@ class OptionImpl : public Args::OptionArgument { OptionalArgument, }; - OptionImpl(Type type, char shortname, std::string longname, - std::string arg, std::string help) - : type(type), shortname(shortname), longname(std::move(longname)), - arg(std::move(arg)), help(std::move(help)) {} + OptionImpl(Type type, char shortname, std::string longname, std::string arg, + std::string help) + : type(type), + shortname(shortname), + longname(std::move(longname)), + arg(std::move(arg)), + help(std::move(help)) {} const Type type; const char shortname; @@ -57,13 +60,13 @@ class OptionImpl : public Args::OptionArgument { void set_argument(std::string value) { assert(type == Type::RequiredArgument || type == Type::OptionalArgument); - is_set_= true; + is_set_ = true; value_ = std::move(value); } void set_no_argument() { assert(type == Type::NoArgument || type == Type::OptionalArgument); - is_set_= true; + is_set_ = true; value_.reset(); } @@ -74,11 +77,10 @@ class OptionImpl : public Args::OptionArgument { class ArgsImpl : public Args { public: - explicit ArgsImpl(std::string prgname) - : prgname_(std::move(prgname)) {} + explicit ArgsImpl(std::string prgname) : prgname_(std::move(prgname)) {} - std::shared_ptr