diff --git a/CMakeLists.txt b/CMakeLists.txt index 856aae6..4e52288 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required (VERSION 3.21) -set(EFXC2_VERSION 0.0.9.212) +set(EFXC2_VERSION 0.0.10.214) project (efxc2 VERSION ${EFXC2_VERSION} DESCRIPTION "Enhanced fxc2" HOMEPAGE_URL "https://github.com/JPeterMugaas/efxc2" diff --git a/efxc2Cmds.cpp b/efxc2Cmds.cpp index e6c08ad..436728d 100644 --- a/efxc2Cmds.cpp +++ b/efxc2Cmds.cpp @@ -56,10 +56,6 @@ void efxc2Cmds::option_ignored(_In_ const efxc2Utils::M_STRING_VIEW Opt, _In_ co } void efxc2Cmds::parseInputFile(_In_ const efxc2Utils::M_STRING_VIEW parameter, efxc2CompilerParams::CompilerParams& params, efxc2Files::Files& files) { - efxc2Utils::M_STRING inputFile = efxc2Utils::M_STRING_INIT; -#ifdef _WIN32 - std::string c_inputFile = ""; -#endif #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 6001) @@ -72,6 +68,10 @@ void efxc2Cmds::parseInputFile(_In_ const efxc2Utils::M_STRING_VIEW parameter, e if (params.get_verbose() && params.get_debug()) { std::cout << "Parse input file name\n"; } + efxc2Utils::M_STRING inputFile = efxc2Utils::M_STRING_INIT; +#ifdef _WIN32 + std::string c_inputFile = ""; +#endif inputFile = parameter; #ifdef _WIN32 efxc2Utils::FixupFileName(inputFile); @@ -606,10 +606,10 @@ bool efxc2Cmds::parseCompilerFileCall( //-V2506 } for (CompileFileEntry currentEntry : g_CompilerFileCall) { - if (argument.compare(arg_idx, currentEntry.Param.size(), currentEntry.Param) != 0) { + if (argument.compare(arg_idx, currentEntry.Param.size(), currentEntry.Param) != 0) { //-V2571 //-V3546 continue; } - arg_idx += currentEntry.Param.size(); + arg_idx += currentEntry.Param.size(); //-V2571 //-V3546 if (arg_idx >= argument.size()) { *index += 1; if (*index >= args.size()) { @@ -650,7 +650,7 @@ bool efxc2Cmds::parseIgnoredOptions( //-V2506 else { return false; //-V2506 } - if (efxc2Utils::M_STRING_VIEW toFind = argument.substr(arg_idx, std::string::npos); + if (efxc2Utils::M_STRING_VIEW toFind = argument.substr(arg_idx, std::string::npos); //-V2571 //-V3546 std::ranges::find(g_IgnoredOptions.begin(), g_IgnoredOptions.end(), toFind) != g_IgnoredOptions.end()) { option_ignored(argument, params); return true; @@ -658,7 +658,7 @@ bool efxc2Cmds::parseIgnoredOptions( //-V2506 return false; } -bool efxc2Cmds::parseNotSupportedOptions( //-V2506 +bool efxc2Cmds::parseNotSupportedOptions( //-V2506 _In_ const efxc2Utils::M_CMD_PARAMS& args, _In_ const size_t* index) { if (!index || *index >= args.size()) { @@ -675,7 +675,7 @@ bool efxc2Cmds::parseNotSupportedOptions( //-V2506 else { return false; } - if (efxc2Utils::M_STRING_VIEW toFind = argument.substr(arg_idx, std::string::npos); + if (efxc2Utils::M_STRING_VIEW toFind = argument.substr(arg_idx, std::string::npos); //-V2571 //-V3546 std::ranges::find(g_NotSupportedArgs.begin(), g_NotSupportedArgs.end(), toFind) != g_NotSupportedArgs.end()) { #ifdef _WIN32 std::wcerr << std::format(L"option -{} not supported", argument); diff --git a/efxc2Compiler.cpp b/efxc2Compiler.cpp index fc3282a..4f939e8 100644 --- a/efxc2Compiler.cpp +++ b/efxc2Compiler.cpp @@ -15,7 +15,7 @@ void efxc2Compiler::Compiler::Preprocess() { if (SourceCode == nullptr) { efxc2Utils::print_no_input_file(); } - size_t SourceLen = SourceCode->size(); + size_t SourceLen = SourceCode->size(); //-V2571 //-V3546 auto includeDirs = params.get_includeDirs(); std::string _inputFile = params.get_inputFile(); const char* inputFile = _inputFile.c_str(); @@ -104,7 +104,7 @@ void efxc2Compiler::Compiler::Compile() { if (SourceCode == nullptr) { efxc2Utils::print_no_input_file(); } - size_t SourceLen = SourceCode->size(); + size_t SourceLen = SourceCode->size(); //-V2571 //-V3546 auto eflags = params.get_eflags(); auto sflags = params.get_sflags(); auto secondary_flags = params.get_secondary_flags(); @@ -397,7 +397,7 @@ void efxc2Compiler::Compiler::EmbedPrivateData() { auto const* compiledString = std::bit_cast(compilerOutput->GetBufferPointer()); size_t compiledLen = compilerOutput->GetBufferSize(); auto private_data = params.get_PrivateData(); - size_t private_data_size = private_data->size(); + size_t private_data_size = private_data->size(); //-V2571 //-V3546 if (params.get_verbose() && params.get_debug()) { std::cout << "Calling D3DSetBlobPart(\n"; std::cout << "\t compiledString,\n"; diff --git a/efxc2CompilerIncludes.cpp b/efxc2CompilerIncludes.cpp index 01000e1..f461916 100644 --- a/efxc2CompilerIncludes.cpp +++ b/efxc2CompilerIncludes.cpp @@ -140,7 +140,7 @@ namespace efxc2CompilerIncludes { efxc2Utils::M_STRING dir = { _dir.data(), _dir.size() }; (void) dirs.emplace(dirs.end(), dir); - (void) dirs[dirs.size() - 1].make_preferred(); + (void) dirs[dirs.size() - 1].make_preferred(); //-V2563 //-V3539 } } \ No newline at end of file diff --git a/efxc2Utils.cpp b/efxc2Utils.cpp index 5740b23..56e5079 100644 --- a/efxc2Utils.cpp +++ b/efxc2Utils.cpp @@ -267,7 +267,7 @@ std::string efxc2Utils::wstring_to_utf8(std::wstring const& wstr) //-V2506 _locale_t locale = _create_locale(LC_ALL, "en_US.UTF-8"); //-V3551 //-V2578 size_t nbytes = 0; errno_t err = 0; - err = _wcstombs_s_l(&nbytes, nullptr, 0, wstr.c_str(), wstr.length() + 1, locale); + err = _wcstombs_s_l(&nbytes, nullptr, 0, wstr.c_str(), wstr.length() + 1, locale); //-V2563 //-V3539 if (err != 0) { std::cerr << "_wcstombs_s_l failed." << std::endl; _free_locale(locale); @@ -281,7 +281,7 @@ std::string efxc2Utils::wstring_to_utf8(std::wstring const& wstr) //-V2506 auto str = std::make_unique>(); str->resize(nbytes + 1); str->data()[nbytes] = '\0'; //-V3539 //-V2563 - err = _wcstombs_s_l(&nbytes, str->data(), str->size(), wstr.c_str(),wstr.length() + 1, locale); + err = _wcstombs_s_l(&nbytes, str->data(), str->size(), wstr.c_str(),wstr.length() + 1, locale); //-V2563 //-V3539 if (err != 0) { std::cerr << "_wcstombs_s_l failed." << std::endl; exit(1); //-V2014 //-V3506 //-V2509 @@ -300,7 +300,7 @@ std::wstring efxc2Utils::utf8_to_wstring(std::string const& str) //-V2506 _locale_t locale = _create_locale(LC_ALL, "en_US.UTF-8"); //-V3551 //-V2578 size_t nchars = 0; errno_t err = 0; - err = _mbstowcs_s_l(&nchars, nullptr, 0, str.c_str(), str.length() + 1, locale); + err = _mbstowcs_s_l(&nchars, nullptr, 0, str.c_str(), str.length() + 1, locale); //-V2563 //-V3539 if (err != 0) { std::cerr << "_mbstowcs_s_l failed." << std::endl; _free_locale(locale); @@ -315,7 +315,7 @@ std::wstring efxc2Utils::utf8_to_wstring(std::string const& str) //-V2506 auto* wstr = std::bit_cast(_wstr->data()); wstr[nchars] = L'\0'; //-V3539 //-V2563 - err = _mbstowcs_s_l(&nchars, wstr, nchars, str.c_str(), str.length() + 1, locale); + err = _mbstowcs_s_l(&nchars, wstr, nchars, str.c_str(), str.length() + 1, locale); //-V2563 //-V3539 if (err != 0) { std::cerr << "_mbstowcs_s_l failed." << std::endl; exit(1); //-V2014 //-V3506 //-V2509