Skip to content

Commit

Permalink
tidy: Remove redundant member initialization.
Browse files Browse the repository at this point in the history
Clang-tidy pointed out where functions explicitly initialize a member
to a default value, that has already been initialized to its default
value.  Changes made by the clang-tidy program, with some cleanup by
hand.

These problems were pointed out by clang-tidy's "redundant member
initialization" check.

https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-member-init.html
  • Loading branch information
linuxdude42 committed Mar 20, 2019
1 parent 5eabd02 commit 28cf98e
Show file tree
Hide file tree
Showing 59 changed files with 70 additions and 148 deletions.
1 change: 0 additions & 1 deletion mythplugins/mythgallery/mythgallery/gallerysettings.cpp
Expand Up @@ -294,7 +294,6 @@ static HostCheckBoxSetting *SlideshowRecursive()
};

GallerySettings::GallerySettings()
:GroupSetting()
{
setLabel(GallerySettings::tr("MythGallery Settings (General)"));
addChild(MythGalleryDir());
Expand Down
5 changes: 2 additions & 3 deletions mythplugins/mythgame/mythgame/gamesettings.cpp
Expand Up @@ -316,8 +316,7 @@ struct AllowMultipleRoms : public MythUICheckBoxSetting

/// Settings for a game player
GamePlayerSetting::GamePlayerSetting(QString name, uint id)
: GroupSetting()
, m_id(id)
: m_id(id)
{
setName(name);

Expand Down Expand Up @@ -355,7 +354,7 @@ void GamePlayerSetting::deleteEntry()

// -----------------------------------------------------------------------

GamePlayersList::GamePlayersList() : GroupSetting()
GamePlayersList::GamePlayersList()
{
setLabel(tr("Game Players"));
}
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/mainvisual.cpp
Expand Up @@ -33,7 +33,7 @@ using namespace std;
// MainVisual

MainVisual::MainVisual(MythUIVideo *visualizer)
: QObject(nullptr), MythTV::Visual(), m_visualizerVideo(visualizer)
: QObject(nullptr), m_visualizerVideo(visualizer)
{
setObjectName("MainVisual");

Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythnews/mythnews/newssite.cpp
Expand Up @@ -20,7 +20,6 @@ NewsSite::NewsSite(const QString &name,
const QString &url,
const QDateTime &updated,
const bool podcast) :
QObject(),
m_name(name), m_url(url), m_urlReq(url),
m_updated(updated),
m_destDir(GetConfDir()+"/MythNews"),
Expand Down
4 changes: 1 addition & 3 deletions mythtv/libs/libmyth/audio/audiooutput.h
Expand Up @@ -58,9 +58,7 @@ class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners
const QString &passthru_device = QString(),
bool willsuspendpa = true);

AudioOutput() :
VolumeBase(), OutputListeners() {}

AudioOutput() {}
virtual ~AudioOutput();

// reconfigure sound out for new params
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmyth/dbsettings.cpp
Expand Up @@ -10,7 +10,6 @@
#include "mythdbparams.h"

DatabaseSettings::DatabaseSettings(const QString &DBhostOverride)
: GroupSetting()
{
m_DBhostOverride = DBhostOverride;

Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmyth/mythrssmanager.cpp
Expand Up @@ -116,7 +116,6 @@ RSSSite::RSSSite(const QString& title,
const QString& author,
const bool& download,
const QDateTime& updated) :
QObject(),
m_title(title), m_sortTitle(sortTitle), m_image(image), m_type(type),
m_description(description), m_url(url), m_author(author),
m_download(download), m_updated(updated)
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmyth/standardsettings.cpp
Expand Up @@ -361,7 +361,6 @@ void AutoIncrementSetting::Save(void)
}

AutoIncrementSetting::AutoIncrementSetting(QString _table, QString _column) :
StandardSetting(),
m_table(_table), m_column(_column)
{
setValue("0");
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythbase/lcddevice.cpp
Expand Up @@ -38,8 +38,7 @@
#define LOC QString("LCDdevice: ")

LCD::LCD()
: QObject(),
m_retryTimer(new QTimer(this)), m_LEDTimer(new QTimer(this))
: m_retryTimer(new QTimer(this)), m_LEDTimer(new QTimer(this))
{
m_sendBuffer.clear(); m_lastCommand.clear();
m_lcdShowMusicItems.clear(); m_lcdKeyString.clear();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythsystemunix.cpp
Expand Up @@ -78,7 +78,7 @@ void ShutdownMythSystemLegacy(void)

MythSystemLegacyIOHandler::MythSystemLegacyIOHandler(bool read) :
MThread(QString("SystemIOHandler%1").arg(read ? "R" : "W")),
m_pWaitLock(), m_pWait(), m_pLock(), m_pMap(PMap_t()),
m_pMap(PMap_t()),
m_read(read)
{
FD_ZERO(&m_fds);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythmetadata/imagemanager.cpp
Expand Up @@ -271,7 +271,7 @@ QList<int> DeviceManager::GetAbsentees()
/*!
\brief Constructor
*/
ImageAdapterBase::ImageAdapterBase() : DeviceManager(),
ImageAdapterBase::ImageAdapterBase() :
m_imageFileExt(SupportedImages()),
m_videoFileExt(SupportedVideos())
{
Expand Down Expand Up @@ -1124,7 +1124,7 @@ class ReadMetaThread : public QRunnable
{
public:
ReadMetaThread(ImagePtrK im, const QString &path)
: QRunnable(), m_im(im), m_path(path) {}
: m_im(im), m_path(path) {}

void run() override // QRunnable
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythmetadata/imagemetadata.cpp
Expand Up @@ -297,7 +297,7 @@ class PictureMetaData : public ImageMetaData
\param filePath Absolute image path
*/
PictureMetaData::PictureMetaData(const QString &filePath)
: ImageMetaData(filePath), m_image(nullptr), m_exifData()
: ImageMetaData(filePath), m_image(nullptr)
{
try
{
Expand Down
5 changes: 0 additions & 5 deletions mythtv/libs/libmythmetadata/metaioflacvorbis.cpp
Expand Up @@ -13,11 +13,6 @@
#include "musicmetadata.h"
#include "musicutils.h"

MetaIOFLACVorbis::MetaIOFLACVorbis(void)
: MetaIOTagLib()
{
}

/*!
* \brief Open the file to read the tag
*
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythmetadata/metaioflacvorbis.h
Expand Up @@ -21,7 +21,7 @@ using TagLib::String;
class META_PUBLIC MetaIOFLACVorbis : public MetaIOTagLib
{
public:
MetaIOFLACVorbis(void);
MetaIOFLACVorbis(void) = default;
virtual ~MetaIOFLACVorbis(void) = default;

bool write(const QString &filename, MusicMetadata* mdata) override; // MetaIOTagLib
Expand Down
Expand Up @@ -3,7 +3,7 @@

#include "requesthandler/messagehandler.h"

MessageHandler::MessageHandler(void) : SocketRequestHandler()
MessageHandler::MessageHandler(void)
{
if (!gCoreContext)
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythairplayserver.h
Expand Up @@ -75,7 +75,7 @@ class MTV_PUBLIC MythAirplayServer : public ServerPool
{ return gMythAirplayServer; }

MythAirplayServer()
: ServerPool(), m_lock(new QMutex(QMutex::Recursive)) {}
: m_lock(new QMutex(QMutex::Recursive)) {}

private slots:
void Start();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythraopdevice.cpp
Expand Up @@ -84,7 +84,7 @@ void MythRAOPDevice::Cleanup(void)
}

MythRAOPDevice::MythRAOPDevice()
: ServerPool(), m_lock(new QMutex(QMutex::Recursive))
: m_lock(new QMutex(QMutex::Recursive))
{
m_hardwareId = QByteArray::fromHex(AirPlayHardwareId().toLatin1());
}
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/avformatwriter.cpp
Expand Up @@ -39,7 +39,6 @@ extern "C" {
#define LOC_WARN QString("AVFW(%1) Warning: ").arg(m_filename)

AVFormatWriter::AVFormatWriter()
: FileWriterBase()
{
memset(&m_fmt, 0, sizeof(m_fmt));
}
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/channelscan/externrecscanner.cpp
Expand Up @@ -28,7 +28,6 @@ ExternRecChannelScanner::ExternRecChannelScanner(uint cardid,
, m_inputname(inputname)
, m_sourceid(sourceid)
, m_thread(new MThread("ExternRecChannelScanner", this))
, m_lock()
{
LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Has ScanMonitor %1")
.arg(monitor ? "true" : "false"));
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp
Expand Up @@ -34,8 +34,7 @@ IPTVChannelFetcher::IPTVChannelFetcher(
m_scan_monitor(monitor),
m_cardid(cardid), m_inputname(inputname),
m_sourceid(sourceid), m_is_mpts(is_mpts),
m_thread(new MThread("IPTVChannelFetcher", this)),
m_lock()
m_thread(new MThread("IPTVChannelFetcher", this))
{
LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Has ScanMonitor %1")
.arg(monitor?"true":"false"));
Expand Down
48 changes: 19 additions & 29 deletions mythtv/libs/libmythtv/diseqcsettings.cpp
Expand Up @@ -90,7 +90,7 @@ class DeviceDescrSetting : public TransTextEditSetting
{
public:
explicit DeviceDescrSetting(DiSEqCDevDevice &device) :
TransTextEditSetting(), m_device(device)
m_device(device)
{
setLabel(DeviceTree::tr("Description"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -153,7 +153,7 @@ class SwitchTypeSetting : public TransMythUIComboBoxSetting
{
public:
explicit SwitchTypeSetting(DiSEqCDevSwitch &switch_dev) :
TransMythUIComboBoxSetting(), m_switch(switch_dev)
m_switch(switch_dev)
{
setLabel(DeviceTree::tr("Switch Type"));
setHelpText(DeviceTree::tr("Select the type of switch from the list."));
Expand Down Expand Up @@ -200,7 +200,7 @@ class SwitchAddressSetting : public TransTextEditSetting
{
public:
explicit SwitchAddressSetting(DiSEqCDevSwitch &switch_dev) :
TransTextEditSetting(), m_switch(switch_dev)
m_switch(switch_dev)
{
setLabel(DeviceTree::tr("Address of switch"));
setHelpText(DeviceTree::tr("The DiSEqC address of the switch."));
Expand All @@ -227,7 +227,7 @@ class SwitchPortsSetting : public TransTextEditSetting
{
public:
explicit SwitchPortsSetting(DiSEqCDevSwitch &switch_dev) :
TransTextEditSetting(), m_switch(switch_dev)
m_switch(switch_dev)
{
setLabel(DeviceTree::tr("Number of ports"));
setHelpText(DeviceTree::tr("The number of ports this switch has."));
Expand Down Expand Up @@ -333,7 +333,7 @@ class RotorTypeSetting : public TransMythUIComboBoxSetting
{
public:
explicit RotorTypeSetting(DiSEqCDevRotor &rotor) :
TransMythUIComboBoxSetting(), m_rotor(rotor)
m_rotor(rotor)
{
setLabel(DeviceTree::tr("Rotor Type"));
setHelpText(DeviceTree::tr("Select the type of rotor from the list."));
Expand Down Expand Up @@ -364,7 +364,7 @@ class RotorLoSpeedSetting : public TransTextEditSetting
{
public:
explicit RotorLoSpeedSetting(DiSEqCDevRotor &rotor) :
TransTextEditSetting(), m_rotor(rotor)
m_rotor(rotor)
{
setLabel(DeviceTree::tr("Rotor Low Speed (deg/sec)"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -394,7 +394,7 @@ class RotorHiSpeedSetting : public TransTextEditSetting
{
public:
explicit RotorHiSpeedSetting(DiSEqCDevRotor &rotor) :
TransTextEditSetting(), m_rotor(rotor)
m_rotor(rotor)
{
setLabel(DeviceTree::tr("Rotor High Speed (deg/sec)"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -468,11 +468,6 @@ static double AngleToFloat(const QString &angle, bool translated = true)
return pos;
}

RotorPosMap::RotorPosMap(DiSEqCDevRotor &rotor) :
GroupSetting(), m_rotor(rotor)
{
}

void RotorPosMap::Load(void)
{
m_posmap = m_rotor.GetPosMap();
Expand All @@ -488,7 +483,7 @@ class RotorPosTextEdit : public TransTextEditSetting
{
public:
RotorPosTextEdit(const QString &label, uint id, const QString &value) :
TransTextEditSetting(), m_id(id)
m_id(id)
{
setLabel(label);
setValue(value);
Expand Down Expand Up @@ -607,7 +602,7 @@ class SCRUserBandSetting : public TransMythUISpinBoxSetting
class SCRFrequencySetting : public TransTextEditSetting
{
public:
explicit SCRFrequencySetting(DiSEqCDevSCR &scr) : TransTextEditSetting(), m_scr(scr)
explicit SCRFrequencySetting(DiSEqCDevSCR &scr) : m_scr(scr)
{
setLabel(DeviceTree::tr("Frequency (MHz)"));
setHelpText(DeviceTree::tr("Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
Expand All @@ -633,7 +628,7 @@ class SCRFrequencySetting : public TransTextEditSetting
class SCRPINSetting : public TransTextEditSetting
{
public:
explicit SCRPINSetting(DiSEqCDevSCR &scr) : TransTextEditSetting(), m_scr(scr)
explicit SCRPINSetting(DiSEqCDevSCR &scr) : m_scr(scr)
{
setLabel(DeviceTree::tr("PIN code"));
setHelpText(DeviceTree::tr("Unicable PIN code (-1 disabled, 0 - 255)"));
Expand Down Expand Up @@ -728,7 +723,7 @@ static uint FindPreset(const DiSEqCDevLNB &lnb)
class LNBPresetSetting : public MythUIComboBoxSetting
{
public:
explicit LNBPresetSetting(DiSEqCDevLNB &lnb) : MythUIComboBoxSetting(), m_lnb(lnb)
explicit LNBPresetSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB Preset"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -762,7 +757,7 @@ class LNBPresetSetting : public MythUIComboBoxSetting
class LNBTypeSetting : public MythUIComboBoxSetting
{
public:
explicit LNBTypeSetting(DiSEqCDevLNB &lnb) : MythUIComboBoxSetting(), m_lnb(lnb)
explicit LNBTypeSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB Type"));
setHelpText(DeviceTree::tr("Select the type of LNB from the list."));
Expand Down Expand Up @@ -798,7 +793,7 @@ class LNBTypeSetting : public MythUIComboBoxSetting
class LNBLOFSwitchSetting : public TransTextEditSetting
{
public:
explicit LNBLOFSwitchSetting(DiSEqCDevLNB &lnb) : TransTextEditSetting(), m_lnb(lnb)
explicit LNBLOFSwitchSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB LOF Switch (MHz)"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -827,7 +822,7 @@ class LNBLOFSwitchSetting : public TransTextEditSetting
class LNBLOFLowSetting : public TransTextEditSetting
{
public:
explicit LNBLOFLowSetting(DiSEqCDevLNB &lnb) : TransTextEditSetting(), m_lnb(lnb)
explicit LNBLOFLowSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB LOF Low (MHz)"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -857,7 +852,7 @@ class LNBLOFLowSetting : public TransTextEditSetting
class LNBLOFHighSetting : public TransTextEditSetting
{
public:
explicit LNBLOFHighSetting(DiSEqCDevLNB &lnb) : TransTextEditSetting(), m_lnb(lnb)
explicit LNBLOFHighSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB LOF High (MHz)"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -886,7 +881,7 @@ class LNBPolarityInvertedSetting : public MythUICheckBoxSetting
{
public:
explicit LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb) :
MythUICheckBoxSetting(), m_lnb(lnb)
m_lnb(lnb)
{
setLabel(DeviceTree::tr("LNB Reversed"));
QString help = DeviceTree::tr(
Expand Down Expand Up @@ -1007,11 +1002,6 @@ void LNBConfig::UpdateType(void)

//////////////////////////////////////// DeviceTree

DeviceTree::DeviceTree(DiSEqCDevTree &tree) :
GroupSetting(), m_tree(tree)
{
}

void DeviceTree::Load(void)
{
PopulateTree();
Expand Down Expand Up @@ -1197,7 +1187,7 @@ class SwitchSetting : public MythUIComboBoxSetting
{
public:
SwitchSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
: MythUIComboBoxSetting(), m_node(node), m_settings(settings)
: m_node(node), m_settings(settings)
{
setLabel(node.GetDescription());
setHelpText(DeviceTree::tr("Choose a port to use for this switch."));
Expand Down Expand Up @@ -1237,7 +1227,7 @@ class RotorSetting : public MythUIComboBoxSetting
{
public:
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
: MythUIComboBoxSetting(), m_node(node), m_settings(settings)
: m_node(node), m_settings(settings)
{
setLabel(node.GetDescription());
setHelpText(DeviceTree::tr("Choose a satellite position."));
Expand Down Expand Up @@ -1330,7 +1320,7 @@ class SCRPositionSetting : public MythUIComboBoxSetting
{
public:
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
: MythUIComboBoxSetting(), m_node(node), m_settings(settings)
: m_node(node), m_settings(settings)
{
setLabel("Position");
setHelpText(DeviceTree::tr("Unicable satellite position (A/B)"));
Expand Down

0 comments on commit 28cf98e

Please sign in to comment.