diff --git a/toolsrc/.clang-format b/toolsrc/.clang-format index 6c32a733ae18c4..cdaabb8c11b400 100644 --- a/toolsrc/.clang-format +++ b/toolsrc/.clang-format @@ -40,11 +40,13 @@ IncludeCategories: Priority: -1 - Regex: '^$' Priority: 1 - - Regex: '^$' + - Regex: '^$' Priority: 2 - - Regex: '^$' + - Regex: '^$' Priority: 3 - - Regex: '^<[a-z0-9_]*\.h>$' + - Regex: '^$' Priority: 4 - - Regex: '^<[a-z0-9_]*>$' # C++ standard library + - Regex: '^<[a-z0-9_]*\.h>$' Priority: 5 + - Regex: '^<[a-z0-9_]*>$' # C++ standard library + Priority: 6 diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 62cb3740db265f..8b525c248a3fbe 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -157,10 +157,10 @@ if(CLANG_FORMAT) add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp ${VCPKGLIB_BASE_SOURCES} - ${VCPKGLIB_NON_PCH_SOURCES} + ${VCPKGLIB_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h ${VCPKGLIB_BASE_INCLUDES} - ${VCPKGLIB_NON_PCH_INCLUDES} + ${VCPKGLIB_INCLUDES} ${VCPKG_SOURCES} ${VCPKGMETRICSUPLOADER_SOURCES} diff --git a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h index 482f9ea400dcb9..15b24b8d05027c 100644 --- a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h +++ b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h @@ -19,7 +19,7 @@ namespace vcpkg::Test { for (auto&& spec : specs) tag_vars[spec.package_spec] = {}; - Util::unused(port_provider); + (void)(port_provider); } Optional&> get_generic_triplet_vars( diff --git a/toolsrc/include/vcpkg/archives.h b/toolsrc/include/vcpkg/archives.h index 073217064b1fb1..be2523dfb980cd 100644 --- a/toolsrc/include/vcpkg/archives.h +++ b/toolsrc/include/vcpkg/archives.h @@ -1,8 +1,8 @@ #pragma once -#include +#include -#include +#include namespace vcpkg::Archives { diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index a6d8781b057239..11807b249dfb5d 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -239,15 +239,4 @@ namespace vcpkg::Util return e == E::YES; } } - - template - void unused(const Ts&...) - { - } - - template - T copy(const T& t) - { - return t; - } } diff --git a/toolsrc/include/vcpkg/buildenvironment.h b/toolsrc/include/vcpkg/buildenvironment.h index 1216caa2a018d0..aa69708b670746 100644 --- a/toolsrc/include/vcpkg/buildenvironment.h +++ b/toolsrc/include/vcpkg/buildenvironment.h @@ -1,6 +1,8 @@ -#include +#pragma once + +#include -#include +#include #include #include diff --git a/toolsrc/include/vcpkg/cmakevars.h b/toolsrc/include/vcpkg/cmakevars.h index 1c02376b9ff2ed..66dd287b858206 100644 --- a/toolsrc/include/vcpkg/cmakevars.h +++ b/toolsrc/include/vcpkg/cmakevars.h @@ -1,9 +1,10 @@ #pragma once +#include + #include #include -#include namespace vcpkg::Dependencies { diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 948d4b5e84f78b..77e4782196e5b7 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -2,12 +2,6 @@ #include #include -#include -#include - -#include -#include -#include namespace vcpkg::Commands { diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h index 10d213522007bc..c8bc14ca967993 100644 --- a/toolsrc/include/vcpkg/commands.interface.h +++ b/toolsrc/include/vcpkg/commands.interface.h @@ -1,7 +1,11 @@ #pragma once -#include -#include +#include +#include + +#include + +#include namespace vcpkg::Commands { diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h index 13676b2bd96a36..39037649da3b0e 100644 --- a/toolsrc/include/vcpkg/commands.owns.h +++ b/toolsrc/include/vcpkg/commands.owns.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Owns { diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h index 6220a886630e5c..530a3ac2816e0c 100644 --- a/toolsrc/include/vcpkg/commands.search.h +++ b/toolsrc/include/vcpkg/commands.search.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Search { diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 76ff89e7a4f077..3cca364e7c4552 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -4,11 +4,7 @@ #include #include -#include #include -#include -#include -#include #include #include @@ -19,6 +15,21 @@ namespace vcpkg::Graphs struct Randomizer; } +namespace vcpkg::CMakeVars +{ + struct CMakeVarProvider; +} + +namespace vcpkg::PortFileProvider +{ + struct PortFileProvider; +} + +namespace vcpkg +{ + struct StatusParagraphs; +} + namespace vcpkg::Dependencies { enum class RequestType diff --git a/toolsrc/include/vcpkg/export.ifw.h b/toolsrc/include/vcpkg/export.ifw.h index b1573924ed987f..0fe07227c26002 100644 --- a/toolsrc/include/vcpkg/export.ifw.h +++ b/toolsrc/include/vcpkg/export.ifw.h @@ -1,7 +1,8 @@ #pragma once +#include + #include -#include #include #include diff --git a/toolsrc/include/vcpkg/fwd/registries.h b/toolsrc/include/vcpkg/fwd/registries.h new file mode 100644 index 00000000000000..1091a81ad2faa7 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/registries.h @@ -0,0 +1,6 @@ +#pragma once + +namespace vcpkg +{ + struct Registry; +} diff --git a/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h new file mode 100644 index 00000000000000..87d6f9eaa8e196 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h @@ -0,0 +1,13 @@ +#pragma once + +namespace vcpkg +{ + struct ParsedArguments; + struct CommandSwitch; + struct CommandSetting; + struct CommandMultiSetting; + struct CommandOptionsStructure; + struct CommandStructure; + struct HelpTableFormatter; + struct VcpkgCmdArguments; +} diff --git a/toolsrc/include/vcpkg/fwd/vcpkgpaths.h b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h new file mode 100644 index 00000000000000..79655bf4a78ac1 --- /dev/null +++ b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h @@ -0,0 +1,8 @@ +#pragma once + +namespace vcpkg +{ + struct ToolsetArchOption; + struct Toolset; + struct VcpkgPaths; +} diff --git a/toolsrc/include/vcpkg/registries.h b/toolsrc/include/vcpkg/registries.h new file mode 100644 index 00000000000000..17ea5611920d4c --- /dev/null +++ b/toolsrc/include/vcpkg/registries.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +namespace vcpkg +{ + struct RegistryImpl + { + virtual void update(std::error_code&) = 0; + virtual Optional find_port(StringView name) const = 0; + + virtual ~RegistryImpl() = default; + }; + + struct Registry + { + std::string name; + std::vector packages; + + std::unique_ptr underlying; + }; + +} diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index cf4c3c0466758a..1cfa7a17c5b0fd 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -62,5 +64,5 @@ namespace vcpkg std::vector features; }; - Json::Value serialize_ipv(const InstalledPackageView& ipv, const struct VcpkgPaths& paths); + Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h index d5c0a5c23db572..f9618a52dcbdcd 100644 --- a/toolsrc/include/vcpkg/tools.h +++ b/toolsrc/include/vcpkg/tools.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -7,8 +9,6 @@ namespace vcpkg { - struct VcpkgPaths; - namespace Tools { static const std::string SEVEN_ZIP = "7zip"; diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index 84cd7c59925f07..3e956c83e5048a 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + #include #include #include @@ -19,8 +22,6 @@ namespace vcpkg std::unordered_map> multisettings; }; - struct VcpkgPaths; - struct CommandSwitch { constexpr CommandSwitch(const StringLiteral& name, const StringLiteral& short_help_text) diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 721b59606943f2..2262543d9f4ef5 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index 2841aefa035571..a2b9317a246ff4 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -195,7 +195,7 @@ namespace vcpkg::Test ec.assign(errno, std::system_category()); } #else - Util::unused(target, file, ec); + (void)(target, file, ec); vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message); #endif } @@ -217,7 +217,7 @@ namespace vcpkg::Test #elif FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_UNIX ::vcpkg::Test::create_symlink(target, file, ec); #else - Util::unused(target, file, ec); + (void)(target, file, ec); vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message); #endif } diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index c90706928eeea6..33edc8e83fffbb 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace vcpkg::Archives { diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index e4c821eaeaa294..0eb53db6087e17 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -574,7 +574,7 @@ namespace vcpkg::Files std::error_code& ec) override { this->rename(oldpath, newpath, ec); - Util::unused(temp_suffix); + (void)(temp_suffix); #if !defined(_WIN32) if (ec) { diff --git a/toolsrc/src/vcpkg/base/system.print.cpp b/toolsrc/src/vcpkg/base/system.print.cpp index 885269eef7038b..7366a810f403e7 100644 --- a/toolsrc/src/vcpkg/base/system.print.cpp +++ b/toolsrc/src/vcpkg/base/system.print.cpp @@ -22,7 +22,7 @@ namespace vcpkg::System #else // TODO: add color handling code // it should probably use VT-220 codes - Util::unused(c); + (void)(c); System::print2(message); #endif } diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 92dedd8dba16e0..ff5afc33d3eddf 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -470,7 +470,7 @@ namespace vcpkg::Build #if !defined(_WIN32) // TODO: remove when vcpkg.exe is in charge for acquiring tools. Change introduced in vcpkg v0.0.107. // bootstrap should have already downloaded ninja, but making sure it is present in case it was deleted. - vcpkg::Util::unused(paths.get_tool_exe(Tools::NINJA)); + (void)(paths.get_tool_exe(Tools::NINJA)); #endif std::vector cmake_args{ {"CURRENT_PORT_DIR", paths.scripts / "detect_compiler"}, @@ -536,7 +536,7 @@ namespace vcpkg::Build #if !defined(_WIN32) // TODO: remove when vcpkg.exe is in charge for acquiring tools. Change introduced in vcpkg v0.0.107. // bootstrap should have already downloaded ninja, but making sure it is present in case it was deleted. - vcpkg::Util::unused(paths.get_tool_exe(Tools::NINJA)); + (void)(paths.get_tool_exe(Tools::NINJA)); #endif auto& scfl = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO); auto& scf = *scfl.source_control_file; diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp index 09d84d0e88075b..2b63a16b508572 100644 --- a/toolsrc/src/vcpkg/buildenvironment.cpp +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index ae01302cb93e1d..84a1f5ed5301c8 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include namespace vcpkg::Commands::Autocomplete diff --git a/toolsrc/src/vcpkg/commands.buildexternal.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp index 02861918253fd1..bfd275542757ed 100644 --- a/toolsrc/src/vcpkg/commands.buildexternal.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace vcpkg::Commands::BuildExternal { diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp index 555b70859e19a3..3014f87a1eaa35 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Commands::Cache { @@ -36,7 +37,7 @@ namespace vcpkg::Commands::Cache void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); if (binary_paragraphs.empty()) diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 4dffcfd3c8f9dd..e9577e4adfc06d 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include using namespace vcpkg; diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 21ae756ed43294..9d3b396400e026 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -4,6 +4,7 @@ #include #include +#include using namespace vcpkg; diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp index 2c8c7b1b2857b1..e40aa34b29236c 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,10 +1,12 @@ #include #include #include +#include #include #include #include +#include namespace vcpkg::Commands::Contact { diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index a7cfbc9318e626..3dba465afff6d6 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,9 +1,12 @@ #include #include +#include #include #include #include +#include +#include namespace vcpkg::Commands::Create { @@ -17,7 +20,7 @@ namespace vcpkg::Commands::Create int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const std::string port_name = args.command_arguments.at(0); const std::string url = args.command_arguments.at(1); diff --git a/toolsrc/src/vcpkg/commands.dependinfo.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp index 0f1e431e58fa85..8c14c4b3d197c2 100644 --- a/toolsrc/src/vcpkg/commands.dependinfo.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index b66e8c6808c759..e3f50b98ca63cc 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include diff --git a/toolsrc/src/vcpkg/commands.env.cpp b/toolsrc/src/vcpkg/commands.env.cpp index a825230601d6cc..ed9263b7631be9 100644 --- a/toolsrc/src/vcpkg/commands.env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Commands::Env { diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp index e6e59a30c15c10..4942013c39508a 100644 --- a/toolsrc/src/vcpkg/commands.fetch.cpp +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -1,6 +1,8 @@ #include #include +#include +#include namespace vcpkg::Commands::Fetch { @@ -14,7 +16,7 @@ namespace vcpkg::Commands::Fetch void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const std::string tool = args.command_arguments[0]; const fs::path tool_path = paths.get_tool_exe(tool); diff --git a/toolsrc/src/vcpkg/commands.format-manifest.cpp b/toolsrc/src/vcpkg/commands.format-manifest.cpp index 656e1799647a0f..72f851700b02d4 100644 --- a/toolsrc/src/vcpkg/commands.format-manifest.cpp +++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace { diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp index 5ac5e8aa6d4f1a..3b93b09bdbd0d5 100644 --- a/toolsrc/src/vcpkg/commands.hash.cpp +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -1,7 +1,10 @@ #include #include +#include #include +#include +#include namespace vcpkg::Commands::Hash { @@ -15,7 +18,7 @@ namespace vcpkg::Commands::Hash void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const fs::path file_to_hash = args.command_arguments[0]; diff --git a/toolsrc/src/vcpkg/commands.info.cpp b/toolsrc/src/vcpkg/commands.info.cpp index afb2642c6e9396..71db6a8f4dad47 100644 --- a/toolsrc/src/vcpkg/commands.info.cpp +++ b/toolsrc/src/vcpkg/commands.info.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index 1aa7d58649bf57..0b635d9c3573b6 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include namespace vcpkg::Commands::Integrate { @@ -530,7 +532,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); if (args.command_arguments[0] == Subcommand::INSTALL) { diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp index fcd2919ff172c5..2156857d169117 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include diff --git a/toolsrc/src/vcpkg/commands.owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp index 29cfe3a2300e87..bb5e19715250b3 100644 --- a/toolsrc/src/vcpkg/commands.owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -2,6 +2,7 @@ #include #include +#include #include namespace vcpkg::Commands::Owns @@ -32,7 +33,7 @@ namespace vcpkg::Commands::Owns void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const StatusParagraphs status_db = database_load_check(paths); search_file(paths, args.command_arguments[0], status_db); diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp index 6f45e26ed0f115..e5e99cb416f8ac 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include namespace vcpkg::Commands::PortHistory { @@ -82,7 +84,7 @@ namespace vcpkg::Commands::PortHistory void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); std::string port_name = args.command_arguments.at(0); std::vector versions = read_versions_from_log(paths, port_name); diff --git a/toolsrc/src/vcpkg/commands.portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp index ad27599fbbeaeb..a613b4be6582b9 100644 --- a/toolsrc/src/vcpkg/commands.portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include namespace vcpkg::Commands::PortsDiff @@ -132,7 +133,7 @@ namespace vcpkg::Commands::PortsDiff void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); const fs::path& git_exe = paths.get_tool_exe(Tools::GIT); diff --git a/toolsrc/src/vcpkg/commands.search.cpp b/toolsrc/src/vcpkg/commands.search.cpp index 836acfffeea1f5..4a1defadd40ab1 100644 --- a/toolsrc/src/vcpkg/commands.search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/toolsrc/src/vcpkg/commands.setinstalled.cpp b/toolsrc/src/vcpkg/commands.setinstalled.cpp index 6ef5099dc6f5ef..5d1599f1f680d5 100644 --- a/toolsrc/src/vcpkg/commands.setinstalled.cpp +++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include namespace vcpkg::Commands::SetInstalled diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 391192038a9f27..dd42d76c498c7e 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace vcpkg::Commands::Upgrade diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp index d366a42b83a85e..50ffc7c780c3e1 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) @@ -82,7 +84,7 @@ namespace vcpkg::Commands::Version void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem&) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); System::print2("Vcpkg package management program version ", version(), diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp index 4ad9744c90e557..91bd1b94337a1e 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -2,6 +2,7 @@ #include #include +#include #include namespace vcpkg::Commands::X_VSInstances @@ -27,7 +28,7 @@ namespace vcpkg::Commands::X_VSInstances Checks::exit_success(VCPKG_LINE_INFO); #else - Util::unused(args, paths); + (void)(args, paths); Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); #endif } diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index f7671ceef20789..a8f3b57491645f 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -963,7 +963,7 @@ namespace vcpkg::Dependencies else if (p_cluster->request_type == RequestType::USER_REQUESTED && p_cluster->m_installed.has_value()) { auto&& installed = p_cluster->m_installed.value_or_exit(VCPKG_LINE_INFO); - plan.already_installed.emplace_back(Util::copy(installed.ipv), p_cluster->request_type); + plan.already_installed.emplace_back(InstalledPackageView(installed.ipv), p_cluster->request_type); } } diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index 1719e5f6cce2ae..bb6947390c66e9 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -109,7 +109,7 @@ namespace vcpkg::Help void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); if (args.command_arguments.empty()) { diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 79a33a0d7421c9..ad72934fc67742 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -381,7 +381,7 @@ namespace vcpkg::Metrics } #if !defined(_WIN32) - Util::unused(payload); + (void)(payload); #else HINTERNET connect = nullptr, request = nullptr; BOOL results = FALSE; diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index a384cea0a9450c..0e4eb7bc0575e4 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -556,7 +556,7 @@ namespace vcpkg::PostBuildLint return LintStatus::ERROR_DETECTED; } #endif - Util::unused(expected_architecture, files); + (void)expected_architecture, (void)files; return LintStatus::SUCCESS; } diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 1d5a682c6c8f6a..ac2fa953a161d2 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -138,7 +138,7 @@ namespace vcpkg virtual void add_special_paths(std::vector& out_candidate_paths) const { - Util::unused(out_candidate_paths); + (void)(out_candidate_paths); } virtual Optional get_version(const VcpkgPaths& paths, const fs::path& path_to_exe) const = 0; }; @@ -283,7 +283,7 @@ namespace vcpkg out_candidate_paths.push_back(*pf / "CMake" / "bin" / "cmake.exe"); #else // TODO: figure out if this should do anything on non-Windows - Util::unused(out_candidate_paths); + (void)(out_candidate_paths); #endif } virtual Optional get_version(const VcpkgPaths&, const fs::path& path_to_exe) const override @@ -342,7 +342,7 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake). #ifndef _WIN32 cmd.path_arg(paths.get_tool_exe(Tools::MONO)); #else - Util::unused(paths); + (void)(paths); #endif cmd.path_arg(path_to_exe); const auto rc = System::cmd_execute_and_capture_output(cmd.extract()); @@ -380,7 +380,7 @@ Type 'NuGet help ' for help on a specific command. out_candidate_paths.push_back(*pf / "git" / "cmd" / "git.exe"); #else // TODO: figure out if this should do anything on non-windows - Util::unused(out_candidate_paths); + (void)(out_candidate_paths); #endif } @@ -441,7 +441,7 @@ Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 virtual void add_special_paths(std::vector& out_candidate_paths) const override { - Util::unused(out_candidate_paths); + (void)(out_candidate_paths); // TODO: Uncomment later // const std::vector from_path = Files::find_from_PATH("installerbase"); // candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); diff --git a/toolsrc/src/vcpkg/update.cpp b/toolsrc/src/vcpkg/update.cpp index 48471e26c399c4..655c373682946d 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -53,7 +53,7 @@ namespace vcpkg::Update void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + (void)(args.parse_arguments(COMMAND_STRUCTURE)); System::print2("Using local portfile versions. To update the local portfiles, use `git pull`.\n"); const StatusParagraphs status_db = database_load_check(paths);