mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add cppcoreguidelines-pro-type-member-init clang-tidy check
Fix the warnings it emits.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -59,7 +59,7 @@ struct ApiDatabase final : public DatabaseInterface {
|
||||
|
||||
std::vector<Group> GetGroups(bool includeUserMetadata = true) const override;
|
||||
std::vector<Group> GetUserGroups() const override;
|
||||
void SetUserGroups(const std::vector<Group>& groups);
|
||||
void SetUserGroups(const std::vector<Group>& groups) override;
|
||||
std::vector<Vertex> GetGroupsPath(
|
||||
const std::string& fromGroupName,
|
||||
const std::string& toGroupName) const override;
|
||||
|
||||
@@ -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<char, BUFFER_SIZE> buffer;
|
||||
std::array<char, BUFFER_SIZE> buffer{};
|
||||
boost::crc_32_type result;
|
||||
size_t bytesLeft = GetStreamSize(ifile);
|
||||
while (bytesLeft > 0) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 :
|
||||
|
||||
Reference in New Issue
Block a user