[clang-tidy] use override instead of virtual

Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-01-31 19:37:53 -08:00
parent 0b2444450f
commit b64fdae938
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
38 changed files with 56 additions and 56 deletions

View File

@ -47,7 +47,7 @@ public:
name.erase(len - 4);
}
virtual void Visit(ArchiveVisitor &visitor) override {
void Visit(ArchiveVisitor &visitor) override {
visitor.VisitArchiveEntry(name.c_str());
}
@ -68,7 +68,7 @@ public:
Bzip2InputStream(const std::shared_ptr<InputStream> &_input,
const char *uri,
Mutex &mutex);
~Bzip2InputStream();
~Bzip2InputStream() override;
/* virtual methods from InputStream */
bool IsEOF() const noexcept override;

View File

@ -71,7 +71,7 @@ public:
void Visit(char *path, size_t length, size_t capacity,
ArchiveVisitor &visitor);
virtual void Visit(ArchiveVisitor &visitor) override;
void Visit(ArchiveVisitor &visitor) override;
InputStreamPtr OpenStream(const char *path,
Mutex &mutex) override;
@ -152,7 +152,7 @@ public:
SetReady();
}
~Iso9660InputStream() {
~Iso9660InputStream() override {
free(statbuf);
}

View File

@ -57,7 +57,7 @@ public:
ZzipArchiveFile(std::shared_ptr<ZzipDir> &&_dir)
:dir(std::move(_dir)) {}
virtual void Visit(ArchiveVisitor &visitor) override;
void Visit(ArchiveVisitor &visitor) override;
InputStreamPtr OpenStream(const char *path,
Mutex &mutex) override;
@ -106,7 +106,7 @@ public:
SetReady();
}
~ZzipInputStream() {
~ZzipInputStream() override {
zzip_file_close(file);
}

View File

@ -107,7 +107,7 @@ class UpdateArchiveVisitor final : public ArchiveVisitor {
Directory &_directory) noexcept
:walk(_walk), archive(_archive), directory(_directory) {}
virtual void VisitArchiveEntry(const char *path_utf8) override {
void VisitArchiveEntry(const char *path_utf8) override {
FormatDebug(update_domain,
"adding archive file: %s", path_utf8);
walk.UpdateArchiveTree(archive, directory, path_utf8);

View File

@ -69,7 +69,7 @@ protected:
/* virtual methods from class SocketMonitor */
bool OnSocketReady(unsigned flags) noexcept override;
virtual void OnIdle() noexcept override;
void OnIdle() noexcept override;
};
#endif

View File

@ -27,7 +27,7 @@ class NullFilter final : public Filter {
public:
explicit NullFilter(const AudioFormat &af):Filter(af) {}
virtual ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override {
ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override {
return src;
}
};

View File

@ -36,7 +36,7 @@ public:
:observer(_observer),
prepared_filter(std::move(_prepared_filter)) {}
~PreparedProxy() noexcept {
~PreparedProxy() noexcept override {
assert(child == nullptr);
assert(observer.proxy == this);
@ -63,7 +63,7 @@ public:
:Filter(_filter->GetOutAudioFormat()),
parent(_parent), filter(std::move(_filter)) {}
~Proxy() noexcept {
~Proxy() noexcept override {
parent.Clear(this);
}

View File

@ -38,7 +38,7 @@ public:
:Filter(audio_format), compressor(Compressor_new(0)) {
}
~NormalizeFilter() {
~NormalizeFilter() override {
Compressor_delete(compressor);
}

View File

@ -32,7 +32,7 @@
class PreparedNullFilter final : public PreparedFilter {
public:
virtual std::unique_ptr<Filter> Open(AudioFormat &af) override {
std::unique_ptr<Filter> Open(AudioFormat &af) override {
return std::make_unique<NullFilter>(af);
}
};

View File

@ -40,7 +40,7 @@ public:
~AutoGunzipReader() noexcept;
/* virtual methods from class Reader */
virtual size_t Read(void *data, size_t size) override;
size_t Read(void *data, size_t size) override;
private:
void Detect();

View File

@ -43,7 +43,7 @@ public:
const void *Peek(size_t size);
/* virtual methods from class Reader */
virtual size_t Read(void *data, size_t size) override;
size_t Read(void *data, size_t size) override;
};
#endif

View File

@ -74,7 +74,7 @@ public:
size_t _buffer_size,
size_t _resume_at) noexcept;
virtual ~AsyncInputStream() noexcept;
~AsyncInputStream() noexcept override;
auto &GetEventLoop() const noexcept {
return deferred_resume.GetEventLoop();

View File

@ -89,7 +89,7 @@ public:
Mutex &_mutex,
const SourceSpec &spec);
~AlsaInputStream() {
~AlsaInputStream() override {
BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){
MultiSocketMonitor::Reset();
defer_invalidate_sockets.Cancel();
@ -103,13 +103,13 @@ public:
protected:
/* virtual methods from AsyncInputStream */
virtual void DoResume() override {
void DoResume() override {
snd_pcm_resume(capture_handle);
InvalidateSockets();
}
virtual void DoSeek(gcc_unused offset_type new_offset) override {
void DoSeek(gcc_unused offset_type new_offset) override {
/* unreachable because seekable==false */
SeekDone();
}

View File

@ -81,7 +81,7 @@ class CdioParanoiaInputStream final : public InputStream {
SetReady();
}
~CdioParanoiaInputStream() {
~CdioParanoiaInputStream() override {
para = {};
cdio_cddap_close_no_free_cdio(drv);
cdio_destroy(cdio);

View File

@ -85,7 +85,7 @@ public:
I &&_icy,
Mutex &_mutex);
~CurlInputStream() noexcept;
~CurlInputStream() noexcept override;
CurlInputStream(const CurlInputStream &) = delete;
CurlInputStream &operator=(const CurlInputStream &) = delete;
@ -137,8 +137,8 @@ private:
void OnError(std::exception_ptr e) noexcept override;
/* virtual methods from AsyncInputStream */
virtual void DoResume() override;
virtual void DoSeek(offset_type new_offset) override;
void DoResume() override;
void DoSeek(offset_type new_offset) override;
};
/** libcurl should accept "ICY 200 OK" */

View File

@ -42,8 +42,8 @@ public:
}
protected:
virtual void Open() override;
virtual size_t ThreadRead(void *ptr, size_t size) override;
void Open() override;
size_t ThreadRead(void *ptr, size_t size) override;
void Close() noexcept override {
mmsx_close(mms);

View File

@ -47,7 +47,7 @@ public:
NFS_MAX_BUFFERED,
NFS_RESUME_AT) {}
virtual ~NfsInputStream() {
~NfsInputStream() override {
DeferClose();
}
@ -62,8 +62,8 @@ private:
protected:
/* virtual methods from AsyncInputStream */
virtual void DoResume() override;
virtual void DoSeek(offset_type new_offset) override;
void DoResume() override;
void DoSeek(offset_type new_offset) override;
private:
/* virtual methods from NfsFileReader */

View File

@ -53,7 +53,7 @@ public:
qobuz_client->AddLoginHandler(*this);
}
~QobuzInputStream() {
~QobuzInputStream() override {
qobuz_client->RemoveLoginHandler(*this);
}

View File

@ -43,7 +43,7 @@ public:
SetReady();
}
~SmbclientInputStream() {
~SmbclientInputStream() override {
const std::lock_guard<Mutex> lock(smbclient_mutex);
smbc_close(fd);
smbc_free_context(ctx, 1);

View File

@ -65,7 +65,7 @@ public:
tidal_session->AddLoginHandler(*this);
}
~TidalInputStream() {
~TidalInputStream() override {
tidal_session->RemoveLoginHandler(*this);
}

View File

@ -45,7 +45,7 @@ public:
value(nullptr) {}
protected:
virtual void StartElement(const XML_Char *name, const XML_Char **) {
void StartElement(const XML_Char *name, const XML_Char **) override {
value = nullptr;
switch (name[0]) {
@ -80,7 +80,7 @@ protected:
}
}
virtual void EndElement(const XML_Char *name) {
void EndElement(const XML_Char *name) override {
if (value != nullptr) {
trimstring(*value);
value = nullptr;
@ -90,7 +90,7 @@ protected:
}
}
virtual void CharacterData(const XML_Char *s, int len) {
void CharacterData(const XML_Char *s, int len) override {
if (value != nullptr)
value->append(s, len);
}

View File

@ -86,7 +86,7 @@ public:
:Mixer(alsa_mixer_plugin, _listener),
event_loop(_event_loop) {}
virtual ~AlsaMixer();
~AlsaMixer() override;
void Configure(const ConfigBlock &block);
void Setup();

View File

@ -36,14 +36,14 @@ public:
self(_output) {}
/* virtual methods from class Mixer */
virtual void Open() override {
void Open() override {
}
void Close() noexcept override {
}
virtual int GetVolume() override;
virtual void SetVolume(unsigned volume) override;
int GetVolume() override;
void SetVolume(unsigned volume) override;
};
static Mixer *

View File

@ -54,7 +54,7 @@ public:
{
}
virtual ~PulseMixer();
~PulseMixer() override;
void Offline();
void VolumeCallback(const pa_sink_input_info *i, int eol);

View File

@ -210,7 +210,7 @@ class AlsaOutput final
public:
AlsaOutput(EventLoop &loop, const ConfigBlock &block);
~AlsaOutput() noexcept {
~AlsaOutput() noexcept override {
/* free libasound's config cache */
snd_config_update_free_global();
}

View File

@ -53,7 +53,7 @@ class AoOutput final : AudioOutput, SafeSingleton<AoInit> {
size_t frame_size;
AoOutput(const ConfigBlock &block);
~AoOutput();
~AoOutput() override;
public:
static AudioOutput *Create(EventLoop &, const ConfigBlock &block) {

View File

@ -44,7 +44,7 @@ class FifoOutput final : AudioOutput {
public:
FifoOutput(const ConfigBlock &block);
~FifoOutput() {
~FifoOutput() override {
CloseFifo();
}

View File

@ -49,7 +49,7 @@ struct ShoutOutput final : AudioOutput {
uint8_t buffer[32768];
explicit ShoutOutput(const ConfigBlock &block);
~ShoutOutput();
~ShoutOutput() override;
static AudioOutput *Create(EventLoop &event_loop,
const ConfigBlock &block);

View File

@ -32,7 +32,7 @@ public:
MemorySongEnumerator(std::forward_list<DetachedSong> &&_songs)
:songs(std::move(_songs)) {}
virtual std::unique_ptr<DetachedSong> NextSong() override;
std::unique_ptr<DetachedSong> NextSong() override;
};
#endif

View File

@ -32,7 +32,7 @@ class CuePlaylist final : public SongEnumerator {
:tis(std::move(is)) {
}
virtual std::unique_ptr<DetachedSong> NextSong() override;
std::unique_ptr<DetachedSong> NextSong() override;
};
static std::unique_ptr<SongEnumerator>

View File

@ -55,7 +55,7 @@ public:
return nullptr;
}
virtual std::unique_ptr<DetachedSong> NextSong() override;
std::unique_ptr<DetachedSong> NextSong() override;
};
static std::unique_ptr<SongEnumerator>

View File

@ -32,7 +32,7 @@ public:
:tis(std::move(is)) {
}
virtual std::unique_ptr<DetachedSong> NextSong() override;
std::unique_ptr<DetachedSong> NextSong() override;
};
static std::unique_ptr<SongEnumerator>

View File

@ -80,7 +80,7 @@ public:
nfs_init(_loop);
}
~NfsStorage() {
~NfsStorage() override {
BlockingCall(GetEventLoop(), [this](){ Disconnect(); });
nfs_finish();
}

View File

@ -42,7 +42,7 @@ public:
SmbclientDirectoryReader(std::string &&_base, unsigned _handle)
:base(std::move(_base)), handle(_handle) {}
virtual ~SmbclientDirectoryReader();
~SmbclientDirectoryReader() override;
/* virtual methods from class StorageDirectoryReader */
const char *Read() noexcept override;
@ -58,7 +58,7 @@ public:
SmbclientStorage(const char *_base, SMBCCTX *_ctx)
:base(_base), ctx(_ctx) {}
virtual ~SmbclientStorage() {
~SmbclientStorage() override {
const std::lock_guard<Mutex> lock(smbclient_mutex);
smbc_free_context(ctx, 1);
}

View File

@ -71,7 +71,7 @@ public:
private:
/* virtual methods from class SocketMonitor */
bool OnSocketReady(unsigned flags) noexcept {
bool OnSocketReady(unsigned flags) noexcept override {
received = ToAvahiWatchEvent(flags);
callback(this, GetSocket().Get(), received, userdata);
received = AvahiWatchEvent(0);

View File

@ -68,11 +68,11 @@ InputStream::LockRead(void *, size_t)
class MyDatabaseListener final : public DatabaseListener {
public:
virtual void OnDatabaseModified() noexcept override {
void OnDatabaseModified() noexcept override {
cout << "DatabaseModified" << endl;
}
virtual void OnDatabaseSongRemoved(const char *uri) noexcept override {
void OnDatabaseSongRemoved(const char *uri) noexcept override {
cout << "SongRemoved " << uri << endl;
}
};

View File

@ -32,12 +32,12 @@
class MyNeighborListener final : public NeighborListener {
public:
/* virtual methods from class NeighborListener */
virtual void FoundNeighbor(const NeighborInfo &info) noexcept override {
void FoundNeighbor(const NeighborInfo &info) noexcept override {
printf("found '%s' (%s)\n",
info.display_name.c_str(), info.uri.c_str());
}
virtual void LostNeighbor(const NeighborInfo &info) noexcept override {
void LostNeighbor(const NeighborInfo &info) noexcept override {
printf("lost '%s' (%s)\n",
info.display_name.c_str(), info.uri.c_str());
}

View File

@ -54,7 +54,7 @@ public:
class MyArchiveVisitor final : public ArchiveVisitor {
public:
virtual void VisitArchiveEntry(const char *path_utf8) override {
void VisitArchiveEntry(const char *path_utf8) override {
printf("%s\n", path_utf8);
}
};