Commit 256cfc54 authored by Max Kellermann's avatar Max Kellermann

Merge remote-tracking branches 'neheb/fwhfggwe', 'neheb/nvm2', 'neheb/nvm22',…

Merge remote-tracking branches 'neheb/fwhfggwe', 'neheb/nvm2', 'neheb/nvm22', 'neheb/bvm' and 'neheb/cl2'
...@@ -95,7 +95,7 @@ public: ...@@ -95,7 +95,7 @@ public:
constexpr double ToDoubleS() const { constexpr double ToDoubleS() const {
return double(count()) / 1000.; return double(count()) / 1000.;
}; }
constexpr bool IsZero() const { constexpr bool IsZero() const {
return count() == 0; return count() == 0;
...@@ -199,7 +199,7 @@ public: ...@@ -199,7 +199,7 @@ public:
constexpr double ToDoubleS() const { constexpr double ToDoubleS() const {
return double(count()) / 1000.; return double(count()) / 1000.;
}; }
constexpr bool IsZero() const { constexpr bool IsZero() const {
return count() == 0; return count() == 0;
......
...@@ -106,7 +106,7 @@ static constexpr OptionDef option_defs[] = { ...@@ -106,7 +106,7 @@ static constexpr OptionDef option_defs[] = {
static constexpr Domain cmdline_domain("cmdline"); static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn [[noreturn]]
static void version() static void version()
{ {
printf("Music Player Daemon " VERSION " (%s)" printf("Music Player Daemon " VERSION " (%s)"
...@@ -272,7 +272,7 @@ static void PrintOption(const OptionDef &opt) ...@@ -272,7 +272,7 @@ static void PrintOption(const OptionDef &opt)
opt.GetDescription()); opt.GetDescription());
} }
gcc_noreturn [[noreturn]]
static void help() static void help()
{ {
printf("Usage:\n" printf("Usage:\n"
......
...@@ -150,13 +150,13 @@ Instance::OnDatabaseSongRemoved(const char *uri) noexcept ...@@ -150,13 +150,13 @@ Instance::OnDatabaseSongRemoved(const char *uri) noexcept
#ifdef ENABLE_NEIGHBOR_PLUGINS #ifdef ENABLE_NEIGHBOR_PLUGINS
void void
Instance::FoundNeighbor(gcc_unused const NeighborInfo &info) noexcept Instance::FoundNeighbor([[maybe_unused]] const NeighborInfo &info) noexcept
{ {
EmitIdle(IDLE_NEIGHBOR); EmitIdle(IDLE_NEIGHBOR);
} }
void void
Instance::LostNeighbor(gcc_unused const NeighborInfo &info) noexcept Instance::LostNeighbor([[maybe_unused]] const NeighborInfo &info) noexcept
{ {
EmitIdle(IDLE_NEIGHBOR); EmitIdle(IDLE_NEIGHBOR);
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#define LOG_DATE_BUF_SIZE 16 #define LOG_DATE_BUF_SIZE 16
#define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1) #define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1)
gcc_unused [[maybe_unused]]
static constexpr Domain log_domain("log"); static constexpr Domain log_domain("log");
#ifndef ANDROID #ifndef ANDROID
......
...@@ -216,8 +216,8 @@ static constexpr unsigned num_commands = std::size(commands); ...@@ -216,8 +216,8 @@ static constexpr unsigned num_commands = std::size(commands);
gcc_pure gcc_pure
static bool static bool
command_available(gcc_unused const Partition &partition, command_available([[maybe_unused]] const Partition &partition,
gcc_unused const struct command *cmd) noexcept [[maybe_unused]] const struct command *cmd) noexcept
{ {
#ifdef ENABLE_SQLITE #ifdef ENABLE_SQLITE
if (StringIsEqual(cmd->cmd, "sticker")) if (StringIsEqual(cmd->cmd, "sticker"))
...@@ -272,14 +272,14 @@ PrintUnavailableCommands(Response &r, unsigned permission) noexcept ...@@ -272,14 +272,14 @@ PrintUnavailableCommands(Response &r, unsigned permission) noexcept
/* don't be fooled, this is the command handler for "commands" command */ /* don't be fooled, this is the command handler for "commands" command */
static CommandResult static CommandResult
handle_commands(Client &client, gcc_unused Request request, Response &r) handle_commands(Client &client, [[maybe_unused]] Request request, Response &r)
{ {
return PrintAvailableCommands(r, client.GetPartition(), return PrintAvailableCommands(r, client.GetPartition(),
client.GetPermission()); client.GetPermission());
} }
static CommandResult static CommandResult
handle_not_commands(Client &client, gcc_unused Request request, Response &r) handle_not_commands(Client &client, [[maybe_unused]] Request request, Response &r)
{ {
return PrintUnavailableCommands(r, client.GetPermission()); return PrintUnavailableCommands(r, client.GetPermission());
} }
......
...@@ -27,15 +27,15 @@ ...@@ -27,15 +27,15 @@
#include "util/StringAPI.hxx" #include "util/StringAPI.hxx"
CommandResult CommandResult
handle_close(gcc_unused Client &client, gcc_unused Request args, handle_close([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
return CommandResult::FINISH; return CommandResult::FINISH;
} }
CommandResult CommandResult
handle_ping(gcc_unused Client &client, gcc_unused Request args, handle_ping([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
return CommandResult::OK; return CommandResult::OK;
} }
......
...@@ -72,7 +72,7 @@ handle_unsubscribe(Client &client, Request args, Response &r) ...@@ -72,7 +72,7 @@ handle_unsubscribe(Client &client, Request args, Response &r)
} }
CommandResult CommandResult
handle_channels(Client &client, gcc_unused Request args, Response &r) handle_channels(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
assert(args.empty()); assert(args.empty());
...@@ -92,7 +92,7 @@ handle_channels(Client &client, gcc_unused Request args, Response &r) ...@@ -92,7 +92,7 @@ handle_channels(Client &client, gcc_unused Request args, Response &r)
CommandResult CommandResult
handle_read_messages(Client &client, handle_read_messages(Client &client,
gcc_unused Request args, Response &r) [[maybe_unused]] Request args, Response &r)
{ {
assert(args.empty()); assert(args.empty());
......
...@@ -34,7 +34,7 @@ neighbor_commands_available(const Instance &instance) noexcept ...@@ -34,7 +34,7 @@ neighbor_commands_available(const Instance &instance) noexcept
} }
CommandResult CommandResult
handle_listneighbors(Client &client, gcc_unused Request args, Response &r) handle_listneighbors(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
const NeighborGlue *const neighbors = const NeighborGlue *const neighbors =
client.GetInstance().neighbors.get(); client.GetInstance().neighbors.get();
......
...@@ -69,7 +69,7 @@ print_spl_list(Response &r, const PlaylistVector &list) ...@@ -69,7 +69,7 @@ print_spl_list(Response &r, const PlaylistVector &list)
} }
CommandResult CommandResult
handle_urlhandlers(Client &client, gcc_unused Request args, Response &r) handle_urlhandlers(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
if (client.IsLocal()) if (client.IsLocal())
r.Format("handler: file://\n"); r.Format("handler: file://\n");
...@@ -78,7 +78,7 @@ handle_urlhandlers(Client &client, gcc_unused Request args, Response &r) ...@@ -78,7 +78,7 @@ handle_urlhandlers(Client &client, gcc_unused Request args, Response &r)
} }
CommandResult CommandResult
handle_decoders(gcc_unused Client &client, gcc_unused Request args, handle_decoders([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
Response &r) Response &r)
{ {
decoder_list_print(r); decoder_list_print(r);
...@@ -86,8 +86,8 @@ handle_decoders(gcc_unused Client &client, gcc_unused Request args, ...@@ -86,8 +86,8 @@ handle_decoders(gcc_unused Client &client, gcc_unused Request args,
} }
CommandResult CommandResult
handle_kill(gcc_unused Client &client, gcc_unused Request request, handle_kill([[maybe_unused]] Client &client, [[maybe_unused]] Request request,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
return CommandResult::KILL; return CommandResult::KILL;
} }
...@@ -307,7 +307,7 @@ handle_update(Client &client, Request args, Response &r, bool discard) ...@@ -307,7 +307,7 @@ handle_update(Client &client, Request args, Response &r, bool discard)
} }
CommandResult CommandResult
handle_update(Client &client, Request args, gcc_unused Response &r) handle_update(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
return handle_update(client, args, r, false); return handle_update(client, args, r, false);
} }
...@@ -360,14 +360,14 @@ handle_volume(Client &client, Request args, Response &r) ...@@ -360,14 +360,14 @@ handle_volume(Client &client, Request args, Response &r)
} }
CommandResult CommandResult
handle_stats(Client &client, gcc_unused Request args, Response &r) handle_stats(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
stats_print(r, client.GetPartition()); stats_print(r, client.GetPartition());
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_config(Client &client, gcc_unused Request args, Response &r) handle_config(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
if (!client.IsLocal()) { if (!client.IsLocal()) {
r.Error(ACK_ERROR_PERMISSION, r.Error(ACK_ERROR_PERMISSION,
......
...@@ -118,7 +118,7 @@ handle_outputset(Client &client, Request request, Response &response) ...@@ -118,7 +118,7 @@ handle_outputset(Client &client, Request request, Response &response)
} }
CommandResult CommandResult
handle_devices(Client &client, gcc_unused Request args, Response &r) handle_devices(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
assert(args.empty()); assert(args.empty());
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#define COMMAND_STATUS_UPDATING_DB "updating_db" #define COMMAND_STATUS_UPDATING_DB "updating_db"
CommandResult CommandResult
handle_play(Client &client, Request args, gcc_unused Response &r) handle_play(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
int song = args.ParseOptional(0, -1); int song = args.ParseOptional(0, -1);
...@@ -69,7 +69,7 @@ handle_play(Client &client, Request args, gcc_unused Response &r) ...@@ -69,7 +69,7 @@ handle_play(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_playid(Client &client, Request args, gcc_unused Response &r) handle_playid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
int id = args.ParseOptional(0, -1); int id = args.ParseOptional(0, -1);
...@@ -78,21 +78,21 @@ handle_playid(Client &client, Request args, gcc_unused Response &r) ...@@ -78,21 +78,21 @@ handle_playid(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_stop(Client &client, gcc_unused Request args, gcc_unused Response &r) handle_stop(Client &client, [[maybe_unused]] Request args, [[maybe_unused]] Response &r)
{ {
client.GetPartition().Stop(); client.GetPartition().Stop();
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_currentsong(Client &client, gcc_unused Request args, Response &r) handle_currentsong(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
playlist_print_current(r, client.GetPlaylist()); playlist_print_current(r, client.GetPlaylist());
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_pause(Client &client, Request args, gcc_unused Response &r) handle_pause(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
auto &pc = client.GetPlayerControl(); auto &pc = client.GetPlayerControl();
...@@ -106,7 +106,7 @@ handle_pause(Client &client, Request args, gcc_unused Response &r) ...@@ -106,7 +106,7 @@ handle_pause(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_status(Client &client, gcc_unused Request args, Response &r) handle_status(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
auto &partition = client.GetPartition(); auto &partition = client.GetPartition();
auto &pc = partition.pc; auto &pc = partition.pc;
...@@ -216,7 +216,7 @@ handle_status(Client &client, gcc_unused Request args, Response &r) ...@@ -216,7 +216,7 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
} }
CommandResult CommandResult
handle_next(Client &client, gcc_unused Request args, gcc_unused Response &r) handle_next(Client &client, [[maybe_unused]] Request args, [[maybe_unused]] Response &r)
{ {
playlist &playlist = client.GetPlaylist(); playlist &playlist = client.GetPlaylist();
...@@ -234,15 +234,15 @@ handle_next(Client &client, gcc_unused Request args, gcc_unused Response &r) ...@@ -234,15 +234,15 @@ handle_next(Client &client, gcc_unused Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_previous(Client &client, gcc_unused Request args, handle_previous(Client &client, [[maybe_unused]] Request args,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
client.GetPartition().PlayPrevious(); client.GetPartition().PlayPrevious();
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_repeat(Client &client, Request args, gcc_unused Response &r) handle_repeat(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
bool status = args.ParseBool(0); bool status = args.ParseBool(0);
client.GetPartition().SetRepeat(status); client.GetPartition().SetRepeat(status);
...@@ -250,7 +250,7 @@ handle_repeat(Client &client, Request args, gcc_unused Response &r) ...@@ -250,7 +250,7 @@ handle_repeat(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_single(Client &client, Request args, gcc_unused Response &r) handle_single(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
auto new_mode = SingleFromString(args.front()); auto new_mode = SingleFromString(args.front());
client.GetPartition().SetSingle(new_mode); client.GetPartition().SetSingle(new_mode);
...@@ -258,7 +258,7 @@ handle_single(Client &client, Request args, gcc_unused Response &r) ...@@ -258,7 +258,7 @@ handle_single(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_consume(Client &client, Request args, gcc_unused Response &r) handle_consume(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
bool status = args.ParseBool(0); bool status = args.ParseBool(0);
client.GetPartition().SetConsume(status); client.GetPartition().SetConsume(status);
...@@ -266,7 +266,7 @@ handle_consume(Client &client, Request args, gcc_unused Response &r) ...@@ -266,7 +266,7 @@ handle_consume(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_random(Client &client, Request args, gcc_unused Response &r) handle_random(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
bool status = args.ParseBool(0); bool status = args.ParseBool(0);
auto &partition = client.GetPartition(); auto &partition = client.GetPartition();
...@@ -276,15 +276,15 @@ handle_random(Client &client, Request args, gcc_unused Response &r) ...@@ -276,15 +276,15 @@ handle_random(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_clearerror(Client &client, gcc_unused Request args, handle_clearerror(Client &client, [[maybe_unused]] Request args,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
client.GetPlayerControl().LockClearError(); client.GetPlayerControl().LockClearError();
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_seek(Client &client, Request args, gcc_unused Response &r) handle_seek(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned song = args.ParseUnsigned(0); unsigned song = args.ParseUnsigned(0);
SongTime seek_time = args.ParseSongTime(1); SongTime seek_time = args.ParseSongTime(1);
...@@ -294,7 +294,7 @@ handle_seek(Client &client, Request args, gcc_unused Response &r) ...@@ -294,7 +294,7 @@ handle_seek(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_seekid(Client &client, Request args, gcc_unused Response &r) handle_seekid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned id = args.ParseUnsigned(0); unsigned id = args.ParseUnsigned(0);
SongTime seek_time = args.ParseSongTime(1); SongTime seek_time = args.ParseSongTime(1);
...@@ -304,7 +304,7 @@ handle_seekid(Client &client, Request args, gcc_unused Response &r) ...@@ -304,7 +304,7 @@ handle_seekid(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_seekcur(Client &client, Request args, gcc_unused Response &r) handle_seekcur(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
const char *p = args.front(); const char *p = args.front();
bool relative = *p == '+' || *p == '-'; bool relative = *p == '+' || *p == '-';
...@@ -315,7 +315,7 @@ handle_seekcur(Client &client, Request args, gcc_unused Response &r) ...@@ -315,7 +315,7 @@ handle_seekcur(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_crossfade(Client &client, Request args, gcc_unused Response &r) handle_crossfade(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
FloatDuration duration{args.ParseUnsigned(0)}; FloatDuration duration{args.ParseUnsigned(0)};
client.GetPlayerControl().SetCrossFade(duration); client.GetPlayerControl().SetCrossFade(duration);
...@@ -323,7 +323,7 @@ handle_crossfade(Client &client, Request args, gcc_unused Response &r) ...@@ -323,7 +323,7 @@ handle_crossfade(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_mixrampdb(Client &client, Request args, gcc_unused Response &r) handle_mixrampdb(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
float db = args.ParseFloat(0); float db = args.ParseFloat(0);
client.GetPlayerControl().SetMixRampDb(db); client.GetPlayerControl().SetMixRampDb(db);
...@@ -331,7 +331,7 @@ handle_mixrampdb(Client &client, Request args, gcc_unused Response &r) ...@@ -331,7 +331,7 @@ handle_mixrampdb(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_mixrampdelay(Client &client, Request args, gcc_unused Response &r) handle_mixrampdelay(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
FloatDuration delay_secs{args.ParseFloat(0)}; FloatDuration delay_secs{args.ParseFloat(0)};
client.GetPlayerControl().SetMixRampDelay(delay_secs); client.GetPlayerControl().SetMixRampDelay(delay_secs);
...@@ -349,7 +349,7 @@ handle_replay_gain_mode(Client &client, Request args, Response &) ...@@ -349,7 +349,7 @@ handle_replay_gain_mode(Client &client, Request args, Response &)
} }
CommandResult CommandResult
handle_replay_gain_status(Client &client, gcc_unused Request args, handle_replay_gain_status(Client &client, [[maybe_unused]] Request args,
Response &r) Response &r)
{ {
r.Format("replay_gain_mode: %s\n", r.Format("replay_gain_mode: %s\n",
......
...@@ -60,14 +60,14 @@ print_spl_list(Response &r, const PlaylistVector &list) ...@@ -60,14 +60,14 @@ print_spl_list(Response &r, const PlaylistVector &list)
} }
CommandResult CommandResult
handle_save(Client &client, Request args, gcc_unused Response &r) handle_save(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
spl_save_playlist(args.front(), client.GetPlaylist()); spl_save_playlist(args.front(), client.GetPlaylist());
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_load(Client &client, Request args, gcc_unused Response &r) handle_load(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
const auto uri = LocateUri(UriPluginKind::PLAYLIST, args.front(), const auto uri = LocateUri(UriPluginKind::PLAYLIST, args.front(),
&client &client
...@@ -132,7 +132,7 @@ handle_listplaylistinfo(Client &client, Request args, Response &r) ...@@ -132,7 +132,7 @@ handle_listplaylistinfo(Client &client, Request args, Response &r)
} }
CommandResult CommandResult
handle_rm(gcc_unused Client &client, Request args, gcc_unused Response &r) handle_rm([[maybe_unused]] Client &client, Request args, [[maybe_unused]] Response &r)
{ {
const char *const name = args.front(); const char *const name = args.front();
...@@ -141,7 +141,7 @@ handle_rm(gcc_unused Client &client, Request args, gcc_unused Response &r) ...@@ -141,7 +141,7 @@ handle_rm(gcc_unused Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_rename(gcc_unused Client &client, Request args, gcc_unused Response &r) handle_rename([[maybe_unused]] Client &client, Request args, [[maybe_unused]] Response &r)
{ {
const char *const old_name = args[0]; const char *const old_name = args[0];
const char *const new_name = args[1]; const char *const new_name = args[1];
...@@ -151,8 +151,8 @@ handle_rename(gcc_unused Client &client, Request args, gcc_unused Response &r) ...@@ -151,8 +151,8 @@ handle_rename(gcc_unused Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_playlistdelete(gcc_unused Client &client, handle_playlistdelete([[maybe_unused]] Client &client,
Request args, gcc_unused Response &r) Request args, [[maybe_unused]] Response &r)
{ {
const char *const name = args[0]; const char *const name = args[0];
unsigned from = args.ParseUnsigned(1); unsigned from = args.ParseUnsigned(1);
...@@ -162,8 +162,8 @@ handle_playlistdelete(gcc_unused Client &client, ...@@ -162,8 +162,8 @@ handle_playlistdelete(gcc_unused Client &client,
} }
CommandResult CommandResult
handle_playlistmove(gcc_unused Client &client, handle_playlistmove([[maybe_unused]] Client &client,
Request args, gcc_unused Response &r) Request args, [[maybe_unused]] Response &r)
{ {
const char *const name = args.front(); const char *const name = args.front();
unsigned from = args.ParseUnsigned(1); unsigned from = args.ParseUnsigned(1);
...@@ -174,8 +174,8 @@ handle_playlistmove(gcc_unused Client &client, ...@@ -174,8 +174,8 @@ handle_playlistmove(gcc_unused Client &client,
} }
CommandResult CommandResult
handle_playlistclear(gcc_unused Client &client, handle_playlistclear([[maybe_unused]] Client &client,
Request args, gcc_unused Response &r) Request args, [[maybe_unused]] Response &r)
{ {
const char *const name = args.front(); const char *const name = args.front();
...@@ -184,7 +184,7 @@ handle_playlistclear(gcc_unused Client &client, ...@@ -184,7 +184,7 @@ handle_playlistclear(gcc_unused Client &client,
} }
CommandResult CommandResult
handle_playlistadd(Client &client, Request args, gcc_unused Response &r) handle_playlistadd(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
const char *const playlist = args[0]; const char *const playlist = args[0];
const char *const uri = args[1]; const char *const uri = args[1];
...@@ -209,7 +209,7 @@ handle_playlistadd(Client &client, Request args, gcc_unused Response &r) ...@@ -209,7 +209,7 @@ handle_playlistadd(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_listplaylists(gcc_unused Client &client, gcc_unused Request args, handle_listplaylists([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
Response &r) Response &r)
{ {
print_spl_list(r, ListPlaylistFiles()); print_spl_list(r, ListPlaylistFiles());
......
...@@ -51,7 +51,7 @@ AddUri(Client &client, const LocatedUri &uri) ...@@ -51,7 +51,7 @@ AddUri(Client &client, const LocatedUri &uri)
static CommandResult static CommandResult
AddDatabaseSelection(Client &client, const char *uri, AddDatabaseSelection(Client &client, const char *uri,
gcc_unused Response &r) [[maybe_unused]] Response &r)
{ {
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
auto &partition = client.GetPartition(); auto &partition = client.GetPartition();
...@@ -179,7 +179,7 @@ handle_rangeid(Client &client, Request args, Response &r) ...@@ -179,7 +179,7 @@ handle_rangeid(Client &client, Request args, Response &r)
} }
CommandResult CommandResult
handle_delete(Client &client, Request args, gcc_unused Response &r) handle_delete(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
RangeArg range = args.ParseRange(0); RangeArg range = args.ParseRange(0);
client.GetPartition().DeleteRange(range.start, range.end); client.GetPartition().DeleteRange(range.start, range.end);
...@@ -187,7 +187,7 @@ handle_delete(Client &client, Request args, gcc_unused Response &r) ...@@ -187,7 +187,7 @@ handle_delete(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_deleteid(Client &client, Request args, gcc_unused Response &r) handle_deleteid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned id = args.ParseUnsigned(0); unsigned id = args.ParseUnsigned(0);
client.GetPartition().DeleteId(id); client.GetPartition().DeleteId(id);
...@@ -195,14 +195,14 @@ handle_deleteid(Client &client, Request args, gcc_unused Response &r) ...@@ -195,14 +195,14 @@ handle_deleteid(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_playlist(Client &client, gcc_unused Request args, Response &r) handle_playlist(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
playlist_print_uris(r, client.GetPlaylist()); playlist_print_uris(r, client.GetPlaylist());
return CommandResult::OK; return CommandResult::OK;
} }
CommandResult CommandResult
handle_shuffle(gcc_unused Client &client, Request args, gcc_unused Response &r) handle_shuffle([[maybe_unused]] Client &client, Request args, [[maybe_unused]] Response &r)
{ {
RangeArg range = args.ParseOptional(0, RangeArg::All()); RangeArg range = args.ParseOptional(0, RangeArg::All());
client.GetPartition().Shuffle(range.start, range.end); client.GetPartition().Shuffle(range.start, range.end);
...@@ -210,7 +210,7 @@ handle_shuffle(gcc_unused Client &client, Request args, gcc_unused Response &r) ...@@ -210,7 +210,7 @@ handle_shuffle(gcc_unused Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_clear(Client &client, gcc_unused Request args, gcc_unused Response &r) handle_clear(Client &client, [[maybe_unused]] Request args, [[maybe_unused]] Response &r)
{ {
client.GetPartition().ClearQueue(); client.GetPartition().ClearQueue();
return CommandResult::OK; return CommandResult::OK;
...@@ -291,7 +291,7 @@ handle_playlistsearch(Client &client, Request args, Response &r) ...@@ -291,7 +291,7 @@ handle_playlistsearch(Client &client, Request args, Response &r)
} }
CommandResult CommandResult
handle_prio(Client &client, Request args, gcc_unused Response &r) handle_prio(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned priority = args.ParseUnsigned(0, 0xff); unsigned priority = args.ParseUnsigned(0, 0xff);
args.shift(); args.shift();
...@@ -307,7 +307,7 @@ handle_prio(Client &client, Request args, gcc_unused Response &r) ...@@ -307,7 +307,7 @@ handle_prio(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_prioid(Client &client, Request args, gcc_unused Response &r) handle_prioid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned priority = args.ParseUnsigned(0, 0xff); unsigned priority = args.ParseUnsigned(0, 0xff);
args.shift(); args.shift();
...@@ -323,7 +323,7 @@ handle_prioid(Client &client, Request args, gcc_unused Response &r) ...@@ -323,7 +323,7 @@ handle_prioid(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_move(Client &client, Request args, gcc_unused Response &r) handle_move(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
RangeArg range = args.ParseRange(0); RangeArg range = args.ParseRange(0);
int to = args.ParseInt(1); int to = args.ParseInt(1);
...@@ -332,7 +332,7 @@ handle_move(Client &client, Request args, gcc_unused Response &r) ...@@ -332,7 +332,7 @@ handle_move(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_moveid(Client &client, Request args, gcc_unused Response &r) handle_moveid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned id = args.ParseUnsigned(0); unsigned id = args.ParseUnsigned(0);
int to = args.ParseInt(1); int to = args.ParseInt(1);
...@@ -341,7 +341,7 @@ handle_moveid(Client &client, Request args, gcc_unused Response &r) ...@@ -341,7 +341,7 @@ handle_moveid(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_swap(Client &client, Request args, gcc_unused Response &r) handle_swap(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned song1 = args.ParseUnsigned(0); unsigned song1 = args.ParseUnsigned(0);
unsigned song2 = args.ParseUnsigned(1); unsigned song2 = args.ParseUnsigned(1);
...@@ -350,7 +350,7 @@ handle_swap(Client &client, Request args, gcc_unused Response &r) ...@@ -350,7 +350,7 @@ handle_swap(Client &client, Request args, gcc_unused Response &r)
} }
CommandResult CommandResult
handle_swapid(Client &client, Request args, gcc_unused Response &r) handle_swapid(Client &client, Request args, [[maybe_unused]] Response &r)
{ {
unsigned id1 = args.ParseUnsigned(0); unsigned id1 = args.ParseUnsigned(0);
unsigned id2 = args.ParseUnsigned(1); unsigned id2 = args.ParseUnsigned(1);
......
...@@ -143,7 +143,7 @@ print_storage_uri(Client &client, Response &r, const Storage &storage) ...@@ -143,7 +143,7 @@ print_storage_uri(Client &client, Response &r, const Storage &storage)
} }
CommandResult CommandResult
handle_listmounts(Client &client, gcc_unused Request args, Response &r) handle_listmounts(Client &client, [[maybe_unused]] Request args, Response &r)
{ {
Storage *_composite = client.GetInstance().storage; Storage *_composite = client.GetInstance().storage;
if (_composite == nullptr) { if (_composite == nullptr) {
......
...@@ -126,8 +126,8 @@ public: ...@@ -126,8 +126,8 @@ public:
* *
* @return the job id or 0 if not implemented * @return the job id or 0 if not implemented
*/ */
virtual unsigned Update(gcc_unused const char *uri_utf8, virtual unsigned Update([[maybe_unused]] const char *uri_utf8,
gcc_unused bool discard) { [[maybe_unused]] bool discard) {
/* not implemented: return 0 */ /* not implemented: return 0 */
return 0; return 0;
} }
......
...@@ -277,6 +277,7 @@ Convert(TagType tag_type) noexcept ...@@ -277,6 +277,7 @@ Convert(TagType tag_type) noexcept
return MPD_TAG_COUNT; return MPD_TAG_COUNT;
} }
[[noreturn]]
static void static void
ThrowError(struct mpd_connection *connection) ThrowError(struct mpd_connection *connection)
{ {
...@@ -574,7 +575,7 @@ ProxyDatabase::Disconnect() noexcept ...@@ -574,7 +575,7 @@ ProxyDatabase::Disconnect() noexcept
} }
bool bool
ProxyDatabase::OnSocketReady(gcc_unused unsigned flags) noexcept ProxyDatabase::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{ {
assert(connection != nullptr); assert(connection != nullptr);
......
...@@ -70,7 +70,7 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block) ...@@ -70,7 +70,7 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path, inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
#ifndef ENABLE_ZLIB #ifndef ENABLE_ZLIB
gcc_unused [[maybe_unused]]
#endif #endif
bool _compress) noexcept bool _compress) noexcept
:Database(simple_db_plugin), :Database(simple_db_plugin),
...@@ -85,7 +85,7 @@ inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path, ...@@ -85,7 +85,7 @@ inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
DatabasePtr DatabasePtr
SimpleDatabase::Create(EventLoop &, EventLoop &, SimpleDatabase::Create(EventLoop &, EventLoop &,
gcc_unused DatabaseListener &listener, [[maybe_unused]] DatabaseListener &listener,
const ConfigBlock &block) const ConfigBlock &block)
{ {
return std::make_unique<SimpleDatabase>(block); return std::make_unique<SimpleDatabase>(block);
...@@ -248,7 +248,7 @@ SimpleDatabase::GetSong(const char *uri) const ...@@ -248,7 +248,7 @@ SimpleDatabase::GetSong(const char *uri) const
} }
void void
SimpleDatabase::ReturnSong(gcc_unused const LightSong *song) const noexcept SimpleDatabase::ReturnSong([[maybe_unused]] const LightSong *song) const noexcept
{ {
assert(song != nullptr); assert(song != nullptr);
assert(song == prefixed_light_song || song == &light_song.Get()); assert(song == prefixed_light_song || song == &light_song.Get());
......
...@@ -145,7 +145,7 @@ private: ...@@ -145,7 +145,7 @@ private:
DatabasePtr DatabasePtr
UpnpDatabase::Create(EventLoop &, EventLoop &io_event_loop, UpnpDatabase::Create(EventLoop &, EventLoop &io_event_loop,
gcc_unused DatabaseListener &listener, [[maybe_unused]] DatabaseListener &listener,
const ConfigBlock &) noexcept const ConfigBlock &) noexcept
{ {
return std::make_unique<UpnpDatabase>(io_event_loop); return std::make_unique<UpnpDatabase>(io_event_loop);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <sys/inotify.h> #include <sys/inotify.h>
bool bool
InotifySource::OnSocketReady(gcc_unused unsigned flags) noexcept InotifySource::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{ {
uint8_t buffer[4096]; uint8_t buffer[4096];
static_assert(sizeof(buffer) >= sizeof(struct inotify_event) + NAME_MAX + 1, static_assert(sizeof(buffer) >= sizeof(struct inotify_event) + NAME_MAX + 1,
......
...@@ -236,7 +236,7 @@ WatchDirectory::GetDepth() const noexcept ...@@ -236,7 +236,7 @@ WatchDirectory::GetDepth() const noexcept
static void static void
mpd_inotify_callback(int wd, unsigned mask, 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; WatchDirectory *directory;
......
...@@ -111,10 +111,10 @@ private: ...@@ -111,10 +111,10 @@ private:
#else #else
bool UpdateArchiveFile(gcc_unused Directory &directory, bool UpdateArchiveFile([[maybe_unused]] Directory &directory,
gcc_unused const char *name, [[maybe_unused]] const char *name,
gcc_unused const char *suffix, [[maybe_unused]] const char *suffix,
gcc_unused const StorageFileInfo &info) noexcept { [[maybe_unused]] const StorageFileInfo &info) noexcept {
return false; return false;
} }
#endif #endif
......
...@@ -53,7 +53,7 @@ static void flacPrintErroredState(FLAC__StreamDecoderState state) ...@@ -53,7 +53,7 @@ static void flacPrintErroredState(FLAC__StreamDecoderState state)
LogError(flac_domain, FLAC__StreamDecoderStateString[state]); LogError(flac_domain, FLAC__StreamDecoderStateString[state]);
} }
static void flacMetadata(gcc_unused const FLAC__StreamDecoder * dec, static void flacMetadata([[maybe_unused]] const FLAC__StreamDecoder * dec,
const FLAC__StreamMetadata * block, void *vdata) const FLAC__StreamMetadata * block, void *vdata)
{ {
auto &fd = *(FlacDecoder *)vdata; auto &fd = *(FlacDecoder *)vdata;
...@@ -307,7 +307,7 @@ flac_decode(DecoderClient &client, InputStream &input_stream) ...@@ -307,7 +307,7 @@ flac_decode(DecoderClient &client, InputStream &input_stream)
} }
static bool static bool
oggflac_init(gcc_unused const ConfigBlock &block) oggflac_init([[maybe_unused]] const ConfigBlock &block)
{ {
return !!FLAC_API_SUPPORTS_OGG_FLAC; return !!FLAC_API_SUPPORTS_OGG_FLAC;
} }
......
...@@ -98,7 +98,7 @@ FlacInput::Error(FLAC__StreamDecoderErrorStatus status) ...@@ -98,7 +98,7 @@ FlacInput::Error(FLAC__StreamDecoderErrorStatus status)
} }
FLAC__StreamDecoderReadStatus FLAC__StreamDecoderReadStatus
FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Read([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
FLAC__byte buffer[], size_t *bytes, FLAC__byte buffer[], size_t *bytes,
void *client_data) void *client_data)
{ {
...@@ -108,7 +108,7 @@ FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder, ...@@ -108,7 +108,7 @@ FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder,
} }
FLAC__StreamDecoderSeekStatus FLAC__StreamDecoderSeekStatus
FlacInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Seek([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 absolute_byte_offset, void *client_data) FLAC__uint64 absolute_byte_offset, void *client_data)
{ {
auto *i = (FlacInput *)client_data; auto *i = (FlacInput *)client_data;
...@@ -117,7 +117,7 @@ FlacInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder, ...@@ -117,7 +117,7 @@ FlacInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder,
} }
FLAC__StreamDecoderTellStatus FLAC__StreamDecoderTellStatus
FlacInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Tell([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 *absolute_byte_offset, void *client_data) FLAC__uint64 *absolute_byte_offset, void *client_data)
{ {
auto *i = (FlacInput *)client_data; auto *i = (FlacInput *)client_data;
...@@ -126,7 +126,7 @@ FlacInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder, ...@@ -126,7 +126,7 @@ FlacInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder,
} }
FLAC__StreamDecoderLengthStatus FLAC__StreamDecoderLengthStatus
FlacInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Length([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 *stream_length, void *client_data) FLAC__uint64 *stream_length, void *client_data)
{ {
auto *i = (FlacInput *)client_data; auto *i = (FlacInput *)client_data;
...@@ -135,7 +135,7 @@ FlacInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder, ...@@ -135,7 +135,7 @@ FlacInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder,
} }
FLAC__bool FLAC__bool
FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Eof([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
void *client_data) void *client_data)
{ {
auto *i = (FlacInput *)client_data; auto *i = (FlacInput *)client_data;
...@@ -144,7 +144,7 @@ FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder, ...@@ -144,7 +144,7 @@ FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder,
} }
void void
FlacInput::Error(gcc_unused const FLAC__StreamDecoder *decoder, FlacInput::Error([[maybe_unused]] const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status, void *client_data) FLAC__StreamDecoderErrorStatus status, void *client_data)
{ {
auto *i = (FlacInput *)client_data; auto *i = (FlacInput *)client_data;
......
...@@ -196,7 +196,7 @@ fluidsynth_file_decode(DecoderClient &client, Path path_fs) ...@@ -196,7 +196,7 @@ fluidsynth_file_decode(DecoderClient &client, Path path_fs)
static bool static bool
fluidsynth_scan_file(Path path_fs, fluidsynth_scan_file(Path path_fs,
gcc_unused TagHandler &handler) noexcept [[maybe_unused]] TagHandler &handler) noexcept
{ {
return fluid_is_midifile(path_fs.c_str()); return fluid_is_midifile(path_fs.c_str());
} }
......
...@@ -62,7 +62,7 @@ static int gme_accuracy; ...@@ -62,7 +62,7 @@ static int gme_accuracy;
#endif #endif
static bool static bool
gme_plugin_init(gcc_unused const ConfigBlock &block) gme_plugin_init([[maybe_unused]] const ConfigBlock &block)
{ {
#if GME_VERSION >= 0x000600 #if GME_VERSION >= 0x000600
auto accuracy = block.GetBlockParam("accuracy"); auto accuracy = block.GetBlockParam("accuracy");
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
static constexpr Domain mpg123_domain("mpg123"); static constexpr Domain mpg123_domain("mpg123");
static bool static bool
mpd_mpg123_init(gcc_unused const ConfigBlock &block) mpd_mpg123_init([[maybe_unused]] const ConfigBlock &block)
{ {
mpg123_init(); mpg123_init();
......
...@@ -64,7 +64,7 @@ IsOpusTags(const ogg_packet &packet) noexcept ...@@ -64,7 +64,7 @@ IsOpusTags(const ogg_packet &packet) noexcept
} }
bool bool
mpd_opus_init(gcc_unused const ConfigBlock &block) mpd_opus_init([[maybe_unused]] const ConfigBlock &block)
{ {
LogDebug(opus_domain, opus_get_version_string()); LogDebug(opus_domain, opus_get_version_string());
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
static constexpr Domain sndfile_domain("sndfile"); static constexpr Domain sndfile_domain("sndfile");
static bool static bool
sndfile_init(gcc_unused const ConfigBlock &block) sndfile_init([[maybe_unused]] const ConfigBlock &block)
{ {
LogDebug(sndfile_domain, sf_version_string()); LogDebug(sndfile_domain, sf_version_string());
return true; return true;
...@@ -109,9 +109,9 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data) ...@@ -109,9 +109,9 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
} }
static sf_count_t static sf_count_t
sndfile_vio_write(gcc_unused const void *ptr, sndfile_vio_write([[maybe_unused]] const void *ptr,
gcc_unused sf_count_t count, [[maybe_unused]] sf_count_t count,
gcc_unused void *user_data) [[maybe_unused]] void *user_data)
{ {
/* no writing! */ /* no writing! */
return -1; return -1;
......
...@@ -311,7 +311,7 @@ VorbisDecoder::OnOggEnd() ...@@ -311,7 +311,7 @@ VorbisDecoder::OnOggEnd()
/* public */ /* public */
static bool static bool
vorbis_init(gcc_unused const ConfigBlock &block) vorbis_init([[maybe_unused]] const ConfigBlock &block)
{ {
#ifndef HAVE_TREMOR #ifndef HAVE_TREMOR
LogDebug(vorbis_domain, vorbis_version_string()); LogDebug(vorbis_domain, vorbis_version_string());
......
...@@ -143,7 +143,7 @@ format_samples_int(void *buffer, uint32_t count) ...@@ -143,7 +143,7 @@ format_samples_int(void *buffer, uint32_t count)
* No conversion necessary. * No conversion necessary.
*/ */
static void static void
format_samples_nop(gcc_unused void *buffer, gcc_unused uint32_t count) format_samples_nop([[maybe_unused]] void *buffer, [[maybe_unused]] uint32_t count)
{ {
/* do nothing */ /* do nothing */
} }
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
* *
* @param tag the tag object * @param tag the tag object
*/ */
virtual void SendTag(gcc_unused const Tag &tag) { virtual void SendTag([[maybe_unused]] const Tag &tag) {
} }
/** /**
......
...@@ -69,8 +69,8 @@ private: ...@@ -69,8 +69,8 @@ private:
static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *, static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *,
const FLAC__byte data[], const FLAC__byte data[],
size_t bytes, size_t bytes,
gcc_unused unsigned samples, [[maybe_unused]] unsigned samples,
gcc_unused unsigned current_frame, [[maybe_unused]] unsigned current_frame,
void *client_data) noexcept { void *client_data) noexcept {
auto &encoder = *(FlacEncoder *)client_data; auto &encoder = *(FlacEncoder *)client_data;
encoder.output_buffer.Append((const uint8_t *)data, bytes); encoder.output_buffer.Append((const uint8_t *)data, bytes);
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
}; };
static PreparedEncoder * static PreparedEncoder *
null_encoder_init(gcc_unused const ConfigBlock &block) null_encoder_init([[maybe_unused]] const ConfigBlock &block)
{ {
return new PreparedNullEncoder(); return new PreparedNullEncoder();
} }
......
...@@ -98,7 +98,7 @@ fill_wave_header(WaveHeader *header, int channels, int bits, ...@@ -98,7 +98,7 @@ fill_wave_header(WaveHeader *header, int channels, int bits,
} }
static PreparedEncoder * static PreparedEncoder *
wave_encoder_init(gcc_unused const ConfigBlock &block) wave_encoder_init([[maybe_unused]] const ConfigBlock &block)
{ {
return new PreparedWaveEncoder(); return new PreparedWaveEncoder();
} }
......
...@@ -271,7 +271,7 @@ EventLoop::HandleDeferred() noexcept ...@@ -271,7 +271,7 @@ EventLoop::HandleDeferred() noexcept
} }
bool bool
EventLoop::OnSocketReady(gcc_unused unsigned flags) noexcept EventLoop::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{ {
assert(IsInside()); assert(IsInside());
......
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
return epoll.Remove(fd); return epoll.Remove(fd);
} }
bool Abandon(gcc_unused int fd) noexcept { bool Abandon([[maybe_unused]] int fd) noexcept {
// Nothing to do in this implementation. // Nothing to do in this implementation.
// Closed descriptors are automatically unregistered. // Closed descriptors are automatically unregistered.
return true; return true;
......
...@@ -161,7 +161,7 @@ ServerSocket::OneServerSocket::Accept() noexcept ...@@ -161,7 +161,7 @@ ServerSocket::OneServerSocket::Accept() noexcept
} }
bool bool
ServerSocket::OneServerSocket::OnSocketReady(gcc_unused unsigned flags) noexcept ServerSocket::OneServerSocket::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{ {
Accept(); Accept();
return true; return true;
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
observer.proxy = nullptr; observer.proxy = nullptr;
} }
void Clear(gcc_unused Proxy *_child) noexcept { void Clear([[maybe_unused]] Proxy *_child) noexcept {
assert(child == _child); assert(child == _child);
child = nullptr; child = nullptr;
} }
......
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
}; };
static std::unique_ptr<PreparedFilter> static std::unique_ptr<PreparedFilter>
normalize_filter_init(gcc_unused const ConfigBlock &block) normalize_filter_init([[maybe_unused]] const ConfigBlock &block)
{ {
return std::make_unique<PreparedNormalizeFilter>(); return std::make_unique<PreparedNormalizeFilter>();
} }
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
}; };
static std::unique_ptr<PreparedFilter> static std::unique_ptr<PreparedFilter>
null_filter_init(gcc_unused const ConfigBlock &block) null_filter_init([[maybe_unused]] const ConfigBlock &block)
{ {
return std::make_unique<PreparedNullFilter>(); return std::make_unique<PreparedNullFilter>();
} }
......
...@@ -81,7 +81,7 @@ FileOutputStream::Open() ...@@ -81,7 +81,7 @@ FileOutputStream::Open()
#ifdef _WIN32 #ifdef _WIN32
inline void inline void
FileOutputStream::OpenCreate(gcc_unused bool visible) FileOutputStream::OpenCreate([[maybe_unused]] bool visible)
{ {
handle = CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr, handle = CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr,
CREATE_ALWAYS, CREATE_ALWAYS,
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
*/ */
IcyInputStream(InputStreamPtr _input, IcyInputStream(InputStreamPtr _input,
std::shared_ptr<IcyMetaDataParser> _parser); std::shared_ptr<IcyMetaDataParser> _parser);
virtual ~IcyInputStream() noexcept; ~IcyInputStream() noexcept override;
IcyInputStream(const IcyInputStream &) = delete; IcyInputStream(const IcyInputStream &) = delete;
IcyInputStream &operator=(const IcyInputStream &) = delete; IcyInputStream &operator=(const IcyInputStream &) = delete;
......
...@@ -69,7 +69,7 @@ InputStream::CheapSeeking() const noexcept ...@@ -69,7 +69,7 @@ InputStream::CheapSeeking() const noexcept
} }
void void
InputStream::Seek(std::unique_lock<Mutex> &, gcc_unused offset_type new_offset) InputStream::Seek(std::unique_lock<Mutex> &, [[maybe_unused]] offset_type new_offset)
{ {
throw std::runtime_error("Seeking is not implemented"); throw std::runtime_error("Seeking is not implemented");
} }
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
Mutex &_mutex) noexcept Mutex &_mutex) noexcept
:InputStream(_uri, _mutex) {} :InputStream(_uri, _mutex) {}
virtual ~ProxyInputStream() noexcept; ~ProxyInputStream() noexcept override;
ProxyInputStream(const ProxyInputStream &) = delete; ProxyInputStream(const ProxyInputStream &) = delete;
ProxyInputStream &operator=(const ProxyInputStream &) = delete; ProxyInputStream &operator=(const ProxyInputStream &) = delete;
......
...@@ -110,7 +110,7 @@ protected: ...@@ -110,7 +110,7 @@ protected:
InvalidateSockets(); InvalidateSockets();
} }
void DoSeek(gcc_unused offset_type new_offset) override { void DoSeek([[maybe_unused]] offset_type new_offset) override {
/* unreachable because seekable==false */ /* unreachable because seekable==false */
SeekDone(); SeekDone();
} }
...@@ -289,7 +289,7 @@ AlsaInputStream::Recover(int err) ...@@ -289,7 +289,7 @@ AlsaInputStream::Recover(int err)
if (err == -EAGAIN) if (err == -EAGAIN)
return 0; return 0;
/* fall-through to snd_pcm_prepare: */ /* fall-through to snd_pcm_prepare: */
#if GCC_CHECK_VERSION(7,0) #if CLANG_OR_GCC_VERSION(7,0)
[[fallthrough]]; [[fallthrough]];
#endif #endif
case SND_PCM_STATE_OPEN: case SND_PCM_STATE_OPEN:
......
...@@ -108,7 +108,7 @@ CurlGlobal::CurlGlobal(EventLoop &_loop) ...@@ -108,7 +108,7 @@ CurlGlobal::CurlGlobal(EventLoop &_loop)
} }
int int
CurlSocket::SocketFunction(gcc_unused CURL *easy, CurlSocket::SocketFunction([[maybe_unused]] CURL *easy,
curl_socket_t s, int action, curl_socket_t s, int action,
void *userp, void *socketp) noexcept void *userp, void *socketp) noexcept
{ {
...@@ -230,7 +230,7 @@ CurlGlobal::UpdateTimeout(long timeout_ms) noexcept ...@@ -230,7 +230,7 @@ CurlGlobal::UpdateTimeout(long timeout_ms) noexcept
} }
int int
CurlGlobal::TimerFunction(gcc_unused CURLM *_multi, long timeout_ms, CurlGlobal::TimerFunction([[maybe_unused]] CURLM *_multi, long timeout_ms,
void *userp) noexcept void *userp) noexcept
{ {
auto &global = *(CurlGlobal *)userp; auto &global = *(CurlGlobal *)userp;
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
throw std::runtime_error("dbus_message_iter_append_fixed_array() failed"); throw std::runtime_error("dbus_message_iter_append_fixed_array() failed");
return *this; return *this;
}; }
AppendMessageIter &AppendFixedArray(ConstBuffer<uint32_t> value) { AppendMessageIter &AppendFixedArray(ConstBuffer<uint32_t> value) {
return AppendFixedArray(DBUS_TYPE_UINT32, return AppendFixedArray(DBUS_TYPE_UINT32,
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
return error.message; return error.message;
} }
gcc_noreturn [[noreturn]]
void Throw(const char *prefix) const; void Throw(const char *prefix) const;
void CheckThrow(const char *prefix) const; void CheckThrow(const char *prefix) const;
}; };
......
...@@ -47,7 +47,7 @@ FfmpegImportLogLevel(int level) noexcept ...@@ -47,7 +47,7 @@ FfmpegImportLogLevel(int level) noexcept
} }
void void
FfmpegLogCallback(gcc_unused void *ptr, int level, const char *fmt, std::va_list vl) FfmpegLogCallback(void *ptr, int level, const char *fmt, std::va_list vl)
{ {
const AVClass * cls = nullptr; const AVClass * cls = nullptr;
......
...@@ -172,7 +172,7 @@ NfsConnection::CancellableCallback::Callback(int err, void *data) noexcept ...@@ -172,7 +172,7 @@ NfsConnection::CancellableCallback::Callback(int err, void *data) noexcept
void void
NfsConnection::CancellableCallback::Callback(int err, NfsConnection::CancellableCallback::Callback(int err,
gcc_unused struct nfs_context *nfs, [[maybe_unused]] struct nfs_context *nfs,
void *data, void *data,
void *private_data) noexcept void *private_data) noexcept
{ {
...@@ -551,8 +551,8 @@ NfsConnection::OnSocketReady(unsigned flags) noexcept ...@@ -551,8 +551,8 @@ NfsConnection::OnSocketReady(unsigned flags) noexcept
} }
inline void inline void
NfsConnection::MountCallback(int status, gcc_unused nfs_context *nfs, NfsConnection::MountCallback(int status, [[maybe_unused]] nfs_context *nfs,
gcc_unused void *data) noexcept [[maybe_unused]] void *data) noexcept
{ {
assert(GetEventLoop().IsInside()); assert(GetEventLoop().IsInside());
assert(context == nfs); assert(context == nfs);
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
#include <string.h> #include <string.h>
static void static void
mpd_smbc_get_auth_data(gcc_unused const char *srv, mpd_smbc_get_auth_data([[maybe_unused]] const char *srv,
gcc_unused const char *shr, [[maybe_unused]] const char *shr,
char *wg, gcc_unused int wglen, char *wg, [[maybe_unused]] int wglen,
char *un, gcc_unused int unlen, char *un, [[maybe_unused]] int unlen,
char *pw, gcc_unused int pwlen) char *pw, [[maybe_unused]] int pwlen)
{ {
// TODO: implement // TODO: implement
strcpy(wg, "WORKGROUP"); strcpy(wg, "WORKGROUP");
......
...@@ -54,7 +54,7 @@ Bind(sqlite3_stmt *stmt, unsigned i, const char *value) ...@@ -54,7 +54,7 @@ Bind(sqlite3_stmt *stmt, unsigned i, const char *value)
template<typename... Args> template<typename... Args>
static void static void
BindAll2(gcc_unused sqlite3_stmt *stmt, gcc_unused unsigned i) BindAll2([[maybe_unused]] sqlite3_stmt *stmt, [[maybe_unused]] unsigned i)
{ {
assert(int(i - 1) == sqlite3_bind_parameter_count(stmt)); assert(int(i - 1) == sqlite3_bind_parameter_count(stmt));
} }
......
...@@ -32,7 +32,7 @@ CountNameValuePairs() noexcept ...@@ -32,7 +32,7 @@ CountNameValuePairs() noexcept
template<typename... Args> template<typename... Args>
static constexpr unsigned static constexpr unsigned
CountNameValuePairs(gcc_unused const char *name, gcc_unused const char *value, CountNameValuePairs([[maybe_unused]] const char *name, [[maybe_unused]] const char *value,
Args... args) noexcept Args... args) noexcept
{ {
return 1 + CountNameValuePairs(args...); return 1 + CountNameValuePairs(args...);
......
...@@ -119,7 +119,7 @@ FlacIOEof(FLAC__IOHandle handle) ...@@ -119,7 +119,7 @@ FlacIOEof(FLAC__IOHandle handle)
} }
static int static int
FlacIOClose(gcc_unused FLAC__IOHandle handle) FlacIOClose([[maybe_unused]] FLAC__IOHandle handle)
{ {
/* no-op because the libFLAC caller is responsible for closing /* no-op because the libFLAC caller is responsible for closing
the #InputStream */ the #InputStream */
......
...@@ -173,7 +173,7 @@ AlsaMixer::Configure(const ConfigBlock &block) ...@@ -173,7 +173,7 @@ AlsaMixer::Configure(const ConfigBlock &block)
} }
static Mixer * static Mixer *
alsa_mixer_init(EventLoop &event_loop, gcc_unused AudioOutput &ao, alsa_mixer_init(EventLoop &event_loop, [[maybe_unused]] AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
const ConfigBlock &block) const ConfigBlock &block)
{ {
......
...@@ -47,9 +47,9 @@ public: ...@@ -47,9 +47,9 @@ public:
}; };
static Mixer * static Mixer *
haiku_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao, haiku_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return new HaikuMixer((HaikuOutput &)ao, listener); return new HaikuMixer((HaikuOutput &)ao, listener);
} }
......
...@@ -49,10 +49,10 @@ public: ...@@ -49,10 +49,10 @@ public:
}; };
static Mixer * static Mixer *
null_mixer_init(gcc_unused EventLoop &event_loop, null_mixer_init([[maybe_unused]] EventLoop &event_loop,
gcc_unused AudioOutput &ao, [[maybe_unused]] AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return new NullMixer(listener); return new NullMixer(listener);
} }
......
...@@ -54,9 +54,9 @@ OSXMixer::SetVolume(unsigned new_volume) ...@@ -54,9 +54,9 @@ OSXMixer::SetVolume(unsigned new_volume)
} }
static Mixer * static Mixer *
osx_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao, osx_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
OSXOutput &osxo = (OSXOutput &)ao; OSXOutput &osxo = (OSXOutput &)ao;
return new OSXMixer(osxo, listener); return new OSXMixer(osxo, listener);
......
...@@ -97,8 +97,8 @@ OssMixer::Configure(const ConfigBlock &block) ...@@ -97,8 +97,8 @@ OssMixer::Configure(const ConfigBlock &block)
} }
static Mixer * static Mixer *
oss_mixer_init(gcc_unused EventLoop &event_loop, oss_mixer_init([[maybe_unused]] EventLoop &event_loop,
gcc_unused AudioOutput &ao, [[maybe_unused]] AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
const ConfigBlock &block) const ConfigBlock &block)
{ {
......
...@@ -104,7 +104,7 @@ PulseMixer::VolumeCallback(const pa_sink_input_info *i, int eol) ...@@ -104,7 +104,7 @@ PulseMixer::VolumeCallback(const pa_sink_input_info *i, int eol)
* value. * value.
*/ */
static void static void
pulse_mixer_volume_cb(gcc_unused pa_context *context, const pa_sink_input_info *i, pulse_mixer_volume_cb([[maybe_unused]] pa_context *context, const pa_sink_input_info *i,
int eol, void *userdata) int eol, void *userdata)
{ {
auto *pm = (PulseMixer *)userdata; auto *pm = (PulseMixer *)userdata;
...@@ -133,7 +133,7 @@ PulseMixer::Update(pa_context *context, pa_stream *stream) ...@@ -133,7 +133,7 @@ PulseMixer::Update(pa_context *context, pa_stream *stream)
} }
void void
pulse_mixer_on_connect(gcc_unused PulseMixer &pm, pulse_mixer_on_connect([[maybe_unused]] PulseMixer &pm,
struct pa_context *context) struct pa_context *context)
{ {
pa_operation *o; pa_operation *o;
...@@ -182,7 +182,7 @@ parse_volume_scale_factor(const char *value) { ...@@ -182,7 +182,7 @@ parse_volume_scale_factor(const char *value) {
} }
static Mixer * static Mixer *
pulse_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao, pulse_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
const ConfigBlock &block) const ConfigBlock &block)
{ {
......
...@@ -45,10 +45,10 @@ public: ...@@ -45,10 +45,10 @@ public:
}; };
static Mixer * static Mixer *
sndio_mixer_init(gcc_unused EventLoop &event_loop, sndio_mixer_init([[maybe_unused]] EventLoop &event_loop,
AudioOutput &ao, AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return new SndioMixer((SndioOutput &)ao, listener); return new SndioMixer((SndioOutput &)ao, listener);
} }
......
...@@ -57,10 +57,10 @@ public: ...@@ -57,10 +57,10 @@ public:
}; };
static Mixer * static Mixer *
software_mixer_init(gcc_unused EventLoop &event_loop, software_mixer_init([[maybe_unused]] EventLoop &event_loop,
gcc_unused AudioOutput &ao, [[maybe_unused]] AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return new SoftwareMixer(listener); return new SoftwareMixer(listener);
} }
......
...@@ -63,9 +63,9 @@ winmm_volume_encode(int volume) ...@@ -63,9 +63,9 @@ winmm_volume_encode(int volume)
} }
static Mixer * static Mixer *
winmm_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao, winmm_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener, MixerListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return new WinmmMixer((WinmmOutput &)ao, listener); return new WinmmMixer((WinmmOutput &)ao, listener);
} }
......
...@@ -252,9 +252,9 @@ SmbclientNeighborExplorer::ThreadFunc() noexcept ...@@ -252,9 +252,9 @@ SmbclientNeighborExplorer::ThreadFunc() noexcept
} }
static std::unique_ptr<NeighborExplorer> static std::unique_ptr<NeighborExplorer>
smbclient_neighbor_create(gcc_unused EventLoop &loop, smbclient_neighbor_create([[maybe_unused]] EventLoop &loop,
NeighborListener &listener, NeighborListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
SmbclientInit(); SmbclientInit();
......
...@@ -259,7 +259,7 @@ UdisksNeighborExplorer::HandleMessage(DBusConnection *connection, ...@@ -259,7 +259,7 @@ UdisksNeighborExplorer::HandleMessage(DBusConnection *connection,
static std::unique_ptr<NeighborExplorer> static std::unique_ptr<NeighborExplorer>
udisks_neighbor_create(EventLoop &event_loop, udisks_neighbor_create(EventLoop &event_loop,
NeighborListener &listener, NeighborListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return std::make_unique<UdisksNeighborExplorer>(event_loop, listener); return std::make_unique<UdisksNeighborExplorer>(event_loop, listener);
} }
......
...@@ -127,7 +127,7 @@ UpnpNeighborExplorer::LostUPnP(const ContentDirectoryService &service) ...@@ -127,7 +127,7 @@ UpnpNeighborExplorer::LostUPnP(const ContentDirectoryService &service)
static std::unique_ptr<NeighborExplorer> static std::unique_ptr<NeighborExplorer>
upnp_neighbor_create(EventLoop &event_loop, upnp_neighbor_create(EventLoop &event_loop,
NeighborListener &listener, NeighborListener &listener,
gcc_unused const ConfigBlock &block) [[maybe_unused]] const ConfigBlock &block)
{ {
return std::make_unique<UpnpNeighborExplorer>(event_loop, listener); return std::make_unique<UpnpNeighborExplorer>(event_loop, listener);
} }
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <stdexcept> #include <stdexcept>
void void
AudioOutput::SetAttribute(gcc_unused std::string &&name, AudioOutput::SetAttribute([[maybe_unused]] std::string &&name,
gcc_unused std::string &&value) [[maybe_unused]] std::string &&value)
{ {
throw std::invalid_argument("Unsupported attribute"); throw std::invalid_argument("Unsupported attribute");
} }
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
const MusicChunk *Get() noexcept; const MusicChunk *Get() noexcept;
void Consume(gcc_unused const MusicChunk &_chunk) { void Consume([[maybe_unused]] const MusicChunk &_chunk) {
assert(chunk != nullptr); assert(chunk != nullptr);
assert(chunk == &_chunk); assert(chunk == &_chunk);
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
gcc_pure gcc_pure
bool IsConsumed(const MusicChunk &_chunk) const noexcept; bool IsConsumed(const MusicChunk &_chunk) const noexcept;
void ClearTail(gcc_unused const MusicChunk &_chunk) noexcept { void ClearTail([[maybe_unused]] const MusicChunk &_chunk) noexcept {
assert(chunk == &_chunk); assert(chunk == &_chunk);
assert(consumed); assert(consumed);
chunk = nullptr; chunk = nullptr;
......
...@@ -763,7 +763,7 @@ AlsaOutput::Recover(int err) noexcept ...@@ -763,7 +763,7 @@ AlsaOutput::Recover(int err) noexcept
if (err == -EAGAIN) if (err == -EAGAIN)
return 0; return 0;
/* fall-through to snd_pcm_prepare: */ /* fall-through to snd_pcm_prepare: */
#if GCC_CHECK_VERSION(7,0) #if CLANG_OR_GCC_VERSION(7,0)
[[fallthrough]]; [[fallthrough]];
#endif #endif
case SND_PCM_STATE_OPEN: case SND_PCM_STATE_OPEN:
......
...@@ -81,9 +81,9 @@ private: ...@@ -81,9 +81,9 @@ private:
std::chrono::steady_clock::duration Delay() const noexcept override; std::chrono::steady_clock::duration Delay() const noexcept override;
static void _FillBuffer(void* cookie, void* _buffer, size_t size, static void _FillBuffer(void* cookie, void* _buffer, size_t size,
gcc_unused const media_raw_audio_format& _format); [[maybe_unused]] const media_raw_audio_format& _format);
void FillBuffer(void* _buffer, size_t size, void FillBuffer(void* _buffer, size_t size,
gcc_unused const media_raw_audio_format& _format); [[maybe_unused]] const media_raw_audio_format& _format);
void SendTag(const Tag &tag) override; void SendTag(const Tag &tag) override;
}; };
...@@ -154,7 +154,7 @@ HaikuOutput::_FillBuffer(void* cookie, void* buffer, size_t size, ...@@ -154,7 +154,7 @@ HaikuOutput::_FillBuffer(void* cookie, void* buffer, size_t size,
void void
HaikuOutput::FillBuffer(void* _buffer, size_t size, HaikuOutput::FillBuffer(void* _buffer, size_t size,
gcc_unused const media_raw_audio_format& _format) [[maybe_unused]] const media_raw_audio_format& _format)
{ {
buffer = (uint8*)_buffer; buffer = (uint8*)_buffer;
......
...@@ -53,7 +53,7 @@ private: ...@@ -53,7 +53,7 @@ private:
: std::chrono::steady_clock::duration::zero(); : std::chrono::steady_clock::duration::zero();
} }
size_t Play(gcc_unused const void *chunk, size_t size) override { size_t Play([[maybe_unused]] const void *chunk, size_t size) override {
if (sync) { if (sync) {
if (!timer->IsStarted()) if (!timer->IsStarted())
timer->Start(); timer->Start();
......
...@@ -710,9 +710,9 @@ osx_output_set_device(OSXOutput *oo) ...@@ -710,9 +710,9 @@ osx_output_set_device(OSXOutput *oo)
*/ */
static OSStatus static OSStatus
osx_render(void *vdata, osx_render(void *vdata,
gcc_unused AudioUnitRenderActionFlags *io_action_flags, [[maybe_unused]] AudioUnitRenderActionFlags *io_action_flags,
gcc_unused const AudioTimeStamp *in_timestamp, [[maybe_unused]] const AudioTimeStamp *in_timestamp,
gcc_unused UInt32 in_bus_number, [[maybe_unused]] UInt32 in_bus_number,
UInt32 in_number_frames, UInt32 in_number_frames,
AudioBufferList *buffer_list) AudioBufferList *buffer_list)
{ {
......
...@@ -57,7 +57,7 @@ PipeOutput::PipeOutput(const ConfigBlock &block) ...@@ -57,7 +57,7 @@ PipeOutput::PipeOutput(const ConfigBlock &block)
} }
inline void inline void
PipeOutput::Open(gcc_unused AudioFormat &audio_format) PipeOutput::Open([[maybe_unused]] AudioFormat &audio_format)
{ {
fh = popen(cmd.c_str(), "w"); fh = popen(cmd.c_str(), "w");
if (fh == nullptr) if (fh == nullptr)
......
...@@ -62,7 +62,7 @@ class PulseOutput final : AudioOutput { ...@@ -62,7 +62,7 @@ class PulseOutput final : AudioOutput {
public: public:
void SetMixer(PulseMixer &_mixer); void SetMixer(PulseMixer &_mixer);
void ClearMixer(gcc_unused PulseMixer &old_mixer) { void ClearMixer([[maybe_unused]] PulseMixer &old_mixer) {
assert(mixer == &old_mixer); assert(mixer == &old_mixer);
mixer = nullptr; mixer = nullptr;
...@@ -277,8 +277,8 @@ pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop, ...@@ -277,8 +277,8 @@ pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop,
* the caller thread, to wake pulse_wait_for_operation() up. * the caller thread, to wake pulse_wait_for_operation() up.
*/ */
static void static void
pulse_output_stream_success_cb(gcc_unused pa_stream *s, pulse_output_stream_success_cb([[maybe_unused]] pa_stream *s,
gcc_unused int success, void *userdata) [[maybe_unused]] int success, void *userdata)
{ {
PulseOutput &po = *(PulseOutput *)userdata; PulseOutput &po = *(PulseOutput *)userdata;
...@@ -342,7 +342,7 @@ PulseOutput::OnServerLayoutChanged(pa_subscription_event_type_t t, ...@@ -342,7 +342,7 @@ PulseOutput::OnServerLayoutChanged(pa_subscription_event_type_t t,
} }
static void static void
pulse_output_subscribe_cb(gcc_unused pa_context *context, pulse_output_subscribe_cb([[maybe_unused]] pa_context *context,
pa_subscription_event_type_t t, pa_subscription_event_type_t t,
uint32_t idx, void *userdata) uint32_t idx, void *userdata)
{ {
...@@ -508,7 +508,7 @@ PulseOutput::WaitConnection() ...@@ -508,7 +508,7 @@ PulseOutput::WaitConnection()
} }
inline void inline void
PulseOutput::OnStreamSuspended(gcc_unused pa_stream *_stream) PulseOutput::OnStreamSuspended([[maybe_unused]] pa_stream *_stream)
{ {
assert(_stream == stream || stream == nullptr); assert(_stream == stream || stream == nullptr);
assert(mainloop != nullptr); assert(mainloop != nullptr);
...@@ -574,7 +574,7 @@ PulseOutput::OnStreamWrite(size_t nbytes) ...@@ -574,7 +574,7 @@ PulseOutput::OnStreamWrite(size_t nbytes)
} }
static void static void
pulse_output_stream_write_cb(gcc_unused pa_stream *stream, size_t nbytes, pulse_output_stream_write_cb([[maybe_unused]] pa_stream *stream, size_t nbytes,
void *userdata) void *userdata)
{ {
PulseOutput &po = *(PulseOutput *)userdata; PulseOutput &po = *(PulseOutput *)userdata;
......
...@@ -121,7 +121,7 @@ HttpdOutput::OnDeferredBroadcast() noexcept ...@@ -121,7 +121,7 @@ HttpdOutput::OnDeferredBroadcast() noexcept
void void
HttpdOutput::OnAccept(UniqueSocketDescriptor fd, HttpdOutput::OnAccept(UniqueSocketDescriptor fd,
SocketAddress, gcc_unused int uid) noexcept SocketAddress, [[maybe_unused]] int uid) noexcept
{ {
/* the listener socket has become readable - a client has /* the listener socket has become readable - a client has
connected */ connected */
......
...@@ -111,7 +111,7 @@ private: ...@@ -111,7 +111,7 @@ private:
* been consumed. It synthesises and enqueues the next * been consumed. It synthesises and enqueues the next
* buffer. * buffer.
*/ */
static void PlayedCallback(gcc_unused SLAndroidSimpleBufferQueueItf caller, static void PlayedCallback([[maybe_unused]] SLAndroidSimpleBufferQueueItf caller,
void *pContext) void *pContext)
{ {
SlesOutput &sles = *(SlesOutput *)pContext; SlesOutput &sles = *(SlesOutput *)pContext;
......
...@@ -1176,7 +1176,9 @@ try { ...@@ -1176,7 +1176,9 @@ try {
} }
/* fall through */ /* fall through */
gcc_fallthrough; #if CLANG_OR_GCC_VERSION(7,0)
[[fallthrough]];
#endif
case PlayerCommand::PAUSE: case PlayerCommand::PAUSE:
next_song.reset(); next_song.reset();
......
...@@ -82,7 +82,7 @@ ExtractCuesheetTagHandler::OnPair(StringView name, StringView value) noexcept ...@@ -82,7 +82,7 @@ ExtractCuesheetTagHandler::OnPair(StringView name, StringView value) noexcept
static std::unique_ptr<SongEnumerator> static std::unique_ptr<SongEnumerator>
embcue_playlist_open_uri(const char *uri, embcue_playlist_open_uri(const char *uri,
gcc_unused Mutex &mutex) [[maybe_unused]] Mutex &mutex)
{ {
if (!PathTraitsUTF8::IsAbsolute(uri)) if (!PathTraitsUTF8::IsAbsolute(uri))
/* only local files supported */ /* only local files supported */
......
...@@ -79,7 +79,7 @@ static constexpr struct tag_table xspf_tag_elements[] = { ...@@ -79,7 +79,7 @@ static constexpr struct tag_table xspf_tag_elements[] = {
static void XMLCALL static void XMLCALL
xspf_start_element(void *user_data, const XML_Char *element_name, xspf_start_element(void *user_data, const XML_Char *element_name,
gcc_unused const XML_Char **atts) [[maybe_unused]] const XML_Char **atts)
{ {
auto *parser = (XspfParser *)user_data; auto *parser = (XspfParser *)user_data;
parser->value.clear(); parser->value.clear();
......
...@@ -87,7 +87,7 @@ class CompositeStorage final : public Storage { ...@@ -87,7 +87,7 @@ class CompositeStorage final : public Storage {
public: public:
CompositeStorage() noexcept; CompositeStorage() noexcept;
virtual ~CompositeStorage(); ~CompositeStorage() override;
/** /**
* Get the #Storage at the specified mount point. Returns * Get the #Storage at the specified mount point. Returns
......
...@@ -36,7 +36,7 @@ MemoryStorageDirectoryReader::Read() noexcept ...@@ -36,7 +36,7 @@ MemoryStorageDirectoryReader::Read() noexcept
} }
StorageFileInfo StorageFileInfo
MemoryStorageDirectoryReader::GetInfo(gcc_unused bool follow) MemoryStorageDirectoryReader::GetInfo([[maybe_unused]] bool follow)
{ {
assert(!first); assert(!first);
assert(!entries.empty()); assert(!entries.empty());
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "fs/Traits.hxx" #include "fs/Traits.hxx"
AllocatedPath AllocatedPath
Storage::MapFS(gcc_unused const char *uri_utf8) const noexcept Storage::MapFS([[maybe_unused]] const char *uri_utf8) const noexcept
{ {
return nullptr; return nullptr;
} }
......
...@@ -315,7 +315,7 @@ private: ...@@ -315,7 +315,7 @@ private:
/* virtual methods from CommonExpatParser */ /* virtual methods from CommonExpatParser */
void StartElement(const XML_Char *name, void StartElement(const XML_Char *name,
gcc_unused const XML_Char **attrs) final { [[maybe_unused]] const XML_Char **attrs) final {
switch (state) { switch (state) {
case State::ROOT: case State::ROOT:
if (strcmp(name, "DAV:|response") == 0) if (strcmp(name, "DAV:|response") == 0)
...@@ -447,7 +447,7 @@ protected: ...@@ -447,7 +447,7 @@ protected:
}; };
StorageFileInfo StorageFileInfo
CurlStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow) CurlStorage::GetInfo(const char *uri_utf8, [[maybe_unused]] bool follow)
{ {
// TODO: escape the given URI // TODO: escape the given URI
......
...@@ -288,7 +288,7 @@ protected: ...@@ -288,7 +288,7 @@ protected:
connection.Lstat(path, *this); connection.Lstat(path, *this);
} }
void HandleResult(gcc_unused unsigned status, void *data) noexcept override { void HandleResult([[maybe_unused]] unsigned status, void *data) noexcept override {
Copy(info, *(const struct nfs_stat_64 *)data); Copy(info, *(const struct nfs_stat_64 *)data);
} }
}; };
...@@ -356,7 +356,7 @@ protected: ...@@ -356,7 +356,7 @@ protected:
connection.OpenDirectory(path, *this); connection.OpenDirectory(path, *this);
} }
void HandleResult(gcc_unused unsigned status, void HandleResult([[maybe_unused]] unsigned status,
void *data) noexcept override { void *data) noexcept override {
auto *const dir = (struct nfsdir *)data; auto *const dir = (struct nfsdir *)data;
......
...@@ -117,7 +117,7 @@ GetInfo(const char *path) ...@@ -117,7 +117,7 @@ GetInfo(const char *path)
} }
StorageFileInfo StorageFileInfo
SmbclientStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow) SmbclientStorage::GetInfo(const char *uri_utf8, [[maybe_unused]] bool follow)
{ {
const std::string mapped = MapUTF8(uri_utf8); const std::string mapped = MapUTF8(uri_utf8);
return ::GetInfo(mapped.c_str()); return ::GetInfo(mapped.c_str());
...@@ -172,14 +172,14 @@ SmbclientDirectoryReader::Read() noexcept ...@@ -172,14 +172,14 @@ SmbclientDirectoryReader::Read() noexcept
} }
StorageFileInfo StorageFileInfo
SmbclientDirectoryReader::GetInfo(gcc_unused bool follow) SmbclientDirectoryReader::GetInfo([[maybe_unused]] bool follow)
{ {
const std::string path = PathTraitsUTF8::Build(base.c_str(), name); const std::string path = PathTraitsUTF8::Build(base.c_str(), name);
return ::GetInfo(path.c_str()); return ::GetInfo(path.c_str());
} }
static std::unique_ptr<Storage> static std::unique_ptr<Storage>
CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base) CreateSmbclientStorageURI([[maybe_unused]] EventLoop &event_loop, const char *base)
{ {
if (!StringStartsWithCaseASCII(base, "smb://")) if (!StringStartsWithCaseASCII(base, "smb://"))
return nullptr; return nullptr;
......
...@@ -56,6 +56,6 @@ EventFD::Write() noexcept ...@@ -56,6 +56,6 @@ EventFD::Write() noexcept
assert(fd.IsDefined()); assert(fd.IsDefined());
static constexpr eventfd_t value = 1; static constexpr eventfd_t value = 1;
gcc_unused ssize_t nbytes = [[maybe_unused]] ssize_t nbytes =
fd.Write(&value, sizeof(value)); fd.Write(&value, sizeof(value));
} }
...@@ -85,7 +85,7 @@ EventPipe::Write() noexcept ...@@ -85,7 +85,7 @@ EventPipe::Write() noexcept
#ifdef _WIN32 #ifdef _WIN32
send(fds[1], "", 1, 0); send(fds[1], "", 1, 0);
#else #else
gcc_unused ssize_t nbytes = write(fds[1], "", 1); [[maybe_unused]] ssize_t nbytes = write(fds[1], "", 1);
#endif #endif
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
static constexpr Domain fatal_error_domain("fatal_error"); static constexpr Domain fatal_error_domain("fatal_error");
gcc_noreturn [[noreturn]]
static void static void
Abort() Abort()
{ {
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
/** /**
* Log the specified message and abort the process. * Log the specified message and abort the process.
*/ */
gcc_noreturn [[noreturn]]
void void
FatalError(const char *msg); FatalError(const char *msg);
gcc_noreturn [[noreturn]]
void void
FormatFatalError(const char *fmt, ...); FormatFatalError(const char *fmt, ...);
...@@ -42,19 +42,19 @@ FormatFatalError(const char *fmt, ...); ...@@ -42,19 +42,19 @@ FormatFatalError(const char *fmt, ...);
* fail. Prints the given message, the system error message (from * fail. Prints the given message, the system error message (from
* errno or GetLastError()) and abort the process. * errno or GetLastError()) and abort the process.
*/ */
gcc_noreturn [[noreturn]]
void void
FatalSystemError(const char *msg); FatalSystemError(const char *msg);
#ifdef _WIN32 #ifdef _WIN32
gcc_noreturn [[noreturn]]
void void
FatalSystemError(const char *msg, DWORD code); FatalSystemError(const char *msg, DWORD code);
#endif #endif
gcc_noreturn [[noreturn]]
void void
FormatFatalSystemError(const char *fmt, ...); FormatFatalSystemError(const char *fmt, ...);
......
...@@ -41,7 +41,7 @@ NullTagHandler::OnPicture(const char *, ConstBuffer<void>) noexcept ...@@ -41,7 +41,7 @@ NullTagHandler::OnPicture(const char *, ConstBuffer<void>) noexcept
} }
void void
NullTagHandler::OnAudioFormat(gcc_unused AudioFormat af) noexcept NullTagHandler::OnAudioFormat([[maybe_unused]] AudioFormat af) noexcept
{ {
} }
......
...@@ -124,7 +124,7 @@ public: ...@@ -124,7 +124,7 @@ public:
explicit NullTagHandler(unsigned _want_mask) noexcept explicit NullTagHandler(unsigned _want_mask) noexcept
:TagHandler(_want_mask) {} :TagHandler(_want_mask) {}
void OnDuration(gcc_unused SongTime duration) noexcept override {} void OnDuration([[maybe_unused]] SongTime duration) noexcept override {}
void OnTag(TagType type, StringView value) noexcept override; void OnTag(TagType type, StringView value) noexcept override;
void OnPair(StringView key, StringView value) noexcept override; void OnPair(StringView key, StringView value) noexcept override;
void OnAudioFormat(AudioFormat af) noexcept override; void OnAudioFormat(AudioFormat af) noexcept override;
......
...@@ -53,7 +53,7 @@ class ScopeUnlock { ...@@ -53,7 +53,7 @@ class ScopeUnlock {
public: public:
explicit ScopeUnlock(Mutex &_mutex) noexcept:mutex(_mutex) { explicit ScopeUnlock(Mutex &_mutex) noexcept:mutex(_mutex) {
mutex.unlock(); mutex.unlock();
}; }
~ScopeUnlock() noexcept { ~ScopeUnlock() noexcept {
mutex.lock(); mutex.lock();
......
...@@ -58,7 +58,7 @@ SetThreadName(const char *name) noexcept ...@@ -58,7 +58,7 @@ SetThreadName(const char *name) noexcept
template<typename... Args> template<typename... Args>
static inline void static inline void
FormatThreadName(const char *fmt, gcc_unused Args&&... args) noexcept FormatThreadName(const char *fmt, [[maybe_unused]] Args&&... args) noexcept
{ {
#ifdef HAVE_THREAD_NAME #ifdef HAVE_THREAD_NAME
SetThreadName(StringFormat<16>(fmt, args...)); SetThreadName(StringFormat<16>(fmt, args...));
......
...@@ -45,10 +45,12 @@ daemonize_finish() ...@@ -45,10 +45,12 @@ daemonize_finish()
* pid file. * pid file.
*/ */
#ifndef _WIN32 #ifndef _WIN32
[[noreturn]]
void void
daemonize_kill(); daemonize_kill();
#else #else
#include <stdexcept> #include <stdexcept>
[[noreturn]]
static inline void static inline void
daemonize_kill() daemonize_kill()
{ {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
gcc_noreturn [[noreturn]]
static void static void
oom() oom()
{ {
......
...@@ -68,16 +68,12 @@ ...@@ -68,16 +68,12 @@
/* GCC 4.x */ /* GCC 4.x */
#define gcc_const __attribute__((const)) #define gcc_const __attribute__((const))
#define gcc_deprecated __attribute__((deprecated))
#define gcc_may_alias __attribute__((may_alias)) #define gcc_may_alias __attribute__((may_alias))
#define gcc_malloc __attribute__((malloc)) #define gcc_malloc __attribute__((malloc))
#define gcc_noreturn __attribute__((noreturn))
#define gcc_packed __attribute__((packed)) #define gcc_packed __attribute__((packed))
#define gcc_printf(a,b) __attribute__((format(printf, a, b))) #define gcc_printf(a,b) __attribute__((format(printf, a, b)))
#define gcc_pure __attribute__((pure)) #define gcc_pure __attribute__((pure))
#define gcc_sentinel __attribute__((sentinel)) #define gcc_sentinel __attribute__((sentinel))
#define gcc_unused __attribute__((unused))
#define gcc_warn_unused_result __attribute__((warn_unused_result))
#define gcc_nonnull(...) __attribute__((nonnull(__VA_ARGS__))) #define gcc_nonnull(...) __attribute__((nonnull(__VA_ARGS__)))
#define gcc_nonnull_all __attribute__((nonnull)) #define gcc_nonnull_all __attribute__((nonnull))
...@@ -98,16 +94,12 @@ ...@@ -98,16 +94,12 @@
/* generic C compiler */ /* generic C compiler */
#define gcc_const #define gcc_const
#define gcc_deprecated
#define gcc_may_alias #define gcc_may_alias
#define gcc_malloc #define gcc_malloc
#define gcc_noreturn
#define gcc_packed #define gcc_packed
#define gcc_printf(a,b) #define gcc_printf(a,b)
#define gcc_pure #define gcc_pure
#define gcc_sentinel #define gcc_sentinel
#define gcc_unused
#define gcc_warn_unused_result
#define gcc_nonnull(...) #define gcc_nonnull(...)
#define gcc_nonnull_all #define gcc_nonnull_all
...@@ -167,12 +159,6 @@ ...@@ -167,12 +159,6 @@
#define __has_feature(x) 0 #define __has_feature(x) 0
#endif #endif
#if __has_feature(attribute_unused_on_fields)
#define gcc_unused_field gcc_unused
#else
#define gcc_unused_field
#endif
#if defined(__GNUC__) || defined(__clang__) #if defined(__GNUC__) || defined(__clang__)
#define gcc_unreachable() __builtin_unreachable() #define gcc_unreachable() __builtin_unreachable()
#else #else
......
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
* the std::exception_ptr itself. * the std::exception_ptr itself.
*/ */
template<typename T> template<typename T>
gcc_noreturn [[noreturn]]
inline void inline void
ThrowException(T &&t) ThrowException(T &&t)
{ {
throw std::forward<T>(t); throw std::forward<T>(t);
} }
gcc_noreturn [[noreturn]]
inline void inline void
ThrowException(std::exception_ptr ep) ThrowException(std::exception_ptr ep)
{ {
......
...@@ -204,7 +204,7 @@ struct CheckSequenceUTF8 { ...@@ -204,7 +204,7 @@ struct CheckSequenceUTF8 {
template<> template<>
struct CheckSequenceUTF8<0U> { struct CheckSequenceUTF8<0U> {
constexpr bool operator()(gcc_unused const char *p) const noexcept { constexpr bool operator()([[maybe_unused]] const char *p) const noexcept {
return true; return true;
} }
}; };
......
...@@ -64,8 +64,8 @@ service_notify_status(DWORD status_code) ...@@ -64,8 +64,8 @@ service_notify_status(DWORD status_code)
} }
static DWORD WINAPI static DWORD WINAPI
service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type, service_dispatcher([[maybe_unused]] DWORD control, [[maybe_unused]] DWORD event_type,
gcc_unused void *event_data, gcc_unused void *context) [[maybe_unused]] void *event_data, [[maybe_unused]] void *context)
{ {
switch (control) { switch (control) {
case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_SHUTDOWN:
...@@ -78,7 +78,7 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type, ...@@ -78,7 +78,7 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
} }
static void WINAPI static void WINAPI
service_main(gcc_unused DWORD argc, gcc_unused LPTSTR argv[]) service_main([[maybe_unused]] DWORD argc, [[maybe_unused]] LPTSTR argv[])
{ {
service_handle = service_handle =
RegisterServiceCtrlHandlerEx(service_name, RegisterServiceCtrlHandlerEx(service_name,
......
...@@ -49,7 +49,7 @@ AvahiRegisterService(AvahiClient *c); ...@@ -49,7 +49,7 @@ AvahiRegisterService(AvahiClient *c);
static void static void
AvahiGroupCallback(AvahiEntryGroup *g, AvahiGroupCallback(AvahiEntryGroup *g,
AvahiEntryGroupState state, AvahiEntryGroupState state,
gcc_unused void *userdata) [[maybe_unused]] void *userdata)
{ {
assert(g != nullptr); assert(g != nullptr);
...@@ -149,7 +149,7 @@ AvahiRegisterService(AvahiClient *c) ...@@ -149,7 +149,7 @@ AvahiRegisterService(AvahiClient *c)
/* Callback when avahi changes state */ /* Callback when avahi changes state */
static void static void
MyAvahiClientCallback(AvahiClient *c, AvahiClientState state, MyAvahiClientCallback(AvahiClient *c, AvahiClientState state,
gcc_unused void *userdata) [[maybe_unused]] void *userdata)
{ {
assert(c != nullptr); assert(c != nullptr);
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
protected: protected:
/* virtual methods from class SocketMonitor */ /* virtual methods from class SocketMonitor */
bool OnSocketReady(gcc_unused unsigned flags) noexcept override { bool OnSocketReady([[maybe_unused]] unsigned flags) noexcept override {
DNSServiceProcessResult(service_ref); DNSServiceProcessResult(service_ref);
return true; return true;
} }
...@@ -57,12 +57,12 @@ protected: ...@@ -57,12 +57,12 @@ protected:
static BonjourMonitor *bonjour_monitor; static BonjourMonitor *bonjour_monitor;
static void static void
dnsRegisterCallback(gcc_unused DNSServiceRef sdRef, dnsRegisterCallback([[maybe_unused]] DNSServiceRef sdRef,
gcc_unused DNSServiceFlags flags, [[maybe_unused]] DNSServiceFlags flags,
DNSServiceErrorType errorCode, const char *name, DNSServiceErrorType errorCode, const char *name,
gcc_unused const char *regtype, [[maybe_unused]] const char *regtype,
gcc_unused const char *domain, [[maybe_unused]] const char *domain,
gcc_unused void *context) [[maybe_unused]] void *context)
{ {
if (errorCode != kDNSServiceErr_NoError) { if (errorCode != kDNSServiceErr_NoError) {
LogError(bonjour_domain, LogError(bonjour_domain,
......
...@@ -50,7 +50,7 @@ static constexpr Domain zeroconf_domain("zeroconf"); ...@@ -50,7 +50,7 @@ static constexpr Domain zeroconf_domain("zeroconf");
static int zeroconfEnabled; static int zeroconfEnabled;
void void
ZeroconfInit(const ConfigData &config, gcc_unused EventLoop &loop) ZeroconfInit(const ConfigData &config, [[maybe_unused]] EventLoop &loop)
{ {
const char *serviceName; const char *serviceName;
......
...@@ -86,26 +86,26 @@ DumpDecoderClient::Read(InputStream &is, void *buffer, size_t length) noexcept ...@@ -86,26 +86,26 @@ DumpDecoderClient::Read(InputStream &is, void *buffer, size_t length) noexcept
} }
void void
DumpDecoderClient::SubmitTimestamp(gcc_unused FloatDuration t) noexcept DumpDecoderClient::SubmitTimestamp([[maybe_unused]] FloatDuration t) noexcept
{ {
} }
DecoderCommand DecoderCommand
DumpDecoderClient::SubmitData(gcc_unused InputStream *is, DumpDecoderClient::SubmitData([[maybe_unused]] InputStream *is,
const void *data, size_t datalen, const void *data, size_t datalen,
gcc_unused uint16_t kbit_rate) noexcept [[maybe_unused]] uint16_t kbit_rate) noexcept
{ {
if (kbit_rate != prev_kbit_rate) { if (kbit_rate != prev_kbit_rate) {
prev_kbit_rate = kbit_rate; prev_kbit_rate = kbit_rate;
fprintf(stderr, "%u kbit/s\n", kbit_rate); fprintf(stderr, "%u kbit/s\n", kbit_rate);
} }
gcc_unused ssize_t nbytes = write(STDOUT_FILENO, data, datalen); [[maybe_unused]] ssize_t nbytes = write(STDOUT_FILENO, data, datalen);
return GetCommand(); return GetCommand();
} }
DecoderCommand DecoderCommand
DumpDecoderClient::SubmitTag(gcc_unused InputStream *is, DumpDecoderClient::SubmitTag([[maybe_unused]] InputStream *is,
Tag &&tag) noexcept Tag &&tag) noexcept
{ {
fprintf(stderr, "TAG: duration=%f\n", tag.duration.ToDoubleS()); fprintf(stderr, "TAG: duration=%f\n", tag.duration.ToDoubleS());
...@@ -139,7 +139,7 @@ DumpDecoderClient::SubmitReplayGain(const ReplayGainInfo *rgi) noexcept ...@@ -139,7 +139,7 @@ DumpDecoderClient::SubmitReplayGain(const ReplayGainInfo *rgi) noexcept
} }
void void
DumpDecoderClient::SubmitMixRamp(gcc_unused MixRampInfo &&mix_ramp) noexcept DumpDecoderClient::SubmitMixRamp([[maybe_unused]] MixRampInfo &&mix_ramp) noexcept
{ {
fprintf(stderr, "MixRamp: start='%s' end='%s'\n", fprintf(stderr, "MixRamp: start='%s' end='%s'\n",
mix_ramp.GetStart(), mix_ramp.GetEnd()); mix_ramp.GetStart(), mix_ramp.GetEnd());
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
inline void inline void
BuildTag(gcc_unused TagBuilder &tag) noexcept BuildTag([[maybe_unused]] TagBuilder &tag) noexcept
{ {
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#endif #endif
static bool static bool
MyApeTagCallback(gcc_unused unsigned long flags, MyApeTagCallback([[maybe_unused]] unsigned long flags,
const char *key, StringView value) const char *key, StringView value)
{ {
if ((flags & (0x3 << 1)) == 0) if ((flags & (0x3 << 1)) == 0)
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
#include <stdlib.h> #include <stdlib.h>
const FilterPlugin * const FilterPlugin *
filter_plugin_by_name(gcc_unused const char *name) noexcept filter_plugin_by_name([[maybe_unused]] const char *name) noexcept
{ {
assert(false); assert(false);
return nullptr; return nullptr;
} }
int main(int argc, gcc_unused char **argv) int main(int argc, [[maybe_unused]] char **argv)
try { try {
int volume; int volume;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
unsigned listen_port = 1234; unsigned listen_port = 1234;
int int
main(gcc_unused int argc, gcc_unused char **argv) main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
{ {
EventLoop event_loop; EventLoop event_loop;
const ShutdownHandler shutdown_handler(event_loop); const ShutdownHandler shutdown_handler(event_loop);
......
...@@ -137,7 +137,7 @@ try { ...@@ -137,7 +137,7 @@ try {
auto output = state.Convert({src.data, src.size}); auto output = state.Convert({src.data, src.size});
gcc_unused ssize_t ignored = write(1, output.data, [[maybe_unused]] ssize_t ignored = write(1, output.data,
output.size); output.size);
} }
...@@ -146,7 +146,7 @@ try { ...@@ -146,7 +146,7 @@ try {
if (output.IsNull()) if (output.IsNull())
break; break;
gcc_unused ssize_t ignored = write(1, output.data, [[maybe_unused]] ssize_t ignored = write(1, output.data,
output.size); output.size);
} }
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include <stdio.h> #include <stdio.h>
void void
mixer_set_volume(gcc_unused Mixer *mixer, mixer_set_volume([[maybe_unused]] Mixer *mixer,
gcc_unused unsigned volume) [[maybe_unused]] unsigned volume)
{ {
} }
......
...@@ -55,7 +55,7 @@ CopyGunzip(FILE *_dest, Path src_path) ...@@ -55,7 +55,7 @@ CopyGunzip(FILE *_dest, Path src_path)
} }
int int
main(int argc, gcc_unused char **argv) main(int argc, [[maybe_unused]] char **argv)
try { try {
if (argc != 2) { if (argc != 2) {
fprintf(stderr, "Usage: run_gunzip PATH\n"); fprintf(stderr, "Usage: run_gunzip PATH\n");
......
...@@ -59,7 +59,7 @@ CopyGzip(FILE *_dest, int src) ...@@ -59,7 +59,7 @@ CopyGzip(FILE *_dest, int src)
} }
int int
main(int argc, gcc_unused char **argv) main(int argc, [[maybe_unused]] char **argv)
try { try {
if (argc != 1) { if (argc != 1) {
fprintf(stderr, "Usage: run_gzip\n"); fprintf(stderr, "Usage: run_gzip\n");
......
...@@ -34,8 +34,8 @@ static constexpr unsigned IN_MASK = ...@@ -34,8 +34,8 @@ static constexpr unsigned IN_MASK =
|IN_MOVE|IN_MOVE_SELF; |IN_MOVE|IN_MOVE_SELF;
static void static void
my_inotify_callback(gcc_unused int wd, unsigned mask, my_inotify_callback([[maybe_unused]] int wd, unsigned mask,
const char *name, gcc_unused void *ctx) const char *name, [[maybe_unused]] void *ctx)
{ {
printf("mask=0x%x name='%s'\n", mask, name); printf("mask=0x%x name='%s'\n", mask, name);
} }
......
...@@ -57,7 +57,7 @@ try { ...@@ -57,7 +57,7 @@ try {
Compressor_Process_int16(compressor, Compressor_Process_int16(compressor,
(int16_t *)buffer, nbytes / 2); (int16_t *)buffer, nbytes / 2);
gcc_unused ssize_t ignored = write(1, buffer, nbytes); [[maybe_unused]] ssize_t ignored = write(1, buffer, nbytes);
} }
Compressor_delete(compressor); Compressor_delete(compressor);
......
...@@ -58,7 +58,7 @@ try { ...@@ -58,7 +58,7 @@ try {
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) { while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
auto dest = pv.Apply({buffer, size_t(nbytes)}); auto dest = pv.Apply({buffer, size_t(nbytes)});
gcc_unused ssize_t ignored = write(1, dest.data, dest.size); [[maybe_unused]] ssize_t ignored = write(1, dest.data, dest.size);
} }
pv.Close(); pv.Close();
......
...@@ -85,8 +85,8 @@ static const char *uri1 = "/foo/bar.ogg"; ...@@ -85,8 +85,8 @@ static const char *uri1 = "/foo/bar.ogg";
static const char *uri2 = "foo/bar.ogg"; static const char *uri2 = "foo/bar.ogg";
DetachedSong DetachedSong
DatabaseDetachSong(gcc_unused const Database &db, DatabaseDetachSong([[maybe_unused]] const Database &db,
gcc_unused const Storage *_storage, [[maybe_unused]] const Storage *_storage,
const char *uri) const char *uri)
{ {
if (strcmp(uri, uri2) == 0) if (strcmp(uri, uri2) == 0)
...@@ -119,7 +119,7 @@ Client::GetStorage() const noexcept ...@@ -119,7 +119,7 @@ Client::GetStorage() const noexcept
} }
void void
Client::AllowFile(gcc_unused Path path_fs) const Client::AllowFile([[maybe_unused]] Path path_fs) const
{ {
/* always fail, so a SongLoader with a non-nullptr /* always fail, so a SongLoader with a non-nullptr
Client pointer will be regarded "insecure", while one with Client pointer will be regarded "insecure", while one with
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
static uint8_t zero[256]; static uint8_t zero[256];
int int
main(gcc_unused int argc, gcc_unused char **argv) main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
try { try {
/* create the encoder */ /* create the encoder */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment