diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index 4249b1f2f..9e9244711 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -78,7 +78,7 @@ constexpr auto USER_CONFIG_FILE_LOCATION1 = Path::FromFS(PATH_LITERAL(".mpdconf" constexpr auto USER_CONFIG_FILE_LOCATION2 = Path::FromFS(PATH_LITERAL(".mpd/mpd.conf")); constexpr auto USER_CONFIG_FILE_LOCATION_XDG = Path::FromFS(PATH_LITERAL("mpd/mpd.conf")); #endif -} +} // namespace enum Option { OPTION_KILL, diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx index 0f2b4a71e..54d35880a 100644 --- a/src/command/StickerCommands.cxx +++ b/src/command/StickerCommands.cxx @@ -36,7 +36,7 @@ struct sticker_song_find_data { Response &r; const char *name; }; -} +} // namespace static void sticker_song_find_print_cb(const LightSong &song, const char *value, diff --git a/src/db/Helpers.cxx b/src/db/Helpers.cxx index adab44140..46d8a3683 100644 --- a/src/db/Helpers.cxx +++ b/src/db/Helpers.cxx @@ -34,7 +34,7 @@ struct StringLess { } }; -typedef std::set StringSet; +using StringSet = std::set; static void StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums, diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index 0ae2940b7..fcedd0c95 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -770,7 +770,7 @@ ReceiveEntities(struct mpd_connection *connection) noexcept std::list entities; struct mpd_entity *entity; while ((entity = mpd_recv_entity(connection)) != nullptr) - entities.push_back(ProxyEntity(entity)); + entities.emplace_back(entity); mpd_response_finish(connection); return entities; diff --git a/src/db/plugins/upnp/Directory.cxx b/src/db/plugins/upnp/Directory.cxx index de344cba3..7e2ce4347 100644 --- a/src/db/plugins/upnp/Directory.cxx +++ b/src/db/plugins/upnp/Directory.cxx @@ -30,10 +30,8 @@ #include -UPnPDirContent::~UPnPDirContent() -{ - /* this destructor exists here just so it won't get inlined */ -} +/* this destructor exists here just so it won't get inlined */ +UPnPDirContent::~UPnPDirContent() = default; gcc_pure static UPnPDirObject::ItemClass diff --git a/src/db/plugins/upnp/Object.cxx b/src/db/plugins/upnp/Object.cxx index 426d03f59..f693f5b39 100644 --- a/src/db/plugins/upnp/Object.cxx +++ b/src/db/plugins/upnp/Object.cxx @@ -19,7 +19,5 @@ #include "Object.hxx" -UPnPDirObject::~UPnPDirObject() noexcept -{ - /* this destructor exists here just so it won't get inlined */ -} +/* this destructor exists here just so it won't get inlined */ +UPnPDirObject::~UPnPDirObject() noexcept = default; diff --git a/src/encoder/plugins/OpusEncoderPlugin.cxx b/src/encoder/plugins/OpusEncoderPlugin.cxx index fcfdced7e..843fd7fb6 100644 --- a/src/encoder/plugins/OpusEncoderPlugin.cxx +++ b/src/encoder/plugins/OpusEncoderPlugin.cxx @@ -387,7 +387,7 @@ OpusEncoder::SendTag(const Tag &tag) GenerateHeaders(&tag); } -} +} // namespace const EncoderPlugin opus_encoder_plugin = { "opus", diff --git a/src/input/plugins/QobuzClient.cxx b/src/input/plugins/QobuzClient.cxx index aa61a9f0a..ff80b3648 100644 --- a/src/input/plugins/QobuzClient.cxx +++ b/src/input/plugins/QobuzClient.cxx @@ -44,7 +44,7 @@ public: } }; -} +} // namespace QobuzClient::QobuzClient(EventLoop &event_loop, const char *_base_url, diff --git a/src/lib/dbus/Glue.cxx b/src/lib/dbus/Glue.cxx index d1049de70..eaca4e45e 100644 --- a/src/lib/dbus/Glue.cxx +++ b/src/lib/dbus/Glue.cxx @@ -56,4 +56,4 @@ Glue::OnDBusClosed() noexcept // TODO: reconnect } -} +} // namespace ODBus diff --git a/src/lib/upnp/ContentDirectoryService.cxx b/src/lib/upnp/ContentDirectoryService.cxx index 539da0fa5..fa8eaace3 100644 --- a/src/lib/upnp/ContentDirectoryService.cxx +++ b/src/lib/upnp/ContentDirectoryService.cxx @@ -44,10 +44,8 @@ ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device, } } -ContentDirectoryService::~ContentDirectoryService() noexcept -{ - /* this destructor exists here just so it won't get inlined */ -} +/* this destructor exists here just so it won't get inlined */ +ContentDirectoryService::~ContentDirectoryService() noexcept = default; std::forward_list ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl) const diff --git a/src/lib/upnp/Device.cxx b/src/lib/upnp/Device.cxx index 37a39686d..d382ffdf8 100644 --- a/src/lib/upnp/Device.cxx +++ b/src/lib/upnp/Device.cxx @@ -23,10 +23,8 @@ #include -UPnPDevice::~UPnPDevice() noexcept -{ - /* this destructor exists here just so it won't get inlined */ -} +/* this destructor exists here just so it won't get inlined */ +UPnPDevice::~UPnPDevice() noexcept = default; /** * An XML parser which constructs an UPnP device object from the diff --git a/src/lib/upnp/ixmlwrap.cxx b/src/lib/upnp/ixmlwrap.cxx index 4e44f35a6..f811b07a6 100644 --- a/src/lib/upnp/ixmlwrap.cxx +++ b/src/lib/upnp/ixmlwrap.cxx @@ -38,4 +38,4 @@ getFirstElementValue(IXML_Document *doc, const char *name) noexcept return ixmlNode_getNodeValue(dnode); } -} +} // namespace ixmlwrap diff --git a/src/song/Filter.cxx b/src/song/Filter.cxx index c3c566f85..6ec9d3e7f 100644 --- a/src/song/Filter.cxx +++ b/src/song/Filter.cxx @@ -90,10 +90,8 @@ SongFilter::SongFilter(TagType tag, const char *value, bool fold_case) StringFilter(value, fold_case, fold_case, false))); } -SongFilter::~SongFilter() -{ - /* this destructor exists here just so it won't get inlined */ -} +/* this destructor exists here just so it won't get inlined */ +SongFilter::~SongFilter() = default; std::string SongFilter::ToExpression() const noexcept diff --git a/src/sticker/SongSticker.cxx b/src/sticker/SongSticker.cxx index 545728290..43a5dadbe 100644 --- a/src/sticker/SongSticker.cxx +++ b/src/sticker/SongSticker.cxx @@ -82,7 +82,7 @@ struct sticker_song_find_data { void *user_data); void *user_data; }; -} +} // namespace static void sticker_song_find_cb(const char *uri, const char *value, void *user_data)