remove gcc_unused

[[maybe_unused]] (introduced in C++17) is standard C++.

https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-03-12 12:56:11 -07:00
parent 0afb156a5b
commit 97425d56e7
101 changed files with 226 additions and 234 deletions

View File

@@ -126,8 +126,8 @@ public:
*
* @return the job id or 0 if not implemented
*/
virtual unsigned Update(gcc_unused const char *uri_utf8,
gcc_unused bool discard) {
virtual unsigned Update([[maybe_unused]] const char *uri_utf8,
[[maybe_unused]] bool discard) {
/* not implemented: return 0 */
return 0;
}

View File

@@ -575,7 +575,7 @@ ProxyDatabase::Disconnect() noexcept
}
bool
ProxyDatabase::OnSocketReady(gcc_unused unsigned flags) noexcept
ProxyDatabase::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{
assert(connection != nullptr);

View File

@@ -70,7 +70,7 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
#ifndef ENABLE_ZLIB
gcc_unused
[[maybe_unused]]
#endif
bool _compress) noexcept
:Database(simple_db_plugin),
@@ -85,7 +85,7 @@ inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
DatabasePtr
SimpleDatabase::Create(EventLoop &, EventLoop &,
gcc_unused DatabaseListener &listener,
[[maybe_unused]] DatabaseListener &listener,
const ConfigBlock &block)
{
return std::make_unique<SimpleDatabase>(block);
@@ -248,7 +248,7 @@ SimpleDatabase::GetSong(const char *uri) const
}
void
SimpleDatabase::ReturnSong(gcc_unused const LightSong *song) const noexcept
SimpleDatabase::ReturnSong([[maybe_unused]] const LightSong *song) const noexcept
{
assert(song != nullptr);
assert(song == prefixed_light_song || song == &light_song.Get());

View File

@@ -145,7 +145,7 @@ private:
DatabasePtr
UpnpDatabase::Create(EventLoop &, EventLoop &io_event_loop,
gcc_unused DatabaseListener &listener,
[[maybe_unused]] DatabaseListener &listener,
const ConfigBlock &) noexcept
{
return std::make_unique<UpnpDatabase>(io_event_loop);

View File

@@ -31,7 +31,7 @@
#include <sys/inotify.h>
bool
InotifySource::OnSocketReady(gcc_unused unsigned flags) noexcept
InotifySource::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{
uint8_t buffer[4096];
static_assert(sizeof(buffer) >= sizeof(struct inotify_event) + NAME_MAX + 1,

View File

@@ -236,7 +236,7 @@ WatchDirectory::GetDepth() const noexcept
static void
mpd_inotify_callback(int wd, unsigned mask,
gcc_unused const char *name, gcc_unused void *ctx)
[[maybe_unused]] const char *name, [[maybe_unused]] void *ctx)
{
WatchDirectory *directory;

View File

@@ -111,10 +111,10 @@ private:
#else
bool UpdateArchiveFile(gcc_unused Directory &directory,
gcc_unused const char *name,
gcc_unused const char *suffix,
gcc_unused const StorageFileInfo &info) noexcept {
bool UpdateArchiveFile([[maybe_unused]] Directory &directory,
[[maybe_unused]] const char *name,
[[maybe_unused]] const char *suffix,
[[maybe_unused]] const StorageFileInfo &info) noexcept {
return false;
}
#endif