From cd6eb65d453ea3e889ae0fd4027a707fa63a1f58 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Tue, 2 Jan 2024 12:52:26 +0100 Subject: [PATCH] Make classes with destructor as only virtual member non-virtual These classes are probably not meant to be used polymorphically. --- taglib/ape/apefooter.h | 2 +- taglib/ape/apeitem.h | 2 +- taglib/asf/asfattribute.h | 2 +- taglib/asf/asfpicture.h | 2 +- taglib/mp4/mp4coverart.h | 2 +- taglib/mp4/mp4item.h | 2 +- taglib/mpeg/id3v2/id3v2extendedheader.h | 2 +- taglib/mpeg/id3v2/id3v2footer.h | 2 +- taglib/mpeg/id3v2/id3v2header.h | 2 +- taglib/mpeg/mpegheader.h | 2 +- taglib/mpeg/xingheader.h | 2 +- taglib/ogg/oggpage.h | 2 +- taglib/ogg/oggpageheader.h | 2 +- tests/test_sizes.cpp | 26 ++++++++++++------------- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/taglib/ape/apefooter.h b/taglib/ape/apefooter.h index 89b10d2c6..12480d366 100644 --- a/taglib/ape/apefooter.h +++ b/taglib/ape/apefooter.h @@ -59,7 +59,7 @@ namespace TagLib { /*! * Destroys the footer. */ - virtual ~Footer(); + ~Footer(); Footer(const Footer &) = delete; Footer &operator=(const Footer &) = delete; diff --git a/taglib/ape/apeitem.h b/taglib/ape/apeitem.h index c672f653e..72ae8115c 100644 --- a/taglib/ape/apeitem.h +++ b/taglib/ape/apeitem.h @@ -75,7 +75,7 @@ namespace TagLib { /*! * Destroys the item. */ - virtual ~Item(); + ~Item(); /*! * Copies the contents of \a item into this item. diff --git a/taglib/asf/asfattribute.h b/taglib/asf/asfattribute.h index 5046065ae..b4b26a0b2 100644 --- a/taglib/asf/asfattribute.h +++ b/taglib/asf/asfattribute.h @@ -121,7 +121,7 @@ namespace TagLib /*! * Destroys the attribute. */ - virtual ~Attribute(); + ~Attribute(); /*! * Returns type of the value. diff --git a/taglib/asf/asfpicture.h b/taglib/asf/asfpicture.h index 1102458a2..99780b28e 100644 --- a/taglib/asf/asfpicture.h +++ b/taglib/asf/asfpicture.h @@ -68,7 +68,7 @@ namespace TagLib /*! * Destroys the picture. */ - virtual ~Picture(); + ~Picture(); /*! * Copies the contents of \a other into this picture. diff --git a/taglib/mp4/mp4coverart.h b/taglib/mp4/mp4coverart.h index 253b1bdb1..e8fd896e5 100644 --- a/taglib/mp4/mp4coverart.h +++ b/taglib/mp4/mp4coverart.h @@ -48,7 +48,7 @@ namespace TagLib { }; CoverArt(Format format, const ByteVector &data); - virtual ~CoverArt(); + ~CoverArt(); CoverArt(const CoverArt &item); diff --git a/taglib/mp4/mp4item.h b/taglib/mp4/mp4item.h index 962691c9e..6ac380d19 100644 --- a/taglib/mp4/mp4item.h +++ b/taglib/mp4/mp4item.h @@ -52,7 +52,7 @@ namespace TagLib { */ void swap(Item &item) noexcept; - virtual ~Item(); + ~Item(); Item(int value); Item(unsigned char value); diff --git a/taglib/mpeg/id3v2/id3v2extendedheader.h b/taglib/mpeg/id3v2/id3v2extendedheader.h index 2113b8a34..83dec0895 100644 --- a/taglib/mpeg/id3v2/id3v2extendedheader.h +++ b/taglib/mpeg/id3v2/id3v2extendedheader.h @@ -56,7 +56,7 @@ namespace TagLib { /*! * Destroys the extended header. */ - virtual ~ExtendedHeader(); + ~ExtendedHeader(); ExtendedHeader(const ExtendedHeader &) = delete; ExtendedHeader &operator=(const ExtendedHeader &) = delete; diff --git a/taglib/mpeg/id3v2/id3v2footer.h b/taglib/mpeg/id3v2/id3v2footer.h index 8f1e5fa35..3902be67c 100644 --- a/taglib/mpeg/id3v2/id3v2footer.h +++ b/taglib/mpeg/id3v2/id3v2footer.h @@ -57,7 +57,7 @@ namespace TagLib { /*! * Destroys the footer. */ - virtual ~Footer(); + ~Footer(); Footer(const Footer &) = delete; Footer &operator=(const Footer &) = delete; diff --git a/taglib/mpeg/id3v2/id3v2header.h b/taglib/mpeg/id3v2/id3v2header.h index 1c6313c94..63726a659 100644 --- a/taglib/mpeg/id3v2/id3v2header.h +++ b/taglib/mpeg/id3v2/id3v2header.h @@ -62,7 +62,7 @@ namespace TagLib { /*! * Destroys the header. */ - virtual ~Header(); + ~Header(); Header(const Header &) = delete; Header &operator=(const Header &) = delete; diff --git a/taglib/mpeg/mpegheader.h b/taglib/mpeg/mpegheader.h index 41260e9cf..05a1815f8 100644 --- a/taglib/mpeg/mpegheader.h +++ b/taglib/mpeg/mpegheader.h @@ -67,7 +67,7 @@ namespace TagLib { /*! * Destroys this Header instance. */ - virtual ~Header(); + ~Header(); /*! * Returns true if the frame is at least an appropriate size and has diff --git a/taglib/mpeg/xingheader.h b/taglib/mpeg/xingheader.h index 25e664c5d..84d992620 100644 --- a/taglib/mpeg/xingheader.h +++ b/taglib/mpeg/xingheader.h @@ -82,7 +82,7 @@ namespace TagLib { /*! * Destroy this XingHeader instance. */ - virtual ~XingHeader(); + ~XingHeader(); XingHeader(const XingHeader &) = delete; XingHeader &operator=(const XingHeader &) = delete; diff --git a/taglib/ogg/oggpage.h b/taglib/ogg/oggpage.h index 4fc9f5a46..89e9b6f38 100644 --- a/taglib/ogg/oggpage.h +++ b/taglib/ogg/oggpage.h @@ -57,7 +57,7 @@ namespace TagLib { */ Page(File *file, offset_t pageOffset); - virtual ~Page(); + ~Page(); Page(const Page &) = delete; Page &operator=(const Page &) = delete; diff --git a/taglib/ogg/oggpageheader.h b/taglib/ogg/oggpageheader.h index b177c55d9..e74ee8a76 100644 --- a/taglib/ogg/oggpageheader.h +++ b/taglib/ogg/oggpageheader.h @@ -57,7 +57,7 @@ namespace TagLib { /*! * Deletes this instance of the PageHeader. */ - virtual ~PageHeader(); + ~PageHeader(); PageHeader(const PageHeader &) = delete; PageHeader &operator=(const PageHeader &) = delete; diff --git a/tests/test_sizes.cpp b/tests/test_sizes.cpp index ef9610a46..64758622e 100644 --- a/tests/test_sizes.cpp +++ b/tests/test_sizes.cpp @@ -149,13 +149,13 @@ class TestSizes : public CppUnit::TestFixture // $ grep kind=\"class\" index.xml | sed -E -e 's/(.*|<\/name>.*)//g' CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::File)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::APE::Footer)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::APE::Item)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Footer)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Item)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Tag)); - CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Attribute)); + CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Attribute)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::File)); - CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Picture)); + CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Picture)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Tag)); CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::AudioProperties)); @@ -185,12 +185,12 @@ class TestSizes : public CppUnit::TestFixture CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::ChapterFrame)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::CommentsFrame)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::EventTimingCodesFrame)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::ExtendedHeader)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::Footer)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::ID3v2::ExtendedHeader)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::ID3v2::Footer)); CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::Frame)); CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::FrameFactory)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::GeneralEncapsulatedObjectFrame)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::Header)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::ID3v2::Header)); CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::ID3v2::Latin1StringHandler)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::OwnershipFrame)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ID3v2::PodcastFrame)); @@ -211,18 +211,18 @@ class TestSizes : public CppUnit::TestFixture CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::IT::File)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::IT::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::List)); - CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::CoverArt)); + CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::CoverArt)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::File)); - CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Item)); + CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::Item)); CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::MP4::ItemFactory)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Tag)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::File)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPEG::File)); - CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPEG::Header)); + CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MPEG::Header)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPEG::Properties)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::MPEG::XingHeader)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::MPEG::XingHeader)); CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::Map)); CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Mod::File)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::FileBase)); @@ -232,8 +232,8 @@ class TestSizes : public CppUnit::TestFixture CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::File)); CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::Opus::File)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::Opus::Properties)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::Ogg::Page)); - CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::Ogg::PageHeader)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::Ogg::Page)); + CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::Ogg::PageHeader)); CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::Speex::File)); CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::Speex::Properties)); CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::Vorbis::File));