Fix issues reported by CppCheck

Many shadowFunction, some useStlAlgorithm, and others.

cppcheck --enable=all --inline-suppr \
  --suppress=noExplicitConstructor --suppress=unusedFunction \
  --suppress=missingIncludeSystem --project=compile_commands.json
This commit is contained in:
Urs Fleisch
2023-12-03 11:59:24 +01:00
parent 131918333b
commit 8b3f1a459e
38 changed files with 349 additions and 354 deletions

View File

@ -74,9 +74,8 @@ namespace
}
private:
CustomFrame(const ByteVector &data, Header *h) : Frame(h) {
parseFields(fieldData(data));
}
CustomFrame(const ByteVector &data, Header *h)
: Frame(h), m_value(fieldData(data).toUInt()) {}
unsigned int m_value;
};

View File

@ -79,7 +79,7 @@ public:
testRead(copy.fileName().c_str(), titleAfter, commentAfter);
CPPUNIT_ASSERT(fileEqual(
copy.fileName(),
TEST_FILE_PATH_C("changed.mod")));
testFilePath("changed.mod")));
}
void testPropertyInterface()

View File

@ -714,7 +714,7 @@ public:
CPPUNIT_ASSERT(f.tag()->isEmpty());
CPPUNIT_ASSERT(fileEqual(
copy.fileName(),
TEST_FILE_PATH_C("no-tags.m4a")));
testFilePath("no-tags.m4a")));
}
}

View File

@ -83,7 +83,7 @@ public:
testRead(copy.fileName().c_str(), titleAfter, commentAfter);
CPPUNIT_ASSERT(fileEqual(
copy.fileName(),
TEST_FILE_PATH_C("changed.s3m")));
testFilePath("changed.s3m")));
}
private:

View File

@ -108,6 +108,7 @@ public:
taglib_property_set_append(file, "COMPOSER", "Composer 2");
taglib_property_set(file, "ALBUMARTIST", "Album Artist");
// cppcheck-suppress cstyleCast
TAGLIB_COMPLEX_PROPERTY_PICTURE(props, "JPEG Data", 9, "Written by TagLib",
"image/jpeg", "Front Cover");
taglib_complex_property_set(file, "PICTURE", props);

View File

@ -216,7 +216,7 @@ private:
commentAfter, trackerNameAfter);
CPPUNIT_ASSERT(fileEqual(
copy.fileName(),
TEST_FILE_PATH_C("changed.xm")));
testFilePath("changed.xm")));
}
};