diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/core/StarOptionParser.cpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
Fixed a huge amount of Clang warnings
On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably.
99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified.
Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects.
Most remaining warnings are now unused parameters.
Diffstat (limited to 'source/core/StarOptionParser.cpp')
-rw-r--r-- | source/core/StarOptionParser.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/core/StarOptionParser.cpp b/source/core/StarOptionParser.cpp index f849f43..3cd32cc 100644 --- a/source/core/StarOptionParser.cpp +++ b/source/core/StarOptionParser.cpp @@ -4,29 +4,29 @@ namespace Star { void OptionParser::setCommandName(String commandName) { - m_commandName = move(commandName); + m_commandName = std::move(commandName); } void OptionParser::setSummary(String summary) { - m_summary = move(summary); + m_summary = std::move(summary); } void OptionParser::setAdditionalHelp(String help) { - m_additionalHelp = move(help); + m_additionalHelp = std::move(help); } void OptionParser::addSwitch(String const& flag, String description) { - if (!m_options.insert(flag, Switch{flag, move(description)}).second) + if (!m_options.insert(flag, Switch{flag, std::move(description)}).second) throw OptionParserException::format("Duplicate switch '-{}' added", flag); } void OptionParser::addParameter(String const& flag, String argument, RequirementMode requirementMode, String description) { - if (!m_options.insert(flag, Parameter{flag, move(argument), requirementMode, move(description)}).second) + if (!m_options.insert(flag, Parameter{flag, std::move(argument), requirementMode, std::move(description)}).second) throw OptionParserException::format("Duplicate flag '-{}' added", flag); } void OptionParser::addArgument(String argument, RequirementMode requirementMode, String description) { - m_arguments.append(Argument{move(argument), requirementMode, move(description)}); + m_arguments.append(Argument{std::move(argument), requirementMode, std::move(description)}); } pair<OptionParser::Options, StringList> OptionParser::parseOptions(StringList const& arguments) const { @@ -51,7 +51,7 @@ pair<OptionParser::Options, StringList> OptionParser::parseOptions(StringList co } if (option->is<Switch>()) { - result.switches.add(move(flag)); + result.switches.add(std::move(flag)); } else { auto const& parameter = option->get<Parameter>(); if (!it.hasNext()) { @@ -63,7 +63,7 @@ pair<OptionParser::Options, StringList> OptionParser::parseOptions(StringList co errors.append(strf("Option with argument '-{}' specified multiple times", flag)); continue; } - result.parameters[move(flag)].append(move(val)); + result.parameters[std::move(flag)].append(std::move(val)); } } else { @@ -96,7 +96,7 @@ pair<OptionParser::Options, StringList> OptionParser::parseOptions(StringList co errors.append(strf( "Too many positional arguments given, expected at most {} got {}", maximumArguments, result.arguments.size())); - return {move(result), move(errors)}; + return {std::move(result), std::move(errors)}; } void OptionParser::printHelp(std::ostream& os) const { |