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
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
101 changed files with 226 additions and 234 deletions

View File

@ -150,13 +150,13 @@ Instance::OnDatabaseSongRemoved(const char *uri) noexcept
#ifdef ENABLE_NEIGHBOR_PLUGINS
void
Instance::FoundNeighbor(gcc_unused const NeighborInfo &info) noexcept
Instance::FoundNeighbor([[maybe_unused]] const NeighborInfo &info) noexcept
{
EmitIdle(IDLE_NEIGHBOR);
}
void
Instance::LostNeighbor(gcc_unused const NeighborInfo &info) noexcept
Instance::LostNeighbor([[maybe_unused]] const NeighborInfo &info) noexcept
{
EmitIdle(IDLE_NEIGHBOR);
}

View File

@ -46,7 +46,7 @@
#define LOG_DATE_BUF_SIZE 16
#define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1)
gcc_unused
[[maybe_unused]]
static constexpr Domain log_domain("log");
#ifndef ANDROID

View File

@ -216,8 +216,8 @@ static constexpr unsigned num_commands = std::size(commands);
gcc_pure
static bool
command_available(gcc_unused const Partition &partition,
gcc_unused const struct command *cmd) noexcept
command_available([[maybe_unused]] const Partition &partition,
[[maybe_unused]] const struct command *cmd) noexcept
{
#ifdef ENABLE_SQLITE
if (StringIsEqual(cmd->cmd, "sticker"))
@ -272,14 +272,14 @@ PrintUnavailableCommands(Response &r, unsigned permission) noexcept
/* don't be fooled, this is the command handler for "commands" command */
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(),
client.GetPermission());
}
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());
}

View File

