Skip to content

Commit

Permalink
Make classes with destructor as only virtual member non-virtual
Browse files Browse the repository at this point in the history
These classes are probably not meant to be used polymorphically.
  • Loading branch information
ufleisch committed Jan 2, 2024
1 parent a22cfb8 commit cd6eb65
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion taglib/ape/apefooter.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace TagLib {
/*!
* Destroys the footer.
*/
virtual ~Footer();
~Footer();

Footer(const Footer &) = delete;
Footer &operator=(const Footer &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/ape/apeitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace TagLib {
/*!
* Destroys the item.
*/
virtual ~Item();
~Item();

/*!
* Copies the contents of \a item into this item.
Expand Down
2 changes: 1 addition & 1 deletion taglib/asf/asfattribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace TagLib
/*!
* Destroys the attribute.
*/
virtual ~Attribute();
~Attribute();

/*!
* Returns type of the value.
Expand Down
2 changes: 1 addition & 1 deletion taglib/asf/asfpicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TagLib
/*!
* Destroys the picture.
*/
virtual ~Picture();
~Picture();

/*!
* Copies the contents of \a other into this picture.
Expand Down
2 changes: 1 addition & 1 deletion taglib/mp4/mp4coverart.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace TagLib {
};

CoverArt(Format format, const ByteVector &data);
virtual ~CoverArt();
~CoverArt();

CoverArt(const CoverArt &item);

Expand Down
2 changes: 1 addition & 1 deletion taglib/mp4/mp4item.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace TagLib {
*/
void swap(Item &item) noexcept;

virtual ~Item();
~Item();

Item(int value);
Item(unsigned char value);
Expand Down
2 changes: 1 addition & 1 deletion taglib/mpeg/id3v2/id3v2extendedheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace TagLib {
/*!
* Destroys the extended header.
*/
virtual ~ExtendedHeader();
~ExtendedHeader();

ExtendedHeader(const ExtendedHeader &) = delete;
ExtendedHeader &operator=(const ExtendedHeader &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/mpeg/id3v2/id3v2footer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace TagLib {
/*!
* Destroys the footer.
*/
virtual ~Footer();
~Footer();

Footer(const Footer &) = delete;
Footer &operator=(const Footer &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/mpeg/id3v2/id3v2header.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace TagLib {
/*!
* Destroys the header.
*/
virtual ~Header();
~Header();

Header(const Header &) = delete;
Header &operator=(const Header &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/mpeg/mpegheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion taglib/mpeg/xingheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace TagLib {
/*!
* Destroy this XingHeader instance.
*/
virtual ~XingHeader();
~XingHeader();

XingHeader(const XingHeader &) = delete;
XingHeader &operator=(const XingHeader &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/ogg/oggpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace TagLib {
*/
Page(File *file, offset_t pageOffset);

virtual ~Page();
~Page();

Page(const Page &) = delete;
Page &operator=(const Page &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion taglib/ogg/oggpageheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace TagLib {
/*!
* Deletes this instance of the PageHeader.
*/
virtual ~PageHeader();
~PageHeader();

PageHeader(const PageHeader &) = delete;
PageHeader &operator=(const PageHeader &) = delete;
Expand Down
26 changes: 13 additions & 13 deletions tests/test_sizes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ class TestSizes : public CppUnit::TestFixture
// $ grep kind=\"class\" index.xml | sed -E -e 's/(.*<name>|<\/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));
Expand Down Expand Up @@ -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));
Expand All @@ -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<int>));
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<int, int>));
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Mod::File));
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::FileBase));
Expand All @@ -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));
Expand Down

0 comments on commit cd6eb65

Please sign in to comment.