From 56caab44616a17488025ef7836d5e7c8a5abaa4f Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 15 Jun 2020 00:11:52 +0200 Subject: [PATCH] Remove redundant initialization --- 3rdparty/taglib/ape/apetag.cpp | 4 ++-- 3rdparty/taglib/asf/asftag.cpp | 2 +- 3rdparty/taglib/dsdiff/dsdiffdiintag.cpp | 2 +- 3rdparty/taglib/fileref.cpp | 2 +- 3rdparty/taglib/it/itfile.cpp | 2 +- 3rdparty/taglib/mod/modtag.cpp | 2 +- 3rdparty/taglib/mp4/mp4coverart.cpp | 2 +- 3rdparty/taglib/mp4/mp4item.cpp | 2 +- 3rdparty/taglib/mpeg/id3v1/id3v1tag.cpp | 4 ++-- 3rdparty/taglib/mpeg/id3v2/id3v2tag.cpp | 4 ++-- 3rdparty/taglib/ogg/xiphcomment.cpp | 4 ++-- 3rdparty/taglib/riff/wav/infotag.cpp | 4 ++-- 3rdparty/taglib/toolkit/tbytevectorlist.cpp | 2 +- 3rdparty/taglib/toolkit/tpropertymap.cpp | 2 +- 3rdparty/taglib/toolkit/tstring.cpp | 2 +- 3rdparty/taglib/toolkit/tstringlist.cpp | 6 +++--- 3rdparty/taglib/xm/xmfile.cpp | 10 +++------- ext/libstrawberry-common/core/logging.cpp | 6 +++--- src/engine/gstengine.cpp | 3 +-- src/engine/vlcengine.cpp | 3 +-- src/playlist/playlistdelegates.cpp | 2 +- 21 files changed, 32 insertions(+), 38 deletions(-) diff --git a/3rdparty/taglib/ape/apetag.cpp b/3rdparty/taglib/ape/apetag.cpp index df8e10596..00a518467 100644 --- a/3rdparty/taglib/ape/apetag.cpp +++ b/3rdparty/taglib/ape/apetag.cpp @@ -86,9 +86,9 @@ class APE::Tag::TagPrivate { // public methods //////////////////////////////////////////////////////////////////////////////// -APE::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) {} +APE::Tag::Tag() : d(new TagPrivate()) {} -APE::Tag::Tag(Strawberry_TagLib::TagLib::File *file, long footerLocation) : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +APE::Tag::Tag(Strawberry_TagLib::TagLib::File *file, long footerLocation) : d(new TagPrivate()) { d->file = file; d->footerLocation = footerLocation; diff --git a/3rdparty/taglib/asf/asftag.cpp b/3rdparty/taglib/asf/asftag.cpp index 41bb59c00..6ff370533 100644 --- a/3rdparty/taglib/asf/asftag.cpp +++ b/3rdparty/taglib/asf/asftag.cpp @@ -38,7 +38,7 @@ class ASF::Tag::TagPrivate { AttributeListMap attributeListMap; }; -ASF::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +ASF::Tag::Tag() : d(new TagPrivate()) { } ASF::Tag::~Tag() { diff --git a/3rdparty/taglib/dsdiff/dsdiffdiintag.cpp b/3rdparty/taglib/dsdiff/dsdiffdiintag.cpp index 7a620e4f8..6a379e218 100644 --- a/3rdparty/taglib/dsdiff/dsdiffdiintag.cpp +++ b/3rdparty/taglib/dsdiff/dsdiffdiintag.cpp @@ -39,7 +39,7 @@ class DSDIFF::DIIN::Tag::TagPrivate { String artist; }; -DSDIFF::DIIN::Tag::Tag() : Strawberry_TagLib::TagLib::Tag() { +DSDIFF::DIIN::Tag::Tag() { d = new TagPrivate; } diff --git a/3rdparty/taglib/fileref.cpp b/3rdparty/taglib/fileref.cpp index 14d954244..e72e0a79f 100644 --- a/3rdparty/taglib/fileref.cpp +++ b/3rdparty/taglib/fileref.cpp @@ -274,7 +274,7 @@ File *createInternal(FileName fileName, bool readAudioProperties, AudioPropertie class FileRef::FileRefPrivate : public RefCounter { public: - FileRefPrivate() : RefCounter(), file(nullptr), stream(nullptr) {} + FileRefPrivate() : file(nullptr), stream(nullptr) {} ~FileRefPrivate() { delete file; diff --git a/3rdparty/taglib/it/itfile.cpp b/3rdparty/taglib/it/itfile.cpp index 4eaf728e5..b4ede3c8c 100644 --- a/3rdparty/taglib/it/itfile.cpp +++ b/3rdparty/taglib/it/itfile.cpp @@ -35,7 +35,7 @@ using namespace IT; class IT::File::FilePrivate { public: - explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : tag(), properties(propertiesStyle) {} + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; IT::Properties properties; diff --git a/3rdparty/taglib/mod/modtag.cpp b/3rdparty/taglib/mod/modtag.cpp index 9fb9de377..e224e2ebf 100644 --- a/3rdparty/taglib/mod/modtag.cpp +++ b/3rdparty/taglib/mod/modtag.cpp @@ -40,7 +40,7 @@ class Mod::Tag::TagPrivate { String trackerName; }; -Mod::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) {} +Mod::Tag::Tag() : d(new TagPrivate()) {} Mod::Tag::~Tag() { delete d; diff --git a/3rdparty/taglib/mp4/mp4coverart.cpp b/3rdparty/taglib/mp4/mp4coverart.cpp index d6659a0f7..536b73fc5 100644 --- a/3rdparty/taglib/mp4/mp4coverart.cpp +++ b/3rdparty/taglib/mp4/mp4coverart.cpp @@ -32,7 +32,7 @@ using namespace Strawberry_TagLib::TagLib; class MP4::CoverArt::CoverArtPrivate : public RefCounter { public: - CoverArtPrivate() : RefCounter(), format(MP4::CoverArt::JPEG) {} + CoverArtPrivate() : format(MP4::CoverArt::JPEG) {} Format format; ByteVector data; diff --git a/3rdparty/taglib/mp4/mp4item.cpp b/3rdparty/taglib/mp4/mp4item.cpp index a011e5964..a65029113 100644 --- a/3rdparty/taglib/mp4/mp4item.cpp +++ b/3rdparty/taglib/mp4/mp4item.cpp @@ -32,7 +32,7 @@ using namespace Strawberry_TagLib::TagLib; class MP4::Item::ItemPrivate : public RefCounter { public: - ItemPrivate() : RefCounter(), valid(true), atomDataType(TypeUndefined) {} + ItemPrivate() : valid(true), atomDataType(TypeUndefined) {} bool valid; AtomDataType atomDataType; diff --git a/3rdparty/taglib/mpeg/id3v1/id3v1tag.cpp b/3rdparty/taglib/mpeg/id3v1/id3v1tag.cpp index d75c74f77..4720dfc41 100644 --- a/3rdparty/taglib/mpeg/id3v1/id3v1tag.cpp +++ b/3rdparty/taglib/mpeg/id3v1/id3v1tag.cpp @@ -80,9 +80,9 @@ ByteVector ID3v1::StringHandler::render(const String &s) const { // public methods //////////////////////////////////////////////////////////////////////////////// -ID3v1::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) {} +ID3v1::Tag::Tag() : d(new TagPrivate()) {} -ID3v1::Tag::Tag(File *file, long tagOffset) : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +ID3v1::Tag::Tag(File *file, long tagOffset) : d(new TagPrivate()) { d->file = file; d->tagOffset = tagOffset; diff --git a/3rdparty/taglib/mpeg/id3v2/id3v2tag.cpp b/3rdparty/taglib/mpeg/id3v2/id3v2tag.cpp index 51d52ef59..f0a8e23ea 100644 --- a/3rdparty/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/3rdparty/taglib/mpeg/id3v2/id3v2tag.cpp @@ -99,11 +99,11 @@ String Latin1StringHandler::parse(const ByteVector &data) const { // public members //////////////////////////////////////////////////////////////////////////////// -ID3v2::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +ID3v2::Tag::Tag() : d(new TagPrivate()) { d->factory = FrameFactory::instance(); } -ID3v2::Tag::Tag(File *file, long tagOffset, const FrameFactory *factory) : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +ID3v2::Tag::Tag(File *file, long tagOffset, const FrameFactory *factory) : d(new TagPrivate()) { d->factory = factory; d->file = file; d->tagOffset = tagOffset; diff --git a/3rdparty/taglib/ogg/xiphcomment.cpp b/3rdparty/taglib/ogg/xiphcomment.cpp index acde2a594..45d867d2c 100644 --- a/3rdparty/taglib/ogg/xiphcomment.cpp +++ b/3rdparty/taglib/ogg/xiphcomment.cpp @@ -57,9 +57,9 @@ class Ogg::XiphComment::XiphCommentPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -Ogg::XiphComment::XiphComment() : Strawberry_TagLib::TagLib::Tag(), d(new XiphCommentPrivate()) {} +Ogg::XiphComment::XiphComment() : d(new XiphCommentPrivate()) {} -Ogg::XiphComment::XiphComment(const ByteVector &data) : Strawberry_TagLib::TagLib::Tag(), d(new XiphCommentPrivate()) { +Ogg::XiphComment::XiphComment(const ByteVector &data) : d(new XiphCommentPrivate()) { parse(data); } diff --git a/3rdparty/taglib/riff/wav/infotag.cpp b/3rdparty/taglib/riff/wav/infotag.cpp index 73f6ca26a..237ea0e6c 100644 --- a/3rdparty/taglib/riff/wav/infotag.cpp +++ b/3rdparty/taglib/riff/wav/infotag.cpp @@ -62,11 +62,11 @@ ByteVector RIFF::Info::StringHandler::render(const String &s) const { // public members //////////////////////////////////////////////////////////////////////////////// -RIFF::Info::Tag::Tag(const ByteVector &data) : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) { +RIFF::Info::Tag::Tag(const ByteVector &data) : d(new TagPrivate()) { parse(data); } -RIFF::Info::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(), d(new TagPrivate()) {} +RIFF::Info::Tag::Tag() : d(new TagPrivate()) {} RIFF::Info::Tag::~Tag() { delete d; diff --git a/3rdparty/taglib/toolkit/tbytevectorlist.cpp b/3rdparty/taglib/toolkit/tbytevectorlist.cpp index a282f0763..0ff240aa4 100644 --- a/3rdparty/taglib/toolkit/tbytevectorlist.cpp +++ b/3rdparty/taglib/toolkit/tbytevectorlist.cpp @@ -58,7 +58,7 @@ ByteVectorList ByteVectorList::split(const ByteVector &v, const ByteVector &patt // public members //////////////////////////////////////////////////////////////////////////////// -ByteVectorList::ByteVectorList() : List(), d(nullptr) {} +ByteVectorList::ByteVectorList() : d(nullptr) {} ByteVectorList::~ByteVectorList() {} diff --git a/3rdparty/taglib/toolkit/tpropertymap.cpp b/3rdparty/taglib/toolkit/tpropertymap.cpp index fd5cad2b2..426b5a28d 100644 --- a/3rdparty/taglib/toolkit/tpropertymap.cpp +++ b/3rdparty/taglib/toolkit/tpropertymap.cpp @@ -28,7 +28,7 @@ using namespace Strawberry_TagLib::TagLib; -PropertyMap::PropertyMap() : SimplePropertyMap() {} +PropertyMap::PropertyMap() {} PropertyMap::PropertyMap(const SimplePropertyMap &m) { diff --git a/3rdparty/taglib/toolkit/tstring.cpp b/3rdparty/taglib/toolkit/tstring.cpp index 51e747219..373821a71 100644 --- a/3rdparty/taglib/toolkit/tstring.cpp +++ b/3rdparty/taglib/toolkit/tstring.cpp @@ -145,7 +145,7 @@ namespace TagLib { class String::StringPrivate : public RefCounter { public: - StringPrivate() : RefCounter() {} + StringPrivate() {} /*! * Stores string in UTF-16. The byte order depends on the CPU endian. diff --git a/3rdparty/taglib/toolkit/tstringlist.cpp b/3rdparty/taglib/toolkit/tstringlist.cpp index 9d6820fa9..9edf4b766 100644 --- a/3rdparty/taglib/toolkit/tstringlist.cpp +++ b/3rdparty/taglib/toolkit/tstringlist.cpp @@ -54,13 +54,13 @@ StringList StringList::split(const String &s, const String &pattern) { // public members //////////////////////////////////////////////////////////////////////////////// -StringList::StringList() : List(), d(nullptr) {} +StringList::StringList() : d(nullptr) {} -StringList::StringList(const String &s) : List(), d(nullptr) { +StringList::StringList(const String &s) : d(nullptr) { append(s); } -StringList::StringList(const ByteVectorList &bl, String::Type t) : List() { +StringList::StringList(const ByteVectorList &bl, String::Type t) { ByteVectorList::ConstIterator i = bl.begin(); for (; i != bl.end(); i++) { diff --git a/3rdparty/taglib/xm/xmfile.cpp b/3rdparty/taglib/xm/xmfile.cpp index 80ea360b6..ea1d38118 100644 --- a/3rdparty/taglib/xm/xmfile.cpp +++ b/3rdparty/taglib/xm/xmfile.cpp @@ -82,8 +82,7 @@ class Reader { class SkipReader : public Reader { public: - explicit SkipReader(unsigned int size) : m_size(size) { - } + explicit SkipReader(unsigned int size) : m_size(size) {} unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) { unsigned int count = std::min(m_size, limit); @@ -102,8 +101,7 @@ class SkipReader : public Reader { template class ValueReader : public Reader { public: - explicit ValueReader(T &_value) : value(_value) { - } + explicit ValueReader(T &_value) : value(_value) {} protected: T &value; @@ -306,9 +304,7 @@ class StructReader : public Reader { class XM::File::FilePrivate { public: - explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) - : tag(), properties(propertiesStyle) { - } + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; XM::Properties properties; diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 801bc3983..1daf01682 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -97,8 +97,8 @@ class DebugBase : public QDebug { // Debug message will be stored in a buffer. class BufferedDebug : public DebugBase { public: - BufferedDebug() : DebugBase() {} - BufferedDebug(QtMsgType) : DebugBase(), buf_(new QBuffer, later_deleter) { + BufferedDebug() {} + BufferedDebug(QtMsgType) : buf_(new QBuffer, later_deleter) { buf_->open(QIODevice::WriteOnly); // QDebug doesn't have a method to set a new io device, but swap() allows the devices to be swapped between two instances. @@ -116,7 +116,7 @@ class BufferedDebug : public DebugBase { // Debug message will be logged immediately. class LoggedDebug : public DebugBase { public: - LoggedDebug() : DebugBase() {} + LoggedDebug() {} LoggedDebug(QtMsgType t) : DebugBase(t) { nospace() << kMessageHandlerMagic; } }; diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index fc61381c4..776c2f92d 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -72,8 +72,7 @@ const char *GstEngine::kDirectSoundSink = "directsoundsink"; const char *GstEngine::kOSXAudioSink = "osxaudiosink"; GstEngine::GstEngine(TaskManager *task_manager) - : Engine::Base(), - task_manager_(task_manager), + : task_manager_(task_manager), buffering_task_id_(-1), latest_buffer_(nullptr), stereo_balancer_enabled_(false), diff --git a/src/engine/vlcengine.cpp b/src/engine/vlcengine.cpp index 68e08e645..3171dec59 100644 --- a/src/engine/vlcengine.cpp +++ b/src/engine/vlcengine.cpp @@ -39,8 +39,7 @@ #include "vlcscopedref.h" VLCEngine::VLCEngine(TaskManager *task_manager) - : EngineBase(), - instance_(nullptr), + : instance_(nullptr), player_(nullptr), state_(Engine::Empty) { diff --git a/src/playlist/playlistdelegates.cpp b/src/playlist/playlistdelegates.cpp index 8ed5e5b16..7a0c12f57 100644 --- a/src/playlist/playlistdelegates.cpp +++ b/src/playlist/playlistdelegates.cpp @@ -363,7 +363,7 @@ QWidget *TextItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewI return new QLineEdit(parent); } -TagCompletionModel::TagCompletionModel(CollectionBackend *backend, Playlist::Column column) : QStringListModel() { +TagCompletionModel::TagCompletionModel(CollectionBackend *backend, Playlist::Column column) { QString col = database_column(column); if (!col.isEmpty()) {