diff --git a/src/api/api_database.h b/src/api/api_database.h index 50f83aa7..cabe0a83 100644 --- a/src/api/api_database.h +++ b/src/api/api_database.h @@ -38,7 +38,7 @@ #include "loot/vertex.h" namespace loot { -struct ApiDatabase : public DatabaseInterface { +struct ApiDatabase final : public DatabaseInterface { explicit ApiDatabase(std::shared_ptr conditionEvaluator); void LoadLists(const std::filesystem::path& masterlist_path, diff --git a/src/api/error_categories.cpp b/src/api/error_categories.cpp index 252a72f4..c29544e8 100644 --- a/src/api/error_categories.cpp +++ b/src/api/error_categories.cpp @@ -29,11 +29,11 @@ namespace loot { namespace detail { class libloadorder_category : public std::error_category { - virtual const char* name() const noexcept { return "libloadorder"; } + const char* name() const noexcept override { return "libloadorder"; } - virtual std::string message(int) const { return "Libloadorder error"; } + std::string message(int) const override { return "Libloadorder error"; } - virtual bool equivalent(const std::error_code& code) const noexcept { + bool equivalent(const std::error_code& code, int) const noexcept override { return code.category().name() == name(); } }; diff --git a/src/api/game/game.cpp b/src/api/game/game.cpp index 8b566bf8..982b3c0f 100644 --- a/src/api/game/game.cpp +++ b/src/api/game/game.cpp @@ -101,7 +101,6 @@ bool Game::IsValidPlugin(const std::string& plugin) const { void Game::LoadPlugins(const std::vector& plugins, bool loadHeadersOnly) { auto logger = getLogger(); - uintmax_t meanFileSize = 0; std::multimap sizeMap; // First get the plugin sizes. @@ -110,7 +109,6 @@ void Game::LoadPlugins(const std::vector& plugins, throw std::invalid_argument("\"" + plugin + "\" is not a valid plugin"); uintmax_t fileSize = Plugin::GetFileSize(DataPath() / u8path(plugin)); - meanFileSize += fileSize; // Trim .ghost extension if present. if (boost::iends_with(plugin, ".ghost")) @@ -118,7 +116,6 @@ void Game::LoadPlugins(const std::vector& plugins, else sizeMap.emplace(fileSize, plugin); } - meanFileSize /= sizeMap.size(); // Rounding error, but not important. // Get the number of threads to use. // hardware_concurrency() may be zero, if so then use only one thread. diff --git a/src/api/game/game.h b/src/api/game/game.h index 5726aa97..2164576e 100644 --- a/src/api/game/game.h +++ b/src/api/game/game.h @@ -34,7 +34,7 @@ #include "loot/game_interface.h" namespace loot { -class Game : public GameInterface { +class Game final : public GameInterface { public: explicit Game(const GameType gameType, const std::filesystem::path& gamePath, diff --git a/src/api/plugin.h b/src/api/plugin.h index 7d58cf79..9c3d8fc0 100644 --- a/src/api/plugin.h +++ b/src/api/plugin.h @@ -40,7 +40,7 @@ namespace loot { class GameCache; -class Plugin : public PluginInterface { +class Plugin final : public PluginInterface { public: explicit Plugin(const GameType gameType, std::shared_ptr gameCache, diff --git a/src/api/sorting/plugin_graph.cpp b/src/api/sorting/plugin_graph.cpp index 88ca6535..139a17ad 100644 --- a/src/api/sorting/plugin_graph.cpp +++ b/src/api/sorting/plugin_graph.cpp @@ -283,6 +283,7 @@ std::optional PluginGraph::GetVertexByName( void PluginGraph::CheckForCycles() const { auto logger = getLogger(); + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDelete) if (logger) { logger->trace("Checking plugin graph for cycles..."); } @@ -290,6 +291,7 @@ void PluginGraph::CheckForCycles() const { std::map indexMap; auto vertexIndexMap = vertex_map_t(indexMap); size_t i = 0; + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDelete) BGL_FORALL_VERTICES(v, graph_, RawPluginGraph) { put(vertexIndexMap, v, i++); } diff --git a/src/tests/api/internals/plugin_test.h b/src/tests/api/internals/plugin_test.h index 75b3731d..c4e3b8dc 100644 --- a/src/tests/api/internals/plugin_test.h +++ b/src/tests/api/internals/plugin_test.h @@ -38,9 +38,9 @@ protected: lowercaseBlankEsp("blank.esp"), nonAsciiEsp(u8"non\u00C1scii.esp"), otherNonAsciiEsp(u8"other non\u00C1scii.esp"), - blankArchive("Blank" + GetArchiveFileExtension(game_.Type())), + blankArchive("Blank" + GetArchiveFileExtension(GetParam())), blankSuffixArchive("Blank - Different - suffix" + - GetArchiveFileExtension(game_.Type())), + GetArchiveFileExtension(GetParam())), game_(GetParam(), dataPath.parent_path(), localPath) {} void SetUp() { @@ -136,7 +136,7 @@ private: } }; -class OtherPluginType : public PluginInterface { +class OtherPluginType final : public PluginInterface { public: std::string GetName() const { return ""; } std::optional GetHeaderVersion() const { return 0.0f; }