diff --git a/CMakeLists.txt b/CMakeLists.txt index 8801da4a..65688c96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -498,6 +498,7 @@ if(RUN_CLANG_TIDY) "cppcoreguidelines-pro-bounds-pointer-arithmetic" "cppcoreguidelines-pro-type-const-cast" "cppcoreguidelines-pro-type-cstyle-cast" + "cppcoreguidelines-pro-type-member-init" "cppcoreguidelines-pro-type-reinterpret-cast" "cppcoreguidelines-pro-type-static-cast-downcast" "cppcoreguidelines-pro-type-union-access" diff --git a/include/loot/struct/simple_message.h b/include/loot/struct/simple_message.h index dde52ab9..aac3e5ba 100644 --- a/include/loot/struct/simple_message.h +++ b/include/loot/struct/simple_message.h @@ -34,7 +34,7 @@ namespace loot { */ struct SimpleMessage { /** The type of the message. */ - MessageType type; + MessageType type{MessageType::say}; /** The language the message string is written in. */ std::string language; diff --git a/src/api/api_database.h b/src/api/api_database.h index d3548d6f..a69b8ac7 100644 --- a/src/api/api_database.h +++ b/src/api/api_database.h @@ -59,7 +59,7 @@ struct ApiDatabase final : public DatabaseInterface { std::vector GetGroups(bool includeUserMetadata = true) const override; std::vector GetUserGroups() const override; - void SetUserGroups(const std::vector& groups); + void SetUserGroups(const std::vector& groups) override; std::vector GetGroupsPath( const std::string& fromGroupName, const std::string& toGroupName) const override; diff --git a/src/api/helpers/crc.cpp b/src/api/helpers/crc.cpp index abee0014..653ec9d4 100644 --- a/src/api/helpers/crc.cpp +++ b/src/api/helpers/crc.cpp @@ -56,7 +56,7 @@ uint32_t GetCrc32(const std::filesystem::path& filename) { ifile.exceptions(std::ios_base::badbit | std::ios_base::failbit); static constexpr size_t BUFFER_SIZE = 8192; - std::array buffer; + std::array buffer{}; boost::crc_32_type result; size_t bytesLeft = GetStreamSize(ifile); while (bytesLeft > 0) { diff --git a/src/tests/api/interface/api_game_operations_test.h b/src/tests/api/interface/api_game_operations_test.h index cb57e7a8..8c283025 100644 --- a/src/tests/api/interface/api_game_operations_test.h +++ b/src/tests/api/interface/api_game_operations_test.h @@ -46,7 +46,7 @@ protected: errorMessage("Obsolete. Remove this and install Enhanced Weather."), generalMasterlistMessage("A general masterlist message.") {} - virtual void SetUp() override { + void SetUp() override { CommonGameTestFixture::SetUp(); ASSERT_FALSE(std::filesystem::exists(masterlistPath)); diff --git a/src/tests/api/internals/metadata_list_test.h b/src/tests/api/internals/metadata_list_test.h index 4484de3d..5f67951b 100644 --- a/src/tests/api/internals/metadata_list_test.h +++ b/src/tests/api/internals/metadata_list_test.h @@ -40,7 +40,7 @@ protected: {metadataFilesPath / "invalid" / "non_map_root.yaml", metadataFilesPath / "invalid" / "non_unique.yaml"}) {} - inline virtual void SetUp() override { + inline void SetUp() override { CommonGameTestFixture::SetUp(); using std::filesystem::copy; diff --git a/src/tests/common_game_test_fixture.h b/src/tests/common_game_test_fixture.h index 5f91ecf7..b474df4a 100644 --- a/src/tests/common_game_test_fixture.h +++ b/src/tests/common_game_test_fixture.h @@ -146,7 +146,7 @@ protected: ASSERT_TRUE(std::filesystem::exists(dataPath / filename)); } - void TearDown() { + void TearDown() override { // Grant write permissions to everything in rootTestPath // in case the test made anything read only. for (const auto& path :