use clang-tidy and clang-format to update/modernize/simplify code

This commit is contained in:
Axel Kohlmeyer
2022-05-31 14:46:57 -04:00
parent 7c0c7ce93c
commit 234b9f180a
19 changed files with 146 additions and 132 deletions

View File

@ -37,23 +37,23 @@ public:
END_HIDE_OUTPUT();
}
std::string dump_filename(std::string ident)
std::string dump_filename(const std::string &ident)
{
return fmt::format("dump_{}_{}.melt", dump_style, ident);
}
std::string text_dump_filename(std::string ident)
std::string text_dump_filename(const std::string &ident)
{
return fmt::format("dump_{}_text_{}.melt", dump_style, ident);
}
std::string binary_dump_filename(std::string ident)
std::string binary_dump_filename(const std::string &ident)
{
return fmt::format("dump_{}_binary_{}.melt.bin", dump_style, ident);
}
void generate_dump(std::string dump_file, std::string fields, std::string dump_modify_options,
int ntimesteps)
void generate_dump(const std::string &dump_file, const std::string &fields,
const std::string &dump_modify_options, int ntimesteps)
{
BEGIN_HIDE_OUTPUT();
command(fmt::format("dump id all {} 1 {} {}", dump_style, dump_file, fields));
@ -80,9 +80,9 @@ public:
END_HIDE_OUTPUT();
}
void generate_text_and_binary_dump(std::string text_file, std::string binary_file,
std::string fields, std::string dump_modify_options,
int ntimesteps)
void generate_text_and_binary_dump(const std::string &text_file, const std::string &binary_file,
const std::string &fields,
const std::string &dump_modify_options, int ntimesteps)
{
BEGIN_HIDE_OUTPUT();
command(fmt::format("dump id0 all {} 1 {} {}", dump_style, text_file, fields));
@ -97,7 +97,7 @@ public:
END_HIDE_OUTPUT();
}
std::string convert_binary_to_text(std::string binary_file)
std::string convert_binary_to_text(const std::string &binary_file)
{
BEGIN_HIDE_OUTPUT();
std::string cmdline = fmt::format("\"{}\" {}", BINARY2TXT_EXECUTABLE, binary_file);