@ -27,15 +27,15 @@
#include "util/StringAPI.hxx"
CommandResult
handle_close(gcc_unused Client &client, gcc_unused Request args,
gcc_unused Response &r)
handle_close([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
[[maybe_unused]] Response &r)
{
return CommandResult::FINISH;
}
CommandResult
handle_ping(gcc_unused Client &client, gcc_unused Request args,
gcc_unused Response &r)
handle_ping([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
[[maybe_unused]] Response &r)
{
return CommandResult::OK;
}

View File

@ -72,7 +72,7 @@ handle_unsubscribe(Client &client, Request args, Response &r)
}
CommandResult
handle_channels(Client &client, gcc_unused Request args, Response &r)
handle_channels(Client &client, [[maybe_unused]] Request args, Response &r)
{
assert(args.empty());
@ -92,7 +92,7 @@ handle_channels(Client &client, gcc_unused Request args, Response &r)
CommandResult
handle_read_messages(Client &client,
gcc_unused Request args, Response &r)
[[maybe_unused]] Request args, Response &r)
{
assert(args.empty());

View File

@ -34,7 +34,7 @@ neighbor_commands_available(const Instance &instance) noexcept
}
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 =
client.GetInstance().neighbors.get();

View File

@ -69,7 +69,7 @@ print_spl_list(Response &r, const PlaylistVector &list)
}
CommandResult
handle_urlhandlers(Client &client, gcc_unused Request args, Response &r)
handle_urlhandlers(Client &client, [[maybe_unused]] Request args, Response &r)
{
if (client.IsLocal())
r.Format("handler: file://\n");
@ -78,7 +78,7 @@ handle_urlhandlers(Client &client, gcc_unused Request args, Response &r)
}
CommandResult
handle_decoders(gcc_unused Client &client, gcc_unused Request args,
handle_decoders([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
Response &r)
{
decoder_list_print(r);
@ -86,8 +86,8 @@ handle_decoders(gcc_unused Client &client, gcc_unused Request args,
}
CommandResult
handle_kill(gcc_unused Client &client, gcc_unused Request request,
gcc_unused Response &r)
handle_kill([[maybe_unused]] Client &client, [[maybe_unused]] Request request,
[[maybe_unused]] Response &r)
{
return CommandResult::KILL;
}
@ -307,7 +307,7 @@ handle_update(Client &client, Request args, Response &r, bool discard)
}
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);
}
@ -360,14 +360,14 @@ handle_volume(Client &client, Request args, Response &r)
}
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());
return CommandResult::OK;
}
CommandResult
handle_config(Client &client, gcc_unused Request args, Response &r)
handle_config(Client &client, [[maybe_unused]] Request args, Response &r)
{
if (!client.IsLocal()) {
r.Error(ACK_ERROR_PERMISSION,

View File

@ -118,7 +118,7 @@ handle_outputset(Client &client, Request request, Response &response)
}
CommandResult
handle_devices(Client &client, gcc_unused Request args, Response &r)
handle_devices(Client &client, [[maybe_unused]] Request args, Response &r)
{
assert(args.empty());

View File

@ -60,7 +60,7 @@
#define COMMAND_STATUS_UPDATING_DB "updating_db"
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);
@ -69,7 +69,7 @@ handle_play(Client &client, Request args, gcc_unused Response &r)
}
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);
@ -78,21 +78,21 @@ handle_playid(Client &client, Request args, gcc_unused Response &r)
}
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();
return CommandResult::OK;
}
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());
return CommandResult::OK;
}
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();
@ -106,7 +106,7 @@ handle_pause(Client &client, Request args, gcc_unused Response &r)
}
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 &pc = partition.pc;
@ -216,7 +216,7 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
}
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();
@ -234,15 +234,15 @@ handle_next(Client &client, gcc_unused Request args, gcc_unused Response &r)
}
CommandResult
handle_previous(Client &client, gcc_unused Request args,
gcc_unused Response &r)
handle_previous(Client &client, [[maybe_unused]] Request args,
[[maybe_unused]] Response &r)
{
client.GetPartition().PlayPrevious();
return CommandResult::OK;
}
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);
client.GetPartition().SetRepeat(status);
@ -250,7 +250,7 @@ handle_repeat(Client &client, Request args, gcc_unused Response &r)
}
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());
client.GetPartition().SetSingle(new_mode);
@ -258,7 +258,7 @@ handle_single(Client &client, Request args, gcc_unused Response &r)
}
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);
client.GetPartition().SetConsume(status);
@ -266,7 +266,7 @@ handle_consume(Client &client, Request args, gcc_unused Response &r)
}
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);
auto &partition = client.GetPartition();
@ -276,15 +276,15 @@ handle_random(Client &client, Request args, gcc_unused Response &r)
}
CommandResult
handle_clearerror(Client &client, gcc_unused Request args,
gcc_unused Response &r)
handle_clearerror(Client &client, [[maybe_unused]] Request args,
[[maybe_unused]] Response &r)
{
client.GetPlayerControl().LockClearError();
return CommandResult::OK;
}
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);
SongTime seek_time = args.ParseSongTime(1);
@ -294,7 +294,7 @@ handle_seek(Client &client, Request args, gcc_unused Response &r)
}
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);
SongTime seek_time = args.ParseSongTime(1);
@ -304,7 +304,7 @@ handle_seekid(Client &client, Request args, gcc_unused Response &r)
}
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();
bool relative = *p == '+' || *p == '-';
@ -315,7 +315,7 @@ handle_seekcur(Client &client, Request args, gcc_unused Response &r)
}
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)};
client.GetPlayerControl().SetCrossFade(duration);
@ -323,7 +323,7 @@ handle_crossfade(Client &client, Request args, gcc_unused Response &r)
}
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);
client.GetPlayerControl().SetMixRampDb(db);
@ -331,7 +331,7 @@ handle_mixrampdb(Client &client, Request args, gcc_unused Response &r)
}
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)};
client.GetPlayerControl().SetMixRampDelay(delay_secs);
@ -349,7 +349,7 @@ handle_replay_gain_mode(Client &client, Request args, Response &)
}
CommandResult
handle_replay_gain_status(Client &client, gcc_unused Request args,
handle_replay_gain_status(Client &client, [[maybe_unused]] Request args,
Response &r)
{
r.Format("replay_gain_mode: %s\n",

View File

@ -60,14 +60,14 @@ print_spl_list(Response &r, const PlaylistVector &list)
}
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());
return CommandResult::OK;
}
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(),
&client
@ -132,7 +132,7 @@ handle_listplaylistinfo(Client &client, Request args, Response &r)
}
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();
@ -141,7 +141,7 @@ handle_rm(gcc_unused Client &client, Request args, gcc_unused Response &r)
}
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 new_name = args[1];
@ -151,8 +151,8 @@ handle_rename(gcc_unused Client &client, Request args, gcc_unused Response &r)
}
CommandResult
handle_playlistdelete(gcc_unused Client &client,
Request args, gcc_unused Response &r)
handle_playlistdelete([[maybe_unused]] Client &client,
Request args, [[maybe_unused]] Response &r)
{
const char *const name = args[0];
unsigned from = args.ParseUnsigned(1);
@ -162,8 +162,8 @@ handle_playlistdelete(gcc_unused Client &client,
}
CommandResult
handle_playlistmove(gcc_unused Client &client,
Request args, gcc_unused Response &r)
handle_playlistmove([[maybe_unused]] Client &client,
Request args, [[maybe_unused]] Response &r)
{
const char *const name = args.front();
unsigned from = args.ParseUnsigned(1);
@ -174,8 +174,8 @@ handle_playlistmove(gcc_unused Client &client,
}
CommandResult
handle_playlistclear(gcc_unused Client &client,
Request args, gcc_unused Response &r)
handle_playlistclear([[maybe_unused]] Client &client,
Request args, [[maybe_unused]] Response &r)
{
const char *const name = args.front();
@ -184,7 +184,7 @@ handle_playlistclear(gcc_unused Client &client,
}
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 uri = args[1];
@ -209,7 +209,7 @@ handle_playlistadd(Client &client, Request args, gcc_unused Response &r)
}
CommandResult
handle_listplaylists(gcc_unused Client &client, gcc_unused Request args,
handle_listplaylists([[maybe_unused]] Client &client, [[maybe_unused]] Request args,
Response &r)
{
print_spl_list(r, ListPlaylistFiles());

View File

@ -51,7 +51,7 @@ AddUri(Client &client, const LocatedUri &uri)
static CommandResult
AddDatabaseSelection(Client &client, const char *uri,
gcc_unused Response &r)
[[maybe_unused]] Response &r)
{
#ifdef ENABLE_DATABASE
auto &partition = client.GetPartition();
@ -179,7 +179,7 @@ handle_rangeid(Client &client, Request args, Response &r)
}
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);
client.GetPartition().DeleteRange(range.start, range.end);
@ -187,7 +187,7 @@ handle_delete(Client &client, Request args, gcc_unused Response &r)
}
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);
client.GetPartition().DeleteId(id);
@ -195,14 +195,14 @@ handle_deleteid(Client &client, Request args, gcc_unused Response &r)
}
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());
return CommandResult::OK;
}
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());
client.GetPartition().Shuffle(range.start, range.end);
@ -210,7 +210,7 @@ handle_shuffle(gcc_unused Client &client, Request args, gcc_unused Response &r)
}
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();
return CommandResult::OK;
@ -291,7 +291,7 @@ handle_playlistsearch(Client &client, Request args, Response &r)
}
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);
args.shift();
@ -307,7 +307,7 @@ handle_prio(Client &client, Request args, gcc_unused Response &r)
}
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);
args.shift();
@ -323,7 +323,7 @@ handle_prioid(Client &client, Request args, gcc_unused Response &r)
}
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);
int to = args.ParseInt(1);
@ -332,7 +332,7 @@ handle_move(Client &client, Request args, gcc_unused Response &r)
}
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);
int to = args.ParseInt(1);
@ -341,7 +341,7 @@ handle_moveid(Client &client, Request args, gcc_unused Response &r)
}
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 song2 = args.ParseUnsigned(1);
@ -350,7 +350,7 @@ handle_swap(Client &client, Request args, gcc_unused Response &r)
}
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 id2 = args.ParseUnsigned(1);

