Skip to content

Commit

Permalink
tidy: Use the 'override' keyword on destructors.
Browse files Browse the repository at this point in the history
The new override keyword should be used on functions in a derived
classes that overload a function in their base class.  It implicitly
declares the function as virtual, so it replaces that keyword.  It
additionally requires that a function exist in the base class with the
exact same type signature.  I.E. it validates that the overridden
function exists.  This prevents functions that look like they override
a base class function but don't.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
  • Loading branch information
linuxdude42 committed Mar 26, 2019
1 parent e661c1d commit a3ffc24
Show file tree
Hide file tree
Showing 32 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutput.h
Expand Up @@ -59,7 +59,7 @@ class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners
bool willsuspendpa = true);

AudioOutput() = default;
virtual ~AudioOutput();
~AudioOutput() override;

// reconfigure sound out for new params
virtual void Reconfigure(const AudioSettings &settings) = 0;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutput_omx.h
Expand Up @@ -16,7 +16,7 @@ class AudioOutputOMX : public AudioOutputBase, private OMXComponentCtx
{
public:
explicit AudioOutputOMX(const AudioSettings &settings);
virtual ~AudioOutputOMX();
~AudioOutputOMX() override;

// No copying
AudioOutputOMX(const AudioOutputOMX&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputalsa.h
Expand Up @@ -13,7 +13,7 @@ class AudioOutputALSA : public AudioOutputBase
{
public:
explicit AudioOutputALSA(const AudioSettings &settings);
virtual ~AudioOutputALSA();
~AudioOutputALSA() override;

// Volume control
int GetVolumeChannel(int channel) const override; // VolumeBase
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputbase.h
Expand Up @@ -51,7 +51,7 @@ class AudioOutputBase : public AudioOutput, public MThread
public:
const char *quality_string(int q);
explicit AudioOutputBase(const AudioSettings &settings);
virtual ~AudioOutputBase();
~AudioOutputBase() override;

AudioOutputSettings* GetOutputSettingsCleaned(bool digital = true) override; // AudioOutput
AudioOutputSettings* GetOutputSettingsUsers(bool digital = false) override; // AudioOutput
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputgraph.h
Expand Up @@ -14,7 +14,7 @@ class MPUBLIC AudioOutputGraph : public MythTV::Visual
{
public:
AudioOutputGraph();
virtual ~AudioOutputGraph();
~AudioOutputGraph() override;

// Properties
void SetPainter(MythPainter* /*painter*/);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputjack.h
Expand Up @@ -19,7 +19,7 @@ class AudioOutputJACK : public AudioOutputBase

public:
explicit AudioOutputJACK(const AudioSettings &settings);
virtual ~AudioOutputJACK();
~AudioOutputJACK() override;

// Volume control
int GetVolumeChannel(int channel) const override; // VolumeBase
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmyth/audio/audiooutputnull.h
Expand Up @@ -22,8 +22,7 @@ class AudioOutputNULL : public AudioOutputBase
{
public:
explicit AudioOutputNULL(const AudioSettings &settings);

virtual ~AudioOutputNULL();
~AudioOutputNULL() override;

void Reset(void) override; // AudioOutputBase

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputoss.h
Expand Up @@ -13,7 +13,7 @@ class AudioOutputOSS : public AudioOutputBase
{
public:
explicit AudioOutputOSS(const AudioSettings &settings);
virtual ~AudioOutputOSS();
~AudioOutputOSS() override;

// Volume control
int GetVolumeChannel(int channel) const override; // VolumeBase
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputpulse.h
Expand Up @@ -28,7 +28,7 @@ class AudioOutputPulseAudio : public AudioOutputBase
{
public:
explicit AudioOutputPulseAudio(const AudioSettings &settings);
~AudioOutputPulseAudio();
~AudioOutputPulseAudio() override;

int GetVolumeChannel(int channel) const override; // VolumeBase
void SetVolumeChannel(int channel, int volume) override; // VolumeBase
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/mythcontext.cpp
Expand Up @@ -70,7 +70,7 @@ class MythContextPrivate : public QObject

public:
MythContextPrivate(MythContext *lparent);
~MythContextPrivate();
~MythContextPrivate() override;

bool Init (bool gui,
bool prompt, bool noPrompt,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythcorecontext.cpp
Expand Up @@ -57,7 +57,7 @@ class MythCoreContextPrivate : public QObject
public:
MythCoreContextPrivate(MythCoreContext *lparent, QString binversion,
QObject *guicontext);
~MythCoreContextPrivate();
~MythCoreContextPrivate() override;

bool WaitForWOL(int timeout_in_ms = INT_MAX);

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythsystem.cpp
Expand Up @@ -70,7 +70,7 @@ class MythSystemLegacyWrapper : public MythSystem
return wrapper;
}

~MythSystemLegacyWrapper(void)
~MythSystemLegacyWrapper(void) override
{
Wait(0);
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/serverpool.cpp
Expand Up @@ -31,7 +31,7 @@ class PrivUdpSocket : public QUdpSocket
public:
PrivUdpSocket(QObject *parent, QNetworkAddressEntry host) :
QUdpSocket(parent), m_host(host) { };
~PrivUdpSocket() = default;
~PrivUdpSocket() override = default;
QNetworkAddressEntry host()
{
return m_host;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythmetadata/imagemetadata.cpp
Expand Up @@ -268,7 +268,7 @@ class PictureMetaData : public ImageMetaData
{
public:
explicit PictureMetaData(const QString &filePath);
~PictureMetaData() = default; // libexiv2 closes file, cleans up via autoptrs
~PictureMetaData() override = default; // libexiv2 closes file, cleans up via autoptrs

bool IsValid() override // ImageMetaData
{ return m_image.get(); }
Expand Down Expand Up @@ -494,7 +494,7 @@ class VideoMetaData : public ImageMetaData
{
public:
explicit VideoMetaData(const QString &filePath);
~VideoMetaData();
~VideoMetaData() override;

bool IsValid() override // ImageMetaData
{ return m_dict; }
Expand Down
Expand Up @@ -45,7 +45,7 @@ class FileTransfer : public SocketHandler
void SetTimeout(bool fast);

private:
~FileTransfer();
~FileTransfer() override;

volatile bool m_readthreadlive {true};
bool m_readsLocked {false};
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythairplayserver.h
Expand Up @@ -86,7 +86,7 @@ class MTV_PUBLIC MythAirplayServer : public ServerPool
void timeout(void);

private:
virtual ~MythAirplayServer(void);
~MythAirplayServer(void) override;
void Teardown(void);
void HandleResponse(APHTTPRequest *req, QTcpSocket *socket);
QByteArray StatusToString(int status);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythraopconnection.h
Expand Up @@ -51,7 +51,7 @@ class MTV_PUBLIC MythRAOPConnection : public QObject
public:
MythRAOPConnection(QObject *parent, QTcpSocket *socket, QByteArray id,
int port);
~MythRAOPConnection();
~MythRAOPConnection() override;
bool Init(void);
QTcpSocket *GetSocket() { return m_socket; }
int GetDataPort() { return m_dataPort; }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythraopdevice.h
Expand Up @@ -35,7 +35,7 @@ class MTV_PUBLIC MythRAOPDevice : public ServerPool
void deleteClient();

private:
virtual ~MythRAOPDevice(void);
~MythRAOPDevice(void) override;
void Teardown(void);
bool RegisterForBonjour(void);

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/Bluray/bdoverlayscreen.h
Expand Up @@ -10,7 +10,7 @@ class BDOverlayScreen : public MythScreenType
{
public:
BDOverlayScreen(MythPlayer *player, const QString &name);
~BDOverlayScreen();
~BDOverlayScreen() override;

void DisplayBDOverlay(BDOverlay *overlay);

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/Bluray/bdringbuffer.h
Expand Up @@ -76,7 +76,7 @@ class MTV_PUBLIC BDRingBuffer : public RingBuffer

public:
explicit BDRingBuffer(const QString &lfilename);
virtual ~BDRingBuffer();
~BDRingBuffer() override;

bool IsStreamed(void) override { return true; } // RingBuffer

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/DVD/avformatdecoderdvd.h
Expand Up @@ -14,7 +14,7 @@ class AvFormatDecoderDVD : public AvFormatDecoder
AvFormatDecoderDVD(MythPlayer *parent, const ProgramInfo &pginfo,
PlayerFlags flags)
: AvFormatDecoder(parent, pginfo, flags) {}
virtual ~AvFormatDecoderDVD();
~AvFormatDecoderDVD() override;
void Reset(bool reset_video_data, bool seek_reset, bool reset_file) override; // AvFormatDecoder
void UpdateFramesPlayed(void) override; // AvFormatDecoder
bool GetFrame(DecodeType decodetype) override; // AvFormatDecoder
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/DVD/dvdringbuffer.h
Expand Up @@ -35,7 +35,7 @@ class MTV_PUBLIC MythDVDContext : public ReferenceCounter

public:
MythDVDContext() = delete; // Default constructor should not be called
virtual ~MythDVDContext() = default;
~MythDVDContext() override = default;

int64_t GetStartPTS() const { return (int64_t)m_pci.pci_gi.vobu_s_ptm; }
int64_t GetEndPTS() const { return (int64_t)m_pci.pci_gi.vobu_e_ptm; }
Expand Down Expand Up @@ -94,7 +94,7 @@ class MTV_PUBLIC DVDRingBuffer : public RingBuffer

public:
explicit DVDRingBuffer(const QString &lfilename);
virtual ~DVDRingBuffer();
~DVDRingBuffer() override;

// gets
int GetTitle(void) const { return m_title; }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/HLS/httplivestreambuffer.h
Expand Up @@ -45,7 +45,7 @@ class HLSRingBuffer : public RingBuffer
public:
explicit HLSRingBuffer(const QString &lfilename);
HLSRingBuffer(const QString &lfilename, bool open);
virtual ~HLSRingBuffer();
~HLSRingBuffer() override;

bool IsOpen(void) const override; // RingBuffer
long long GetReadPosition(void) const override; // RingBuffer
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp
Expand Up @@ -914,7 +914,7 @@ class cCiApplicationInformation : public cCiSession {
char *menuString;
public:
cCiApplicationInformation(int SessionId, cCiTransportConnection *Tc);
virtual ~cCiApplicationInformation();
~cCiApplicationInformation() override;
bool Process(int Length = 0, const uint8_t *Data = nullptr) override; // cCiSession
bool EnterMenu(void);
char *GetApplicationString() { return strdup(menuString); };
Expand Down Expand Up @@ -1211,7 +1211,7 @@ class cCiMMI : public cCiSession {
cCiEnquiry *enquiry;
public:
cCiMMI(int SessionId, cCiTransportConnection *Tc);
virtual ~cCiMMI();
~cCiMMI() override;
bool Process(int Length = 0, const uint8_t *Data = nullptr) override; // cCiSession
bool HasUserIO(void) override { return menu || enquiry; } // cCiSession
cCiMenu *Menu(void);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/vaapicontext.cpp
Expand Up @@ -103,7 +103,7 @@ class VAAPIDisplay : ReferenceCounter
m_va_disp(nullptr), m_x_disp(nullptr),
m_driver() { }
public:
~VAAPIDisplay()
~VAAPIDisplay() override
{
if (m_va_disp)
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/mythrender_vdpau.cpp
Expand Up @@ -246,7 +246,7 @@ class VDPAUVideoMixer : public VDPAUResource
memset(&m_csc, 0, sizeof(VdpCSCMatrix));
}

~VDPAUVideoMixer()
~VDPAUVideoMixer() override
{
delete m_noise_reduction;
delete m_sharpness;
Expand Down
Expand Up @@ -17,7 +17,7 @@ class WebSocketMythEvent : public WebSocketExtension

public:
WebSocketMythEvent();
virtual ~WebSocketMythEvent();
~WebSocketMythEvent() override;

bool HandleTextFrame(const WebSocketFrame &frame) override; // WebSocketExtension
void customEvent(QEvent* /*event*/) override; // QObject
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythbackend/mainserver.cpp
Expand Up @@ -145,7 +145,7 @@ class ProcessRequestRunnable : public QRunnable
m_sock->IncrRef();
}

virtual ~ProcessRequestRunnable()
~ProcessRequestRunnable() override
{
if (m_sock)
{
Expand Down Expand Up @@ -174,7 +174,7 @@ class FreeSpaceUpdater : public QRunnable
{
m_lastRequest.start();
}
~FreeSpaceUpdater()
~FreeSpaceUpdater() override
{
QMutexLocker locker(&m_parent.m_masterFreeSpaceListLock);
m_parent.m_masterFreeSpaceListUpdater = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/guidegrid.cpp
Expand Up @@ -270,7 +270,7 @@ class GuideUpdateProgramRow : public GuideUpdaterBase
for (int j = 0; j < MAX_DISPLAY_TIMES; ++j)
m_programInfos[i][j] = nullptr;
}
virtual ~GuideUpdateProgramRow() = default;
~GuideUpdateProgramRow() override = default;
bool ExecuteNonUI(void) override // GuideUpdaterBase
{
// Don't bother to do any work if the starting coordinates of
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -171,7 +171,7 @@ namespace
}
}

~RunSettingsCompletion() = default;
~RunSettingsCompletion() override = default;

private slots:
void OnPasswordResultReady(bool passwordValid,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/playbackboxhelper.cpp
Expand Up @@ -35,7 +35,7 @@ class PBHEventHandler : public QObject
{
StorageGroup::ClearGroupToUseCache();
}
~PBHEventHandler()
~PBHEventHandler() override
{
if (m_freeSpaceTimerId)
killTimer(m_freeSpaceTimerId);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/videodlg.cpp
Expand Up @@ -297,7 +297,7 @@ namespace
// Having it here causes a runtime error on windows
}

~FanartLoader()
~FanartLoader() override
{
m_fanartTimer.stop();
m_fanartTimer.disconnect(this);
Expand Down

0 comments on commit a3ffc24

Please sign in to comment.