diff --git a/hecl/driver/ToolSpec.hpp b/hecl/driver/ToolSpec.hpp index 4ab832832..3fe7d1cae 100644 --- a/hecl/driver/ToolSpec.hpp +++ b/hecl/driver/ToolSpec.hpp @@ -28,11 +28,9 @@ public: hecl::SystemString firstArg = info.args.front(); hecl::ToLower(firstArg); - static const hecl::SystemString enable(_S("enable")); - static const hecl::SystemString disable(_S("disable")); - if (!firstArg.compare(enable)) + if (!firstArg.compare(_S("enable"))) mode = MENABLE; - else if (!firstArg.compare(disable)) + else if (!firstArg.compare(_S("disable"))) mode = MDISABLE; else return; diff --git a/hecl/lib/Database/Project.cpp b/hecl/lib/Database/Project.cpp index 3b7cba414..43f6b2948 100644 --- a/hecl/lib/Database/Project.cpp +++ b/hecl/lib/Database/Project.cpp @@ -18,6 +18,7 @@ namespace Database { logvisor::Module LogModule("HECLDatabase"); +static const hecl::FourCC HECLfcc("HECL"); /********************************************** * Project::ConfigFile @@ -231,7 +232,6 @@ Project::Project(const ProjectRootPath& rootPath) uint32_t version; } beacon; #define DATA_VERSION 1 - static const hecl::FourCC HECLfcc("HECL"); if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon)) { fseek(bf, 0, SEEK_SET); diff --git a/hecl/lib/hecl.cpp b/hecl/lib/hecl.cpp index 15c7ebfea..ff9eb0ba7 100644 --- a/hecl/lib/hecl.cpp +++ b/hecl/lib/hecl.cpp @@ -20,6 +20,7 @@ namespace hecl { unsigned VerbosityLevel = 0; logvisor::Module LogModule("hecl"); +static const std::string Illegals {"<>?*\"|"}; void SanitizePath(std::string& path) { @@ -31,8 +32,7 @@ void SanitizePath(std::string& path) bool ic = false; std::transform(path.begin(), path.end(), path.begin(), [&](const char a) -> char { ++p1; - static const std::string illegals {"<>?*\"|"}; - if (illegals.find_first_of(a) != std::string::npos) + if (Illegals.find_first_of(a) != std::string::npos) { ic = false; return '_'; @@ -52,6 +52,8 @@ void SanitizePath(std::string& path) }); } +static const std::wstring WIllegals {L"<>?*\"|"}; + void SanitizePath(std::wstring& path) { if (path.empty()) @@ -62,8 +64,7 @@ void SanitizePath(std::wstring& path) bool ic = false; std::transform(path.begin(), path.end(), path.begin(), [&](const wchar_t a) -> wchar_t { ++p1; - static const std::wstring illegals {L"<>?*\"|"}; - if (illegals.find_first_of(a) != std::wstring::npos) + if (WIllegals.find_first_of(a) != std::wstring::npos) { ic = false; return L'_';