View File

@ -143,7 +143,7 @@ print_storage_uri(Client &client, Response &r, const Storage &storage)
}
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;
if (_composite == nullptr) {

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

View File

@ -53,7 +53,7 @@ static void flacPrintErroredState(FLAC__StreamDecoderState 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)
{
auto &fd = *(FlacDecoder *)vdata;
@ -307,7 +307,7 @@ flac_decode(DecoderClient &client, InputStream &input_stream)
}
static bool
oggflac_init(gcc_unused const ConfigBlock &block)
oggflac_init([[maybe_unused]] const ConfigBlock &block)
{
return !!FLAC_API_SUPPORTS_OGG_FLAC;
}

View File

@ -98,7 +98,7 @@ FlacInput::Error(FLAC__StreamDecoderErrorStatus status)
}
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,
void *client_data)
{
@ -108,7 +108,7 @@ FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder,
}
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)
{
auto *i = (FlacInput *)client_data;
@ -117,7 +117,7 @@ FlacInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder,
}
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)
{
auto *i = (FlacInput *)client_data;
@ -126,7 +126,7 @@ FlacInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder,
}
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)
{
auto *i = (FlacInput *)client_data;
@ -135,7 +135,7 @@ FlacInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder,
}
FLAC__bool
FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FlacInput::Eof([[maybe_unused]] const FLAC__StreamDecoder *flac_decoder,
void *client_data)
{
auto *i = (FlacInput *)client_data;
@ -144,7 +144,7 @@ FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder,
}
void
FlacInput::Error(gcc_unused const FLAC__StreamDecoder *decoder,
FlacInput::Error([[maybe_unused]] const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status, void *client_data)
{
auto *i = (FlacInput *)client_data;

View File

@ -196,7 +196,7 @@ fluidsynth_file_decode(DecoderClient &client, Path path_fs)
static bool
fluidsynth_scan_file(Path path_fs,
gcc_unused TagHandler &handler) noexcept
[[maybe_unused]] TagHandler &handler) noexcept
{
return fluid_is_midifile(path_fs.c_str());
}

View File

@ -62,7 +62,7 @@ static int gme_accuracy;
#endif
static bool
gme_plugin_init(gcc_unused const ConfigBlock &block)
gme_plugin_init([[maybe_unused]] const ConfigBlock &block)
{
#if GME_VERSION >= 0x000600
auto accuracy = block.GetBlockParam("accuracy");

View File

@ -37,7 +37,7 @@
static constexpr Domain mpg123_domain("mpg123");
static bool
mpd_mpg123_init(gcc_unused const ConfigBlock &block)
mpd_mpg123_init([[maybe_unused]] const ConfigBlock &block)
{
mpg123_init();

View File

@ -64,7 +64,7 @@ IsOpusTags(const ogg_packet &packet) noexcept
}
bool
mpd_opus_init(gcc_unused const ConfigBlock &block)
mpd_opus_init([[maybe_unused]] const ConfigBlock &block)
{
LogDebug(opus_domain, opus_get_version_string());

View File

@ -34,7 +34,7 @@
static constexpr Domain sndfile_domain("sndfile");
static bool
sndfile_init(gcc_unused const ConfigBlock &block)
sndfile_init([[maybe_unused]] const ConfigBlock &block)
{
LogDebug(sndfile_domain, sf_version_string());
return true;
@ -109,9 +109,9 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
}
static sf_count_t
sndfile_vio_write(gcc_unused const void *ptr,
gcc_unused sf_count_t count,
gcc_unused void *user_data)
sndfile_vio_write([[maybe_unused]] const void *ptr,
[[maybe_unused]] sf_count_t count,
[[maybe_unused]] void *user_data)
{
/* no writing! */
return -1;

View File

@ -311,7 +311,7 @@ VorbisDecoder::OnOggEnd()
/* public */
static bool
vorbis_init(gcc_unused const ConfigBlock &block)
vorbis_init([[maybe_unused]] const ConfigBlock &block)
{
#ifndef HAVE_TREMOR
LogDebug(vorbis_domain, vorbis_version_string());

View File

@ -143,7 +143,7 @@ format_samples_int(void *buffer, uint32_t count)
* No conversion necessary.
*/
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 */
}

View File

@ -84,7 +84,7 @@ public:
*
* @param tag the tag object
*/
virtual void SendTag(gcc_unused const Tag &tag) {
virtual void SendTag([[maybe_unused]] const Tag &tag) {
}
/**

View File

@ -69,8 +69,8 @@ private:
static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *,
const FLAC__byte data[],
size_t bytes,
gcc_unused unsigned samples,
gcc_unused unsigned current_frame,
[[maybe_unused]] unsigned samples,
[[maybe_unused]] unsigned current_frame,
void *client_data) noexcept {
auto &encoder = *(FlacEncoder *)client_data;
encoder.output_buffer.Append((const uint8_t *)data, bytes);

View File

@ -49,7 +49,7 @@ public:
};
static PreparedEncoder *
null_encoder_init(gcc_unused const ConfigBlock &block)
null_encoder_init([[maybe_unused]] const ConfigBlock &block)
{
return new PreparedNullEncoder();
}

View File

@ -98,7 +98,7 @@ fill_wave_header(WaveHeader *header, int channels, int bits,
}
static PreparedEncoder *
wave_encoder_init(gcc_unused const ConfigBlock &block)
wave_encoder_init([[maybe_unused]] const ConfigBlock &block)
{
return new PreparedWaveEncoder();
}

View File

@ -271,7 +271,7 @@ EventLoop::HandleDeferred() noexcept
}
bool
EventLoop::OnSocketReady(gcc_unused unsigned flags) noexcept
EventLoop::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{
assert(IsInside());

View File

@ -89,7 +89,7 @@ public:
return epoll.Remove(fd);
}
bool Abandon(gcc_unused int fd) noexcept {
bool Abandon([[maybe_unused]] int fd) noexcept {
// Nothing to do in this implementation.
// Closed descriptors are automatically unregistered.
return true;

View File

@ -161,7 +161,7 @@ ServerSocket::OneServerSocket::Accept() noexcept
}
bool
ServerSocket::OneServerSocket::OnSocketReady(gcc_unused unsigned flags) noexcept
ServerSocket::OneServerSocket::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
{
Accept();
return true;

View File

@ -43,7 +43,7 @@ public:
observer.proxy = nullptr;
}
void Clear(gcc_unused Proxy *_child) noexcept {
void Clear([[maybe_unused]] Proxy *_child) noexcept {
assert(child == _child);
child = nullptr;
}

View File

@ -53,7 +53,7 @@ public:
};
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>();
}

View File

@ -38,7 +38,7 @@ public:
};
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>();
}

View File

@ -81,7 +81,7 @@ FileOutputStream::Open()
#ifdef _WIN32
inline void
FileOutputStream::OpenCreate(gcc_unused bool visible)
FileOutputStream::OpenCreate([[maybe_unused]] bool visible)
{
handle = CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr,
CREATE_ALWAYS,

View File

@ -69,7 +69,7 @@ InputStream::CheapSeeking() const noexcept
}
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");
}

View File

@ -110,7 +110,7 @@ protected:
InvalidateSockets();
}
void DoSeek(gcc_unused offset_type new_offset) override {
void DoSeek([[maybe_unused]] offset_type new_offset) override {
/* unreachable because seekable==false */
SeekDone();
}

View File

@ -108,7 +108,7 @@ CurlGlobal::CurlGlobal(EventLoop &_loop)
}
int
CurlSocket::SocketFunction(gcc_unused CURL *easy,
CurlSocket::SocketFunction([[maybe_unused]] CURL *easy,
curl_socket_t s, int action,
void *userp, void *socketp) noexcept
{
@ -230,7 +230,7 @@ CurlGlobal::UpdateTimeout(long timeout_ms) noexcept
}
int
CurlGlobal::TimerFunction(gcc_unused CURLM *_multi, long timeout_ms,
CurlGlobal::TimerFunction([[maybe_unused]] CURLM *_multi, long timeout_ms,
void *userp) noexcept
{
auto &global = *(CurlGlobal *)userp;

View File

@ -47,7 +47,7 @@ FfmpegImportLogLevel(int level) noexcept
}
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;

View File

@ -172,7 +172,7 @@ NfsConnection::CancellableCallback::Callback(int err, void *data) noexcept
void
NfsConnection::CancellableCallback::Callback(int err,
gcc_unused struct nfs_context *nfs,
[[maybe_unused]] struct nfs_context *nfs,
void *data,
void *private_data) noexcept
{
@ -551,8 +551,8 @@ NfsConnection::OnSocketReady(unsigned flags) noexcept
}
inline void
NfsConnection::MountCallback(int status, gcc_unused nfs_context *nfs,
gcc_unused void *data) noexcept
NfsConnection::MountCallback(int status, [[maybe_unused]] nfs_context *nfs,
[[maybe_unused]] void *data) noexcept
{
assert(GetEventLoop().IsInside());
assert(context == nfs);

View File

@ -27,11 +27,11 @@
#include <string.h>
static void
mpd_smbc_get_auth_data(gcc_unused const char *srv,
gcc_unused const char *shr,
char *wg, gcc_unused int wglen,
char *un, gcc_unused int unlen,
char *pw, gcc_unused int pwlen)
mpd_smbc_get_auth_data([[maybe_unused]] const char *srv,
[[maybe_unused]] const char *shr,
char *wg, [[maybe_unused]] int wglen,
char *un, [[maybe_unused]] int unlen,
char *pw, [[maybe_unused]] int pwlen)
{
// TODO: implement
strcpy(wg, "WORKGROUP");

View File

@ -54,7 +54,7 @@ Bind(sqlite3_stmt *stmt, unsigned i, const char *value)
template<typename... Args>
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));
}

View File

@ -32,7 +32,7 @@ CountNameValuePairs() noexcept
template<typename... Args>
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
{
return 1 + CountNameValuePairs(args...);

View File

@ -119,7 +119,7 @@ FlacIOEof(FLAC__IOHandle handle)
}
static int
FlacIOClose(gcc_unused FLAC__IOHandle handle)
FlacIOClose([[maybe_unused]] FLAC__IOHandle handle)
{
/* no-op because the libFLAC caller is responsible for closing
the #InputStream */

View File

@ -173,7 +173,7 @@ AlsaMixer::Configure(const ConfigBlock &block)
}
static Mixer *
alsa_mixer_init(EventLoop &event_loop, gcc_unused AudioOutput &ao,
alsa_mixer_init(EventLoop &event_loop, [[maybe_unused]] AudioOutput &ao,
MixerListener &listener,
const ConfigBlock &block)
{

View File

@ -47,9 +47,9 @@ public:
};
static Mixer *
haiku_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao,
haiku_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return new HaikuMixer((HaikuOutput &)ao, listener);
}

View File

@ -49,10 +49,10 @@ public:
};
static Mixer *
null_mixer_init(gcc_unused EventLoop &event_loop,
gcc_unused AudioOutput &ao,
null_mixer_init([[maybe_unused]] EventLoop &event_loop,
[[maybe_unused]] AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return new NullMixer(listener);
}

View File

@ -54,9 +54,9 @@ OSXMixer::SetVolume(unsigned new_volume)
}
static Mixer *
osx_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao,
osx_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
OSXOutput &osxo = (OSXOutput &)ao;
return new OSXMixer(osxo, listener);

View File

@ -97,8 +97,8 @@ OssMixer::Configure(const ConfigBlock &block)
}
static Mixer *
oss_mixer_init(gcc_unused EventLoop &event_loop,
gcc_unused AudioOutput &ao,
oss_mixer_init([[maybe_unused]] EventLoop &event_loop,
[[maybe_unused]] AudioOutput &ao,
MixerListener &listener,
const ConfigBlock &block)
{

View File

@ -104,7 +104,7 @@ PulseMixer::VolumeCallback(const pa_sink_input_info *i, int eol)
* value.
*/
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)
{
auto *pm = (PulseMixer *)userdata;
@ -133,7 +133,7 @@ PulseMixer::Update(pa_context *context, pa_stream *stream)
}
void
pulse_mixer_on_connect(gcc_unused PulseMixer &pm,
pulse_mixer_on_connect([[maybe_unused]] PulseMixer &pm,
struct pa_context *context)
{
pa_operation *o;
@ -182,7 +182,7 @@ parse_volume_scale_factor(const char *value) {
}
static Mixer *
pulse_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao,
pulse_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener,
const ConfigBlock &block)
{

View File

@ -45,10 +45,10 @@ public:
};
static Mixer *
sndio_mixer_init(gcc_unused EventLoop &event_loop,
sndio_mixer_init([[maybe_unused]] EventLoop &event_loop,
AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return new SndioMixer((SndioOutput &)ao, listener);
}

View File

@ -57,10 +57,10 @@ public:
};
static Mixer *
software_mixer_init(gcc_unused EventLoop &event_loop,
gcc_unused AudioOutput &ao,
software_mixer_init([[maybe_unused]] EventLoop &event_loop,
[[maybe_unused]] AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return new SoftwareMixer(listener);
}

View File

@ -63,9 +63,9 @@ winmm_volume_encode(int volume)
}
static Mixer *
winmm_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao,
winmm_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao,
MixerListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return new WinmmMixer((WinmmOutput &)ao, listener);
}

View File

@ -252,9 +252,9 @@ SmbclientNeighborExplorer::ThreadFunc() noexcept
}
static std::unique_ptr<NeighborExplorer>
smbclient_neighbor_create(gcc_unused EventLoop &loop,
smbclient_neighbor_create([[maybe_unused]] EventLoop &loop,
NeighborListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
SmbclientInit();

View File

@ -259,7 +259,7 @@ UdisksNeighborExplorer::HandleMessage(DBusConnection *connection,
static std::unique_ptr<NeighborExplorer>
udisks_neighbor_create(EventLoop &event_loop,
NeighborListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return std::make_unique<UdisksNeighborExplorer>(event_loop, listener);
}

View File

@ -127,7 +127,7 @@ UpnpNeighborExplorer::LostUPnP(const ContentDirectoryService &service)
static std::unique_ptr<NeighborExplorer>
upnp_neighbor_create(EventLoop &event_loop,
NeighborListener &listener,
gcc_unused const ConfigBlock &block)
[[maybe_unused]] const ConfigBlock &block)
{
return std::make_unique<UpnpNeighborExplorer>(event_loop, listener);
}

View File

@ -23,8 +23,8 @@
#include <stdexcept>
void
AudioOutput::SetAttribute(gcc_unused std::string &&name,
gcc_unused std::string &&value)
AudioOutput::SetAttribute([[maybe_unused]] std::string &&name,
[[maybe_unused]] std::string &&value)
{
throw std::invalid_argument("Unsupported attribute");
}

View File

@ -76,7 +76,7 @@ public:
const MusicChunk *Get() noexcept;
void Consume(gcc_unused const MusicChunk &_chunk) {
void Consume([[maybe_unused]] const MusicChunk &_chunk) {
assert(chunk != nullptr);
assert(chunk == &_chunk);
@ -86,7 +86,7 @@ public:
gcc_pure
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(consumed);
chunk = nullptr;

View File

@ -81,9 +81,9 @@ private:
std::chrono::steady_clock::duration Delay() const noexcept override;
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,
gcc_unused const media_raw_audio_format& _format);
[[maybe_unused]] const media_raw_audio_format& _format);
void SendTag(const Tag &tag) override;
};
@ -154,7 +154,7 @@ HaikuOutput::_FillBuffer(void* cookie, void* buffer, size_t size,
void
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;

View File

@ -53,7 +53,7 @@ private:
: 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 (!timer->IsStarted())
timer->Start();

View File

@ -710,9 +710,9 @@ osx_output_set_device(OSXOutput *oo)
*/
static OSStatus
osx_render(void *vdata,
gcc_unused AudioUnitRenderActionFlags *io_action_flags,
gcc_unused const AudioTimeStamp *in_timestamp,
gcc_unused UInt32 in_bus_number,
[[maybe_unused]] AudioUnitRenderActionFlags *io_action_flags,
[[maybe_unused]] const AudioTimeStamp *in_timestamp,
[[maybe_unused]] UInt32 in_bus_number,
UInt32 in_number_frames,
AudioBufferList *buffer_list)
{

View File

@ -57,7 +57,7 @@ PipeOutput::PipeOutput(const ConfigBlock &block)
}
inline void
PipeOutput::Open(gcc_unused AudioFormat &audio_format)
PipeOutput::Open([[maybe_unused]] AudioFormat &audio_format)
{
fh = popen(cmd.c_str(), "w");
if (fh == nullptr)

View File

@ -62,7 +62,7 @@ class PulseOutput final : AudioOutput {
public:
void SetMixer(PulseMixer &_mixer);
void ClearMixer(gcc_unused PulseMixer &old_mixer) {
void ClearMixer([[maybe_unused]] PulseMixer &old_mixer) {
assert(mixer == &old_mixer);
mixer = nullptr;
@ -277,8 +277,8 @@ pulse_wait_for_operation(struct pa_threaded_mainloop *mainloop,
* the caller thread, to wake pulse_wait_for_operation() up.
*/
static void
pulse_output_stream_success_cb(gcc_unused pa_stream *s,
gcc_unused int success, void *userdata)
pulse_output_stream_success_cb([[maybe_unused]] pa_stream *s,
[[maybe_unused]] int success, void *userdata)
{
PulseOutput &po = *(PulseOutput *)userdata;
@ -342,7 +342,7 @@ PulseOutput::OnServerLayoutChanged(pa_subscription_event_type_t t,
}
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,
uint32_t idx, void *userdata)
{
@ -508,7 +508,7 @@ PulseOutput::WaitConnection()
}
inline void
PulseOutput::OnStreamSuspended(gcc_unused pa_stream *_stream)
PulseOutput::OnStreamSuspended([[maybe_unused]] pa_stream *_stream)
{
assert(_stream == stream || stream == nullptr);
assert(mainloop != nullptr);
@ -574,7 +574,7 @@ PulseOutput::OnStreamWrite(size_t nbytes)
}
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)
{
PulseOutput &po = *(PulseOutput *)userdata;

View File

@ -121,7 +121,7 @@ HttpdOutput::OnDeferredBroadcast() noexcept
void
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
connected */

View File

@ -111,7 +111,7 @@ private:
* been consumed. It synthesises and enqueues the next
* buffer.
*/
static void PlayedCallback(gcc_unused SLAndroidSimpleBufferQueueItf caller,
static void PlayedCallback([[maybe_unused]] SLAndroidSimpleBufferQueueItf caller,
void *pContext)
{
SlesOutput &sles = *(SlesOutput *)pContext;

View File

@ -82,7 +82,7 @@ ExtractCuesheetTagHandler::OnPair(StringView name, StringView value) noexcept
static std::unique_ptr<SongEnumerator>
embcue_playlist_open_uri(const char *uri,
gcc_unused Mutex &mutex)
[[maybe_unused]] Mutex &mutex)
{
if (!PathTraitsUTF8::IsAbsolute(uri))
/* only local files supported */

View File

@ -79,7 +79,7 @@ static constexpr struct tag_table xspf_tag_elements[] = {
static void XMLCALL
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;
parser->value.clear();

View File

@ -36,7 +36,7 @@ MemoryStorageDirectoryReader::Read() noexcept
}
StorageFileInfo
MemoryStorageDirectoryReader::GetInfo(gcc_unused bool follow)
MemoryStorageDirectoryReader::GetInfo([[maybe_unused]] bool follow)
{
assert(!first);
assert(!entries.empty());

View File

@ -22,7 +22,7 @@
#include "fs/Traits.hxx"
AllocatedPath
Storage::MapFS(gcc_unused const char *uri_utf8) const noexcept
Storage::MapFS([[maybe_unused]] const char *uri_utf8) const noexcept
{
return nullptr;
}

View File

@ -315,7 +315,7 @@ private:
/* virtual methods from CommonExpatParser */
void StartElement(const XML_Char *name,
gcc_unused const XML_Char **attrs) final {
[[maybe_unused]] const XML_Char **attrs) final {
switch (state) {
case State::ROOT:
if (strcmp(name, "DAV:|response") == 0)
@ -447,7 +447,7 @@ protected:
};
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

View File

@ -288,7 +288,7 @@ protected:
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);
}
};
@ -356,7 +356,7 @@ protected:
connection.OpenDirectory(path, *this);
}
void HandleResult(gcc_unused unsigned status,
void HandleResult([[maybe_unused]] unsigned status,
void *data) noexcept override {
auto *const dir = (struct nfsdir *)data;

View File

@ -117,7 +117,7 @@ GetInfo(const char *path)
}
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);
return ::GetInfo(mapped.c_str());
@ -172,14 +172,14 @@ SmbclientDirectoryReader::Read() noexcept
}
StorageFileInfo
SmbclientDirectoryReader::GetInfo(gcc_unused bool follow)
SmbclientDirectoryReader::GetInfo([[maybe_unused]] bool follow)
{
const std::string path = PathTraitsUTF8::Build(base.c_str(), name);
return ::GetInfo(path.c_str());
}
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://"))
return nullptr;

View File

@ -56,6 +56,6 @@ EventFD::Write() noexcept
assert(fd.IsDefined());
static constexpr eventfd_t value = 1;
gcc_unused ssize_t nbytes =
[[maybe_unused]] ssize_t nbytes =
fd.Write(&value, sizeof(value));
}

View File

@ -85,7 +85,7 @@ EventPipe::Write() noexcept
#ifdef _WIN32
send(fds[1], "", 1, 0);
#else
gcc_unused ssize_t nbytes = write(fds[1], "", 1);
[[maybe_unused]] ssize_t nbytes = write(fds[1], "", 1);
#endif
}

View File

@ -41,7 +41,7 @@ NullTagHandler::OnPicture(const char *, ConstBuffer<void>) noexcept
}
void
NullTagHandler::OnAudioFormat(gcc_unused AudioFormat af) noexcept
NullTagHandler::OnAudioFormat([[maybe_unused]] AudioFormat af) noexcept
{
}

View File

@ -124,7 +124,7 @@ public:
explicit NullTagHandler(unsigned _want_mask) noexcept
: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 OnPair(StringView key, StringView value) noexcept override;
void OnAudioFormat(AudioFormat af) noexcept override;

View File

@ -58,7 +58,7 @@ SetThreadName(const char *name) noexcept
template<typename... Args>
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
SetThreadName(StringFormat<16>(fmt, args...));

View File

@ -74,7 +74,6 @@
#define gcc_printf(a,b) __attribute__((format(printf, a, b)))
#define gcc_pure __attribute__((pure))
#define gcc_sentinel __attribute__((sentinel))
#define gcc_unused __attribute__((unused))
#define gcc_nonnull(...) __attribute__((nonnull(__VA_ARGS__)))
#define gcc_nonnull_all __attribute__((nonnull))
@ -101,7 +100,6 @@
#define gcc_printf(a,b)
#define gcc_pure
#define gcc_sentinel
#define gcc_unused
#define gcc_nonnull(...)
#define gcc_nonnull_all
@ -161,12 +159,6 @@
#define __has_feature(x) 0
#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__)
#define gcc_unreachable() __builtin_unreachable()
#else

View File

@ -204,7 +204,7 @@ struct CheckSequenceUTF8 {
template<>
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;
}
};

View File

@ -64,8 +64,8 @@ service_notify_status(DWORD status_code)
}
static DWORD WINAPI
service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
gcc_unused void *event_data, gcc_unused void *context)
service_dispatcher([[maybe_unused]] DWORD control, [[maybe_unused]] DWORD event_type,
[[maybe_unused]] void *event_data, [[maybe_unused]] void *context)
{
switch (control) {
case SERVICE_CONTROL_SHUTDOWN:
@ -78,7 +78,7 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
}
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 =
RegisterServiceCtrlHandlerEx(service_name,

View File

@ -49,7 +49,7 @@ AvahiRegisterService(AvahiClient *c);
static void
AvahiGroupCallback(AvahiEntryGroup *g,
AvahiEntryGroupState state,
gcc_unused void *userdata)
[[maybe_unused]] void *userdata)
{
assert(g != nullptr);
@ -149,7 +149,7 @@ AvahiRegisterService(AvahiClient *c)
/* Callback when avahi changes state */
static void
MyAvahiClientCallback(AvahiClient *c, AvahiClientState state,
gcc_unused void *userdata)
[[maybe_unused]] void *userdata)
{
assert(c != nullptr);

View File

@ -48,7 +48,7 @@ public:
protected:
/* virtual methods from class SocketMonitor */
bool OnSocketReady(gcc_unused unsigned flags) noexcept override {
bool OnSocketReady([[maybe_unused]] unsigned flags) noexcept override {
DNSServiceProcessResult(service_ref);
return true;
}
@ -57,12 +57,12 @@ protected:
static BonjourMonitor *bonjour_monitor;
static void
dnsRegisterCallback(gcc_unused DNSServiceRef sdRef,
gcc_unused DNSServiceFlags flags,
dnsRegisterCallback([[maybe_unused]] DNSServiceRef sdRef,
[[maybe_unused]] DNSServiceFlags flags,
DNSServiceErrorType errorCode, const char *name,
gcc_unused const char *regtype,
gcc_unused const char *domain,
gcc_unused void *context)
[[maybe_unused]] const char *regtype,
[[maybe_unused]] const char *domain,
[[maybe_unused]] void *context)
{
if (errorCode != kDNSServiceErr_NoError) {
LogError(bonjour_domain,

View File

@ -50,7 +50,7 @@ static constexpr Domain zeroconf_domain("zeroconf");
static int zeroconfEnabled;
void
ZeroconfInit(const ConfigData &config, gcc_unused EventLoop &loop)
ZeroconfInit(const ConfigData &config, [[maybe_unused]] EventLoop &loop)
{
const char *serviceName;

View File

@ -86,26 +86,26 @@ DumpDecoderClient::Read(InputStream &is, void *buffer, size_t length) noexcept
}
void
DumpDecoderClient::SubmitTimestamp(gcc_unused FloatDuration t) noexcept
DumpDecoderClient::SubmitTimestamp([[maybe_unused]] FloatDuration t) noexcept
{
}
DecoderCommand
DumpDecoderClient::SubmitData(gcc_unused InputStream *is,
DumpDecoderClient::SubmitData([[maybe_unused]] InputStream *is,
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) {
prev_kbit_rate = 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();
}
DecoderCommand
DumpDecoderClient::SubmitTag(gcc_unused InputStream *is,
DumpDecoderClient::SubmitTag([[maybe_unused]] InputStream *is,
Tag &&tag) noexcept
{
fprintf(stderr, "TAG: duration=%f\n", tag.duration.ToDoubleS());
@ -139,7 +139,7 @@ DumpDecoderClient::SubmitReplayGain(const ReplayGainInfo *rgi) noexcept
}
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",
mix_ramp.GetStart(), mix_ramp.GetEnd());

View File

@ -22,7 +22,7 @@
#include "util/Compiler.h"
inline void
BuildTag(gcc_unused TagBuilder &tag) noexcept
BuildTag([[maybe_unused]] TagBuilder &tag) noexcept
{
}

View File

@ -34,7 +34,7 @@
#endif
static bool
MyApeTagCallback(gcc_unused unsigned long flags,
MyApeTagCallback([[maybe_unused]] unsigned long flags,
const char *key, StringView value)
{
if ((flags & (0x3 << 1)) == 0)

View File

@ -30,13 +30,13 @@
#include <stdlib.h>
const FilterPlugin *
filter_plugin_by_name(gcc_unused const char *name) noexcept
filter_plugin_by_name([[maybe_unused]] const char *name) noexcept
{
assert(false);
return nullptr;
}
int main(int argc, gcc_unused char **argv)
int main(int argc, [[maybe_unused]] char **argv)
try {
int volume;

View File

@ -26,7 +26,7 @@
unsigned listen_port = 1234;
int
main(gcc_unused int argc, gcc_unused char **argv)
main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
{
EventLoop event_loop;
const ShutdownHandler shutdown_handler(event_loop);

View File

@ -137,7 +137,7 @@ try {
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);
}
@ -146,7 +146,7 @@ try {
if (output.IsNull())
break;
gcc_unused ssize_t ignored = write(1, output.data,
[[maybe_unused]] ssize_t ignored = write(1, output.data,
output.size);
}

View File

@ -42,8 +42,8 @@
#include <stdio.h>
void
mixer_set_volume(gcc_unused Mixer *mixer,
gcc_unused unsigned volume)
mixer_set_volume([[maybe_unused]] Mixer *mixer,
[[maybe_unused]] unsigned volume)
{
}

View File

@ -55,7 +55,7 @@ CopyGunzip(FILE *_dest, Path src_path)
}
int
main(int argc, gcc_unused char **argv)
main(int argc, [[maybe_unused]] char **argv)
try {
if (argc != 2) {
fprintf(stderr, "Usage: run_gunzip PATH\n");

View File

@ -59,7 +59,7 @@ CopyGzip(FILE *_dest, int src)
}
int
main(int argc, gcc_unused char **argv)
main(int argc, [[maybe_unused]] char **argv)
try {
if (argc != 1) {
fprintf(stderr, "Usage: run_gzip\n");

View File

@ -34,8 +34,8 @@ static constexpr unsigned IN_MASK =
|IN_MOVE|IN_MOVE_SELF;
static void
my_inotify_callback(gcc_unused int wd, unsigned mask,
const char *name, gcc_unused void *ctx)
my_inotify_callback([[maybe_unused]] int wd, unsigned mask,
const char *name, [[maybe_unused]] void *ctx)
{
printf("mask=0x%x name='%s'\n", mask, name);
}

View File

@ -57,7 +57,7 @@ try {
Compressor_Process_int16(compressor,
(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);

View File

@ -58,7 +58,7 @@ try {
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
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();

View File

@ -85,8 +85,8 @@ static const char *uri1 = "/foo/bar.ogg";
static const char *uri2 = "foo/bar.ogg";
DetachedSong
DatabaseDetachSong(gcc_unused const Database &db,
gcc_unused const Storage *_storage,
DatabaseDetachSong([[maybe_unused]] const Database &db,
[[maybe_unused]] const Storage *_storage,
const char *uri)
{
if (strcmp(uri, uri2) == 0)
@ -119,7 +119,7 @@ Client::GetStorage() const noexcept
}
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
Client pointer will be regarded "insecure", while one with

Some files were not shown because too many files have changed in this diff Show More