Remove redundant using namespace Fallback

C++ has ADL to find overloads. using namespace does nothing in this
case.
This commit is contained in:
elsid 2025-04-18 12:26:23 +02:00
parent 87d77a6882
commit 0d5e9ef85f
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
5 changed files with 8 additions and 14 deletions

View file

@ -53,8 +53,6 @@ namespace
bpo::options_description makeOptionsDescription()
{
using Fallback::FallbackMap;
bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");
@ -87,7 +85,8 @@ namespace
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default");
addOption("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")->multitoken()->composing(),
addOption("fallback",
bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")->multitoken()->composing(),
"fallback values");
Files::ConfigurationManager::addCommonOptions(result);

View file

@ -62,8 +62,6 @@ namespace NavMeshTool
bpo::options_description makeOptionsDescription()
{
using Fallback::FallbackMap;
bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");

View file

@ -38,8 +38,6 @@
#include "view/doc/viewmanager.hpp"
using namespace Fallback;
CS::Editor::Editor(int argc, char** argv)
: mConfigVariables(readConfiguration())
, mSettingsState(mCfgMgr)
@ -124,7 +122,10 @@ boost::program_options::variables_map CS::Editor::readConfiguration()
->default_value(std::vector<std::string>(), "fallback-archive")
->multitoken());
addOption("fallback",
boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")->multitoken()->composing(),
boost::program_options::value<Fallback::FallbackMap>()
->default_value(Fallback::FallbackMap(), "")
->multitoken()
->composing(),
"fallback values");
Files::ConfigurationManager::addCommonOptions(desc);
@ -141,7 +142,7 @@ std::pair<Files::PathContainer, std::vector<std::string>> CS::Editor::readConfig
{
boost::program_options::variables_map& variables = mConfigVariables;
Fallback::Map::init(variables["fallback"].as<FallbackMap>().mMap);
Fallback::Map::init(variables["fallback"].as<Fallback::FallbackMap>().mMap);
mEncodingName = variables["encoding"].as<std::string>();
mDocumentManager.setEncoding(ToUTF8::calculateEncoding(mEncodingName));

View file

@ -28,8 +28,6 @@ extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x
#include <unistd.h>
#endif
using namespace Fallback;
/**
* \brief Parses application command line and calls \ref Cfg::ConfigurationManager
* to parse configuration files.
@ -152,7 +150,7 @@ bool parseOptions(int argc, char** argv, OMW::Engine& engine, Files::Configurati
engine.setSaveGameFile(variables["load-savegame"].as<Files::MaybeQuotedPath>().u8string());
// other settings
Fallback::Map::init(variables["fallback"].as<FallbackMap>().mMap);
Fallback::Map::init(variables["fallback"].as<Fallback::FallbackMap>().mMap);
engine.setSoundUsage(!variables["no-sound"].as<bool>());
engine.setActivationDistanceOverride(variables["activate-dist"].as<int>());
engine.enableFontExport(variables["export-fonts"].as<bool>());

View file

@ -24,8 +24,6 @@ namespace Fallback
};
// Parses and validates a fallback map from boost program_options.
// Note: for boost to pick up the validate function, you need to pull in the namespace e.g.
// by using namespace Fallback;
void validate(boost::any& v, std::vector<std::string> const& tokens, FallbackMap*, int);
}