aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AllCommands.cxx19
-rw-r--r--src/ClientMessage.cxx3
-rw-r--r--src/ClientWrite.cxx1
-rw-r--r--src/CommandLine.cxx6
-rw-r--r--src/ConfigPath.cxx4
-rw-r--r--src/ConfigQuark.hxx4
-rw-r--r--src/CrossFade.cxx2
-rw-r--r--src/DatabaseCommands.cxx4
-rw-r--r--src/DatabaseLock.hxx3
-rw-r--r--src/DatabaseSave.cxx2
-rw-r--r--src/DecoderAPI.cxx14
-rw-r--r--src/DecoderError.hxx4
-rw-r--r--src/DespotifyUtils.cxx5
-rw-r--r--src/Directory.cxx2
-rw-r--r--src/GlobalEvents.cxx3
-rw-r--r--src/IOThread.cxx2
-rw-r--r--src/InotifyUpdate.cxx4
-rw-r--r--src/InotifyUpdate.hxx2
-rw-r--r--src/Log.cxx4
-rw-r--r--src/Log.hxx4
-rw-r--r--src/MessageCommands.cxx10
-rw-r--r--src/OtherCommands.cxx32
-rw-r--r--src/OutputAll.cxx2
-rw-r--r--src/OutputCommands.cxx6
-rw-r--r--src/OutputError.hxx4
-rw-r--r--src/PlayerCommands.cxx38
-rw-r--r--src/PlayerThread.cxx2
-rw-r--r--src/PlaylistCommands.cxx20
-rw-r--r--src/QueueCommands.cxx28
-rw-r--r--src/SignalHandlers.cxx4
-rw-r--r--src/SongSort.cxx2
-rw-r--r--src/TagHandler.cxx2
-rw-r--r--src/UpdateWalk.cxx4
-rw-r--r--src/Win32Main.cxx7
-rw-r--r--src/ZeroconfAvahi.cxx4
-rw-r--r--src/ZeroconfBonjour.cxx10
-rw-r--r--src/ack.h4
-rw-r--r--src/db/ProxyDatabasePlugin.cxx4
-rw-r--r--src/db/SimpleDatabasePlugin.cxx4
-rw-r--r--src/db_error.h4
-rw-r--r--src/decoder/DsdiffDecoderPlugin.cxx4
-rw-r--r--src/decoder/DsfDecoderPlugin.cxx4
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx8
-rw-r--r--src/decoder/FlacDecoderPlugin.cxx2
-rw-r--r--src/decoder/FluidsynthDecoderPlugin.cxx6
-rw-r--r--src/decoder/SndfileDecoderPlugin.cxx6
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx2
-rw-r--r--src/decoder/WavpackDecoderPlugin.cxx2
-rw-r--r--src/encoder/FlacEncoderPlugin.cxx14
-rw-r--r--src/encoder/OpusEncoderPlugin.cxx4
-rw-r--r--src/encoder/VorbisEncoderPlugin.cxx10
-rw-r--r--src/gcc.h2
-rw-r--r--src/input/CurlInputPlugin.cxx9
-rw-r--r--src/input/DespotifyInputPlugin.cxx14
-rw-r--r--src/input/FfmpegInputPlugin.cxx4
-rw-r--r--src/input/MmsInputPlugin.cxx6
-rw-r--r--src/io_error.h2
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx9
-rw-r--r--src/mixer/OssMixerPlugin.cxx2
-rw-r--r--src/mixer/PulseMixerPlugin.cxx6
-rw-r--r--src/mixer/WinmmMixerPlugin.cxx2
-rw-r--r--src/output/AlsaOutputPlugin.cxx2
-rw-r--r--src/output/FifoOutputPlugin.cxx2
-rw-r--r--src/output/JackOutputPlugin.cxx2
-rw-r--r--src/output/OSXOutputPlugin.cxx10
-rw-r--r--src/output/OpenALOutputPlugin.cxx9
-rw-r--r--src/output/OssOutputPlugin.cxx2
-rw-r--r--src/output/PipeOutputPlugin.cxx4
-rw-r--r--src/output/PulseOutputPlugin.cxx8
-rw-r--r--src/output/ShoutOutputPlugin.cxx2
-rw-r--r--src/pcm/PcmBuffer.cxx2
-rw-r--r--src/pcm/PcmDsdUsb.cxx4
-rw-r--r--src/pcm/PcmResampleInternal.hxx4
-rw-r--r--src/pcm/PcmVolume.cxx2
-rw-r--r--src/playlist/AsxPlaylistPlugin.cxx12
-rw-r--r--src/playlist/RssPlaylistPlugin.cxx12
-rw-r--r--src/playlist/XspfPlaylistPlugin.cxx16
-rw-r--r--src/playlist_error.h4
-rw-r--r--src/util/Tokenizer.cxx2
79 files changed, 260 insertions, 240 deletions
diff --git a/src/AllCommands.cxx b/src/AllCommands.cxx
index cd06c323b..88eee150e 100644
--- a/src/AllCommands.cxx
+++ b/src/AllCommands.cxx
@@ -60,12 +60,10 @@ struct command {
/* don't be fooled, this is the command handler for "commands" command */
static enum command_return
-handle_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[]);
+handle_commands(Client *client, int argc, char *argv[]);
static enum command_return
-handle_not_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[]);
+handle_not_commands(Client *client, int argc, char *argv[]);
/**
* The command registry.
@@ -168,7 +166,7 @@ static const struct command commands[] = {
static const unsigned num_commands = sizeof(commands) / sizeof(commands[0]);
static bool
-command_available(G_GNUC_UNUSED const struct command *cmd)
+command_available(gcc_unused const struct command *cmd)
{
#ifdef ENABLE_SQLITE
if (strcmp(cmd->cmd, "sticker") == 0)
@@ -181,7 +179,7 @@ command_available(G_GNUC_UNUSED const struct command *cmd)
/* don't be fooled, this is the command handler for "commands" command */
static enum command_return
handle_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
const unsigned permission = client_get_permission(client);
const struct command *cmd;
@@ -199,7 +197,7 @@ handle_commands(Client *client,
static enum command_return
handle_not_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
const unsigned permission = client_get_permission(client);
const struct command *cmd;
@@ -318,7 +316,6 @@ enum command_return
command_process(Client *client, unsigned num, char *line)
{
GError *error = NULL;
- int argc;
char *argv[COMMAND_ARGV_MAX] = { NULL };
const struct command *cmd;
enum command_return ret = COMMAND_RETURN_ERROR;
@@ -344,11 +341,11 @@ command_process(Client *client, unsigned num, char *line)
return COMMAND_RETURN_ERROR;
}
- argc = 1;
+ unsigned argc = 1;
/* now parse the arguments (quoted or unquoted) */
- while (argc < (int)G_N_ELEMENTS(argv) &&
+ while (argc < COMMAND_ARGV_MAX &&
(argv[argc] =
tokenizer.NextParam(&error)) != NULL)
++argc;
@@ -358,7 +355,7 @@ command_process(Client *client, unsigned num, char *line)
current_command = argv[0];
- if (argc >= (int)G_N_ELEMENTS(argv)) {
+ if (argc >= COMMAND_ARGV_MAX) {
command_error(client, ACK_ERROR_ARG, "Too many arguments");
current_command = NULL;
return COMMAND_RETURN_ERROR;
diff --git a/src/ClientMessage.cxx b/src/ClientMessage.cxx
index 619964b3c..5a4ee6f01 100644
--- a/src/ClientMessage.cxx
+++ b/src/ClientMessage.cxx
@@ -18,10 +18,11 @@
*/
#include "ClientMessage.hxx"
+#include "gcc.h"
#include <glib.h>
-G_GNUC_PURE
+gcc_const
static bool
valid_channel_char(const char ch)
{
diff --git a/src/ClientWrite.cxx b/src/ClientWrite.cxx
index 23b515a3d..b9e8eb468 100644
--- a/src/ClientWrite.cxx
+++ b/src/ClientWrite.cxx
@@ -75,7 +75,6 @@ client_vprintf(Client *client, const char *fmt, va_list args)
#endif
}
-G_GNUC_PRINTF(2, 3)
void
client_printf(Client *client, const char *fmt, ...)
{
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx
index 1e0e028ec..a62ea370e 100644
--- a/src/CommandLine.cxx
+++ b/src/CommandLine.cxx
@@ -49,7 +49,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef G_OS_WIN32
+#ifdef WIN32
#define CONFIG_FILE_LOCATION "\\mpd\\mpd.conf"
#else /* G_OS_WIN32 */
#define USER_CONFIG_FILE_LOCATION1 ".mpdconf"
@@ -62,7 +62,7 @@ cmdline_quark(void)
return g_quark_from_static_string("cmdline");
}
-G_GNUC_NORETURN
+gcc_noreturn
static void version(void)
{
puts(PACKAGE " (MPD: Music Player Daemon) " VERSION " \n"
@@ -203,7 +203,7 @@ parse_cmdline(int argc, char **argv, struct options *options,
} else if (argc <= 1) {
/* default configuration file path */
-#ifdef G_OS_WIN32
+#ifdef WIN32
Path path = PathBuildChecked(Path::FromUTF8(g_get_user_config_dir()),
CONFIG_FILE_LOCATION);
if (!path.IsNull() && FileExists(path))
diff --git a/src/ConfigPath.cxx b/src/ConfigPath.cxx
index 767115d19..074891433 100644
--- a/src/ConfigPath.cxx
+++ b/src/ConfigPath.cxx
@@ -45,7 +45,7 @@
#include <windows.h>
#endif
-G_GNUC_CONST
+gcc_const
static inline GQuark
parse_path_quark(void)
{
@@ -53,7 +53,7 @@ parse_path_quark(void)
}
char *
-parsePath(const char *path, G_GNUC_UNUSED GError **error_r)
+parsePath(const char *path, gcc_unused GError **error_r)
{
assert(path != nullptr);
assert(error_r == nullptr || *error_r == nullptr);
diff --git a/src/ConfigQuark.hxx b/src/ConfigQuark.hxx
index 11594f998..4d9be33b1 100644
--- a/src/ConfigQuark.hxx
+++ b/src/ConfigQuark.hxx
@@ -20,13 +20,15 @@
#ifndef MPD_CONFIG_QUARK_HXX
#define MPD_CONFIG_QUARK_HXX
+#include "gcc.h"
+
#include <glib.h>
/**
* A GQuark for GError instances, resulting from malformed
* configuration.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
config_quark(void)
{
diff --git a/src/CrossFade.cxx b/src/CrossFade.cxx
index 4f5ff32ca..03b4b7918 100644
--- a/src/CrossFade.cxx
+++ b/src/CrossFade.cxx
@@ -35,7 +35,7 @@
#ifdef G_OS_WIN32
static char *
-strtok_r(char *str, const char *delim, G_GNUC_UNUSED char **saveptr)
+strtok_r(char *str, const char *delim, gcc_unused char **saveptr)
{
return strtok(str, delim);
}
diff --git a/src/DatabaseCommands.cxx b/src/DatabaseCommands.cxx
index 42c7d4c32..f179713d4 100644
--- a/src/DatabaseCommands.cxx
+++ b/src/DatabaseCommands.cxx
@@ -143,7 +143,7 @@ handle_count(Client *client, int argc, char *argv[])
}
enum command_return
-handle_listall(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_listall(Client *client, gcc_unused int argc, char *argv[])
{
const char *directory = "";
@@ -206,7 +206,7 @@ handle_list(Client *client, int argc, char *argv[])
}
enum command_return
-handle_listallinfo(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_listallinfo(Client *client, gcc_unused int argc, char *argv[])
{
const char *directory = "";
diff --git a/src/DatabaseLock.hxx b/src/DatabaseLock.hxx
index 371a7d7b2..739f56658 100644
--- a/src/DatabaseLock.hxx
+++ b/src/DatabaseLock.hxx
@@ -28,6 +28,7 @@
#include "check.h"
#include "thread/Mutex.hxx"
+#include "gcc.h"
#include <glib.h>
#include <assert.h>
@@ -41,7 +42,7 @@ extern GThread *db_mutex_holder;
/**
* Does the current thread hold the database lock?
*/
-G_GNUC_PURE
+gcc_pure
static inline bool
holding_db_lock(void)
{
diff --git a/src/DatabaseSave.cxx b/src/DatabaseSave.cxx
index 56dd19129..8f5d5fb00 100644
--- a/src/DatabaseSave.cxx
+++ b/src/DatabaseSave.cxx
@@ -47,7 +47,7 @@ enum {
DB_FORMAT = 1,
};
-G_GNUC_CONST
+gcc_const
static GQuark
db_quark(void)
{
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index 03a75b2f9..7286bb52f 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -80,7 +80,7 @@ decoder_initialized(struct decoder *decoder,
* Checks if we need an "initial seek". If so, then the initial seek
* is prepared, and the function returns true.
*/
-G_GNUC_PURE
+gcc_pure
static bool
decoder_prepare_initial_seek(struct decoder *decoder)
{
@@ -127,7 +127,7 @@ decoder_prepare_initial_seek(struct decoder *decoder)
* synthesized command, e.g. to seek to the beginning of the CUE
* track.
*/
-G_GNUC_PURE
+gcc_pure
static enum decoder_command
decoder_get_virtual_command(struct decoder *decoder)
{
@@ -191,7 +191,7 @@ decoder_command_finished(struct decoder *decoder)
dc->Unlock();
}
-double decoder_seek_where(G_GNUC_UNUSED struct decoder * decoder)
+double decoder_seek_where(gcc_unused struct decoder * decoder)
{
const struct decoder_control *dc = decoder->dc;
@@ -232,7 +232,7 @@ void decoder_seek_error(struct decoder * decoder)
* Should be read operation be cancelled? That is the case when the
* player thread has sent a command such as "STOP".
*/
-G_GNUC_PURE
+gcc_pure
static inline bool
decoder_check_cancel_read(const struct decoder *decoder)
{
@@ -287,7 +287,7 @@ size_t decoder_read(struct decoder *decoder,
assert(nbytes == 0 || error == NULL);
assert(nbytes > 0 || error != NULL || input_stream_eof(is));
- if (G_UNLIKELY(nbytes == 0 && error != NULL)) {
+ if (gcc_unlikely(nbytes == 0 && error != nullptr)) {
g_warning("%s", error->message);
g_error_free(error);
}
@@ -468,10 +468,10 @@ decoder_data(struct decoder *decoder,
}
enum decoder_command
-decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
+decoder_tag(gcc_unused struct decoder *decoder, struct input_stream *is,
Tag &&tag)
{
- G_GNUC_UNUSED const struct decoder_control *dc = decoder->dc;
+ gcc_unused const struct decoder_control *dc = decoder->dc;
enum decoder_command cmd;
assert(dc->state == DECODE_STATE_DECODE);
diff --git a/src/DecoderError.hxx b/src/DecoderError.hxx
index 14810dec7..94b5a964b 100644
--- a/src/DecoderError.hxx
+++ b/src/DecoderError.hxx
@@ -20,12 +20,14 @@
#ifndef MPD_DECODER_ERROR_HXX
#define MPD_DECODER_ERROR_HXX
+#include "gcc.h"
+
#include <glib.h>
/**
* Quark for GError.domain.
*/
-G_GNUC_CONST
+gcc_pure
static inline GQuark
decoder_quark(void)
{
diff --git a/src/DespotifyUtils.cxx b/src/DespotifyUtils.cxx
index c45722379..2c4b5bfb7 100644
--- a/src/DespotifyUtils.cxx
+++ b/src/DespotifyUtils.cxx
@@ -32,8 +32,9 @@ static void (*registered_callbacks[8])(struct despotify_session *,
int, void *, void *);
static void *registered_callback_data[8];
-static void callback(struct despotify_session* ds, int sig,
- void* data, G_GNUC_UNUSED void* callback_data)
+static void
+callback(struct despotify_session* ds, int sig,
+ void *data, gcc_unused void *callback_data)
{
size_t i;
diff --git a/src/Directory.cxx b/src/Directory.cxx
index 1c1db386f..6a0da2597 100644
--- a/src/Directory.cxx
+++ b/src/Directory.cxx
@@ -275,7 +275,7 @@ Directory::LookupSong(const char *uri)
}
static int
-directory_cmp(G_GNUC_UNUSED void *priv,
+directory_cmp(gcc_unused void *priv,
struct list_head *_a, struct list_head *_b)
{
const Directory *a = (const Directory *)_a;
diff --git a/src/GlobalEvents.cxx b/src/GlobalEvents.cxx
index 20faa9a81..e30090ef4 100644
--- a/src/GlobalEvents.cxx
+++ b/src/GlobalEvents.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "GlobalEvents.hxx"
+#include "gcc.h"
#include <atomic>
@@ -47,7 +48,7 @@ InvokeGlobalEvent(GlobalEvents::Event event)
}
static gboolean
-GlobalEventCallback(G_GNUC_UNUSED gpointer data)
+GlobalEventCallback(gcc_unused gpointer data)
{
const unsigned flags = GlobalEvents::flags.exchange(0);
diff --git a/src/IOThread.cxx b/src/IOThread.cxx
index bbd4b9c3c..ef0cec4d6 100644
--- a/src/IOThread.cxx
+++ b/src/IOThread.cxx
@@ -43,7 +43,7 @@ io_thread_run(void)
}
static gpointer
-io_thread_func(G_GNUC_UNUSED gpointer arg)
+io_thread_func(gcc_unused gpointer arg)
{
/* lock+unlock to synchronize with io_thread_start(), to be
sure that io.thread is set */
diff --git a/src/InotifyUpdate.cxx b/src/InotifyUpdate.cxx
index 2de3bf627..95c8317c8 100644
--- a/src/InotifyUpdate.cxx
+++ b/src/InotifyUpdate.cxx
@@ -233,7 +233,7 @@ recursive_watch_subdirectories(WatchDirectory *directory,
closedir(dir);
}
-G_GNUC_PURE
+gcc_pure
static unsigned
watch_directory_depth(const WatchDirectory *d)
{
@@ -248,7 +248,7 @@ watch_directory_depth(const WatchDirectory *d)
static void
mpd_inotify_callback(int wd, unsigned mask,
- G_GNUC_UNUSED const char *name, G_GNUC_UNUSED void *ctx)
+ gcc_unused const char *name, gcc_unused void *ctx)
{
WatchDirectory *directory;
char *uri_fs;
diff --git a/src/InotifyUpdate.hxx b/src/InotifyUpdate.hxx
index ceb421553..44d0b10b7 100644
--- a/src/InotifyUpdate.hxx
+++ b/src/InotifyUpdate.hxx
@@ -33,7 +33,7 @@ mpd_inotify_finish(void);
#else /* !HAVE_INOTIFY_INIT */
static inline void
-mpd_inotify_init(G_GNUC_UNUSED unsigned max_depth)
+mpd_inotify_init(gcc_unused unsigned max_depth)
{
}
diff --git a/src/Log.cxx b/src/Log.cxx
index 8a50e1efb..96ac106cc 100644
--- a/src/Log.cxx
+++ b/src/Log.cxx
@@ -91,7 +91,7 @@ chomp_length(const char *p)
static void
file_log_func(const gchar *log_domain,
GLogLevelFlags log_level,
- const gchar *message, G_GNUC_UNUSED gpointer user_data)
+ const gchar *message, gcc_unused gpointer user_data)
{
char *converted;
@@ -179,7 +179,7 @@ glib_to_syslog_level(GLogLevelFlags log_level)
static void
syslog_log_func(const gchar *log_domain,
GLogLevelFlags log_level, const gchar *message,
- G_GNUC_UNUSED gpointer user_data)
+ gcc_unused gpointer user_data)
{
if (stdout_mode) {
/* fall back to the file log function during
diff --git a/src/Log.hxx b/src/Log.hxx
index 1010721b5..55a6a7a31 100644
--- a/src/Log.hxx
+++ b/src/Log.hxx
@@ -20,9 +20,11 @@
#ifndef MPD_LOG_HXX
#define MPD_LOG_HXX
+#include "gcc.h"
+
#include <glib.h>
-G_GNUC_CONST
+gcc_const
static inline GQuark
log_quark(void)
{
diff --git a/src/MessageCommands.cxx b/src/MessageCommands.cxx
index 4e24a1828..2971b4cde 100644
--- a/src/MessageCommands.cxx
+++ b/src/MessageCommands.cxx
@@ -33,7 +33,7 @@
#include <assert.h>
enum command_return
-handle_subscribe(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_subscribe(Client *client, gcc_unused int argc, char *argv[])
{
assert(argc == 2);
@@ -62,7 +62,7 @@ handle_subscribe(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_unsubscribe(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_unsubscribe(Client *client, gcc_unused int argc, char *argv[])
{
assert(argc == 2);
@@ -77,7 +77,7 @@ handle_unsubscribe(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_channels(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
assert(argc == 1);
@@ -94,7 +94,7 @@ handle_channels(Client *client,
enum command_return
handle_read_messages(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
assert(argc == 1);
@@ -111,7 +111,7 @@ handle_read_messages(Client *client,
enum command_return
handle_send_message(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
assert(argc == 3);
diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx
index 0137cfd57..547946e3e 100644
--- a/src/OtherCommands.cxx
+++ b/src/OtherCommands.cxx
@@ -66,7 +66,7 @@ print_spl_list(Client *client, const PlaylistVector &list)
enum command_return
handle_urlhandlers(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
if (client_is_local(client))
client_puts(client, "handler: file://\n");
@@ -76,7 +76,7 @@ handle_urlhandlers(Client *client,
enum command_return
handle_decoders(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
decoder_list_print(client);
return COMMAND_RETURN_OK;
@@ -84,22 +84,22 @@ handle_decoders(Client *client,
enum command_return
handle_tagtypes(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
tag_print_types(client);
return COMMAND_RETURN_OK;
}
enum command_return
-handle_kill(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_kill(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
return COMMAND_RETURN_KILL;
}
enum command_return
-handle_close(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_close(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
return COMMAND_RETURN_CLOSE;
}
@@ -155,7 +155,7 @@ handle_lsinfo(Client *client, int argc, char *argv[])
}
enum command_return
-handle_update(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_update(Client *client, gcc_unused int argc, char *argv[])
{
const char *path = NULL;
unsigned ret;
@@ -186,7 +186,7 @@ handle_update(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_rescan(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_rescan(Client *client, gcc_unused int argc, char *argv[])
{
const char *path = NULL;
unsigned ret;
@@ -214,7 +214,7 @@ handle_rescan(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_setvol(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_setvol(Client *client, gcc_unused int argc, char *argv[])
{
unsigned level;
bool success;
@@ -239,21 +239,21 @@ handle_setvol(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_stats(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
stats_print(client);
return COMMAND_RETURN_OK;
}
enum command_return
-handle_ping(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_ping(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
return COMMAND_RETURN_OK;
}
enum command_return
-handle_password(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_password(Client *client, gcc_unused int argc, char *argv[])
{
unsigned permission = 0;
@@ -269,7 +269,7 @@ handle_password(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_config(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
if (!client_is_local(client)) {
command_error(client, ACK_ERROR_PERMISSION,
@@ -286,7 +286,7 @@ handle_config(Client *client,
enum command_return
handle_idle(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
unsigned flags = 0, j;
int i;
diff --git a/src/OutputAll.cxx b/src/OutputAll.cxx
index 2e721efa3..23fe9ae2d 100644
--- a/src/OutputAll.cxx
+++ b/src/OutputAll.cxx
@@ -397,7 +397,7 @@ chunk_is_consumed(const struct music_chunk *chunk)
* outputs have consumed it already. Clear the reference.
*/
static void
-clear_tail_chunk(G_GNUC_UNUSED const struct music_chunk *chunk, bool *locked)
+clear_tail_chunk(gcc_unused const struct music_chunk *chunk, bool *locked)
{
assert(chunk->next == NULL);
assert(music_pipe_contains(g_mp, chunk));
diff --git a/src/OutputCommands.cxx b/src/OutputCommands.cxx
index 5e4a145da..3281104d1 100644
--- a/src/OutputCommands.cxx
+++ b/src/OutputCommands.cxx
@@ -27,7 +27,7 @@
#include <string.h>
enum command_return
-handle_enableoutput(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_enableoutput(Client *client, gcc_unused int argc, char *argv[])
{
unsigned device;
bool ret;
@@ -46,7 +46,7 @@ handle_enableoutput(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_disableoutput(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_disableoutput(Client *client, gcc_unused int argc, char *argv[])
{
unsigned device;
bool ret;
@@ -82,7 +82,7 @@ handle_toggleoutput(Client *client, gcc_unused int argc, char *argv[])
enum command_return
handle_devices(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
printAudioDevices(client);
diff --git a/src/OutputError.hxx b/src/OutputError.hxx
index 451df9857..e1f91e196 100644
--- a/src/OutputError.hxx
+++ b/src/OutputError.hxx
@@ -20,12 +20,14 @@
#ifndef MPD_OUTPUT_ERROR_HXX
#define MPD_OUTPUT_ERROR_HXX
+#include "gcc.h"
+
#include <glib.h>
/**
* Quark for GError.domain.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
output_quark(void)
{
diff --git a/src/PlayerCommands.cxx b/src/PlayerCommands.cxx
index 0d4089940..51b37eddd 100644
--- a/src/PlayerCommands.cxx
+++ b/src/PlayerCommands.cxx
@@ -83,7 +83,7 @@ handle_playid(Client *client, int argc, char *argv[])
enum command_return
handle_stop(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
client->partition.Stop();
return COMMAND_RETURN_OK;
@@ -91,7 +91,7 @@ handle_stop(Client *client,
enum command_return
handle_currentsong(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
playlist_print_current(client, &client->playlist);
return COMMAND_RETURN_OK;
@@ -115,7 +115,7 @@ handle_pause(Client *client,
enum command_return
handle_status(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
const char *state = NULL;
int updateJobId;
@@ -215,7 +215,7 @@ handle_status(Client *client,
enum command_return
handle_next(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
playlist &playlist = client->playlist;
@@ -232,14 +232,14 @@ handle_next(Client *client,
enum command_return
handle_previous(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
client->partition.PlayPrevious();
return COMMAND_RETURN_OK;
}
enum command_return
-handle_repeat(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_repeat(Client *client, gcc_unused int argc, char *argv[])
{
bool status;
if (!check_bool(client, &status, argv[1]))
@@ -250,7 +250,7 @@ handle_repeat(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_single(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_single(Client *client, gcc_unused int argc, char *argv[])
{
bool status;
if (!check_bool(client, &status, argv[1]))
@@ -261,7 +261,7 @@ handle_single(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_consume(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_consume(Client *client, gcc_unused int argc, char *argv[])
{
bool status;
if (!check_bool(client, &status, argv[1]))
@@ -272,7 +272,7 @@ handle_consume(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_random(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_random(Client *client, gcc_unused int argc, char *argv[])
{
bool status;
if (!check_bool(client, &status, argv[1]))
@@ -284,15 +284,15 @@ handle_random(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_clearerror(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_clearerror(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
client->player_control->ClearError();
return COMMAND_RETURN_OK;
}
enum command_return
-handle_seek(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_seek(Client *client, gcc_unused int argc, char *argv[])
{
unsigned song, seek_time;
@@ -307,7 +307,7 @@ handle_seek(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_seekid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_seekid(Client *client, gcc_unused int argc, char *argv[])
{
unsigned id, seek_time;
@@ -322,7 +322,7 @@ handle_seekid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_seekcur(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_seekcur(Client *client, gcc_unused int argc, char *argv[])
{
const char *p = argv[1];
bool relative = *p == '+' || *p == '-';
@@ -336,7 +336,7 @@ handle_seekcur(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_crossfade(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_crossfade(Client *client, gcc_unused int argc, char *argv[])
{
unsigned xfade_time;
@@ -348,7 +348,7 @@ handle_crossfade(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_mixrampdb(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_mixrampdb(Client *client, gcc_unused int argc, char *argv[])
{
float db;
@@ -360,7 +360,7 @@ handle_mixrampdb(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_mixrampdelay(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_mixrampdelay(Client *client, gcc_unused int argc, char *argv[])
{
float delay_secs;
@@ -373,7 +373,7 @@ handle_mixrampdelay(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_replay_gain_mode(Client *client,
- G_GNUC_UNUSED int argc, char *argv[])
+ gcc_unused int argc, char *argv[])
{
if (!replay_gain_set_mode_string(argv[1])) {
command_error(client, ACK_ERROR_ARG,
@@ -388,7 +388,7 @@ handle_replay_gain_mode(Client *client,
enum command_return
handle_replay_gain_status(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
client_printf(client, "replay_gain_mode: %s\n",
replay_gain_get_mode_string());
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 68fd6390f..a2dcb2c46 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -562,7 +562,7 @@ static bool player_seek_decoder(struct player *player)
static void player_process_command(struct player *player)
{
struct player_control *pc = player->pc;
- G_GNUC_UNUSED struct decoder_control *dc = player->dc;
+ gcc_unused struct decoder_control *dc = player->dc;
switch (pc->command) {
case PLAYER_COMMAND_NONE:
diff --git a/src/PlaylistCommands.cxx b/src/PlaylistCommands.cxx
index d68a30ba7..faa8b72bb 100644
--- a/src/PlaylistCommands.cxx
+++ b/src/PlaylistCommands.cxx
@@ -49,7 +49,7 @@ print_spl_list(Client *client, const PlaylistVector &list)
}
enum command_return
-handle_save(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_save(Client *client, gcc_unused int argc, char *argv[])
{
enum playlist_result result;
@@ -95,7 +95,7 @@ handle_load(Client *client, int argc, char *argv[])
}
enum command_return
-handle_listplaylist(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_listplaylist(Client *client, gcc_unused int argc, char *argv[])
{
if (playlist_file_print(client, argv[1], false))
return COMMAND_RETURN_OK;
@@ -108,7 +108,7 @@ handle_listplaylist(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_listplaylistinfo(Client *client,
- G_GNUC_UNUSED int argc, char *argv[])
+ gcc_unused int argc, char *argv[])
{
if (playlist_file_print(client, argv[1], true))
return COMMAND_RETURN_OK;
@@ -120,7 +120,7 @@ handle_listplaylistinfo(Client *client,
}
enum command_return
-handle_rm(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_rm(Client *client, gcc_unused int argc, char *argv[])
{
GError *error = NULL;
return spl_delete(argv[1], &error)
@@ -129,7 +129,7 @@ handle_rm(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_rename(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_rename(Client *client, gcc_unused int argc, char *argv[])
{
GError *error = NULL;
return spl_rename(argv[1], argv[2], &error)
@@ -139,7 +139,7 @@ handle_rename(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_playlistdelete(Client *client,
- G_GNUC_UNUSED int argc, char *argv[]) {
+ gcc_unused int argc, char *argv[]) {
char *playlist = argv[1];
unsigned from;
@@ -153,7 +153,7 @@ handle_playlistdelete(Client *client,
}
enum command_return
-handle_playlistmove(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_playlistmove(Client *client, gcc_unused int argc, char *argv[])
{
char *playlist = argv[1];
unsigned from, to;
@@ -170,7 +170,7 @@ handle_playlistmove(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_playlistclear(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_playlistclear(Client *client, gcc_unused int argc, char *argv[])
{
GError *error = NULL;
return spl_clear(argv[1], &error)
@@ -179,7 +179,7 @@ handle_playlistclear(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_playlistadd(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_playlistadd(Client *client, gcc_unused int argc, char *argv[])
{
char *playlist = argv[1];
char *uri = argv[2];
@@ -209,7 +209,7 @@ handle_playlistadd(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_listplaylists(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
GError *error = NULL;
const auto list = ListPlaylistFiles(&error);
diff --git a/src/QueueCommands.cxx b/src/QueueCommands.cxx
index 210b1501a..683a88e50 100644
--- a/src/QueueCommands.cxx
+++ b/src/QueueCommands.cxx
@@ -37,7 +37,7 @@
#include <string.h>
enum command_return
-handle_add(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_add(Client *client, gcc_unused int argc, char *argv[])
{
char *uri = argv[1];
enum playlist_result result;
@@ -131,7 +131,7 @@ handle_addid(Client *client, int argc, char *argv[])
}
enum command_return
-handle_delete(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_delete(Client *client, gcc_unused int argc, char *argv[])
{
unsigned start, end;
@@ -143,7 +143,7 @@ handle_delete(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_deleteid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_deleteid(Client *client, gcc_unused int argc, char *argv[])
{
unsigned id;
@@ -156,15 +156,15 @@ handle_deleteid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
enum command_return
handle_playlist(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
playlist_print_uris(client, &client->playlist);
return COMMAND_RETURN_OK;
}
enum command_return
-handle_shuffle(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_shuffle(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
unsigned start = 0, end = client->playlist.queue.GetLength();
if (argc == 2 && !check_range(client, &start, &end, argv[1]))
@@ -175,15 +175,15 @@ handle_shuffle(G_GNUC_UNUSED Client *client,
}
enum command_return
-handle_clear(G_GNUC_UNUSED Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+handle_clear(gcc_unused Client *client,
+ gcc_unused int argc, gcc_unused char *argv[])
{
client->partition.ClearQueue();
return COMMAND_RETURN_OK;
}
enum command_return
-handle_plchanges(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_plchanges(Client *client, gcc_unused int argc, char *argv[])
{
uint32_t version;
@@ -195,7 +195,7 @@ handle_plchanges(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_plchangesposid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_plchangesposid(Client *client, gcc_unused int argc, char *argv[])
{
uint32_t version;
@@ -328,7 +328,7 @@ handle_prioid(Client *client, int argc, char *argv[])
}
enum command_return
-handle_move(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_move(Client *client, gcc_unused int argc, char *argv[])
{
unsigned start, end;
int to;
@@ -344,7 +344,7 @@ handle_move(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_moveid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_moveid(Client *client, gcc_unused int argc, char *argv[])
{
unsigned id;
int to;
@@ -358,7 +358,7 @@ handle_moveid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_swap(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_swap(Client *client, gcc_unused int argc, char *argv[])
{
unsigned song1, song2;
@@ -373,7 +373,7 @@ handle_swap(Client *client, G_GNUC_UNUSED int argc, char *argv[])
}
enum command_return
-handle_swapid(Client *client, G_GNUC_UNUSED int argc, char *argv[])
+handle_swapid(Client *client, gcc_unused int argc, char *argv[])
{
unsigned id1, id2;
diff --git a/src/SignalHandlers.cxx b/src/SignalHandlers.cxx
index d438eb703..d671dc408 100644
--- a/src/SignalHandlers.cxx
+++ b/src/SignalHandlers.cxx
@@ -34,12 +34,12 @@
#include <errno.h>
#include <string.h>
-static void exit_signal_handler(G_GNUC_UNUSED int signum)
+static void exit_signal_handler(gcc_unused int signum)
{
GlobalEvents::Emit(GlobalEvents::SHUTDOWN);
}
-static void reload_signal_handler(G_GNUC_UNUSED int signum)
+static void reload_signal_handler(gcc_unused int signum)
{
GlobalEvents::Emit(GlobalEvents::RELOAD);
}
diff --git a/src/SongSort.cxx b/src/SongSort.cxx
index 0c154c763..23ecc5ce5 100644
--- a/src/SongSort.cxx
+++ b/src/SongSort.cxx
@@ -92,7 +92,7 @@ compare_tag_item(const Tag *a, const Tag *b, enum tag_type type)
/* Only used for sorting/searchin a songvec, not general purpose compares */
static int
-song_cmp(G_GNUC_UNUSED void *priv, struct list_head *_a, struct list_head *_b)
+song_cmp(gcc_unused void *priv, struct list_head *_a, struct list_head *_b)
{
const Song *a = (const Song *)_a;
const Song *b = (const Song *)_b;
diff --git a/src/TagHandler.cxx b/src/TagHandler.cxx
index 227c48c9c..055fae49a 100644
--- a/src/TagHandler.cxx
+++ b/src/TagHandler.cxx
@@ -46,7 +46,7 @@ const struct tag_handler add_tag_handler = {
};
static void
-full_tag_pair(const char *name, G_GNUC_UNUSED const char *value, void *ctx)
+full_tag_pair(const char *name, gcc_unused const char *value, void *ctx)
{
Tag *tag = (Tag *)ctx;
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index cc2b5743e..1ef82bfba 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -261,7 +261,7 @@ update_directory_child(Directory *directory,
}
/* we don't look at "." / ".." nor files with newlines in their name */
-G_GNUC_PURE
+gcc_pure
static bool skip_path(const Path &path_fs)
{
const char *path = path_fs.c_str();
@@ -270,7 +270,7 @@ static bool skip_path(const Path &path_fs)
strchr(path, '\n') != NULL;
}
-G_GNUC_PURE
+gcc_pure
static bool
skip_symlink(const Directory *directory, const char *utf8_name)
{
diff --git a/src/Win32Main.cxx b/src/Win32Main.cxx
index 0cd5e445b..d495fe088 100644
--- a/src/Win32Main.cxx
+++ b/src/Win32Main.cxx
@@ -22,6 +22,7 @@
#ifdef WIN32
+#include "gcc.h"
#include "mpd_error.h"
#include "GlobalEvents.hxx"
@@ -65,8 +66,8 @@ service_notify_status(DWORD status_code)
}
static DWORD WINAPI
-service_dispatcher(G_GNUC_UNUSED DWORD control, G_GNUC_UNUSED DWORD event_type,
- G_GNUC_UNUSED void *event_data, G_GNUC_UNUSED void *context)
+service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
+ gcc_unused void *event_data, gcc_unused void *context)
{
switch (control) {
case SERVICE_CONTROL_SHUTDOWN:
@@ -79,7 +80,7 @@ service_dispatcher(G_GNUC_UNUSED DWORD control, G_GNUC_UNUSED DWORD event_type,
}
static void WINAPI
-service_main(G_GNUC_UNUSED DWORD argc, G_GNUC_UNUSED CHAR *argv[])
+service_main(gcc_unused DWORD argc, gcc_unused CHAR *argv[])
{
DWORD error_code;
gchar* error_message;
diff --git a/src/ZeroconfAvahi.cxx b/src/ZeroconfAvahi.cxx
index 4764ad755..619feab20 100644
--- a/src/ZeroconfAvahi.cxx
+++ b/src/ZeroconfAvahi.cxx
@@ -51,7 +51,7 @@ static void avahiRegisterService(AvahiClient * c);
/* Callback when the EntryGroup changes state */
static void avahiGroupCallback(AvahiEntryGroup * g,
AvahiEntryGroupState state,
- G_GNUC_UNUSED void *userdata)
+ gcc_unused void *userdata)
{
char *n;
assert(g);
@@ -142,7 +142,7 @@ fail:
/* Callback when avahi changes state */
static void avahiClientCallback(AvahiClient * c, AvahiClientState state,
- G_GNUC_UNUSED void *userdata)
+ gcc_unused void *userdata)
{
int reason;
assert(c);
diff --git a/src/ZeroconfBonjour.cxx b/src/ZeroconfBonjour.cxx
index 959c90242..b77154e1b 100644
--- a/src/ZeroconfBonjour.cxx
+++ b/src/ZeroconfBonjour.cxx
@@ -56,12 +56,12 @@ protected:
static BonjourMonitor *bonjour_monitor;
static void
-dnsRegisterCallback(G_GNUC_UNUSED DNSServiceRef sdRef,
- G_GNUC_UNUSED DNSServiceFlags flags,
+dnsRegisterCallback(gcc_unused DNSServiceRef sdRef,
+ gcc_unused DNSServiceFlags flags,
DNSServiceErrorType errorCode, const char *name,
- G_GNUC_UNUSED const char *regtype,
- G_GNUC_UNUSED const char *domain,
- G_GNUC_UNUSED void *context)
+ gcc_unused const char *regtype,
+ gcc_unused const char *domain,
+ gcc_unused void *context)
{
if (errorCode != kDNSServiceErr_NoError) {
g_warning("Failed to register zeroconf service.");
diff --git a/src/ack.h b/src/ack.h
index 440bc27d8..b76fae17d 100644
--- a/src/ack.h
+++ b/src/ack.h
@@ -20,6 +20,8 @@
#ifndef MPD_ACK_H
#define MPD_ACK_H
+#include "gcc.h"
+
#include <glib.h>
enum ack {
@@ -41,7 +43,7 @@ enum ack {
/**
* Quark for GError.domain; the code is an enum #ack.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
ack_quark(void)
{
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index ee557ed11..638a801d4 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -76,7 +76,7 @@ protected:
bool Configure(const config_param &param, GError **error_r);
};
-G_GNUC_CONST
+gcc_pure
static inline GQuark
libmpdclient_quark(void)
{
@@ -107,7 +107,7 @@ static constexpr struct {
{ TAG_NUM_OF_ITEM_TYPES, MPD_TAG_COUNT }
};
-G_GNUC_CONST
+gcc_const
static enum mpd_tag_type
Convert(enum tag_type tag_type)
{
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index ac5a75438..7690a188b 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -33,7 +33,7 @@
#include <sys/types.h>
#include <errno.h>
-G_GNUC_CONST
+gcc_const
static inline GQuark
simple_db_quark(void)
{
@@ -241,7 +241,7 @@ SimpleDatabase::ReturnSong(gcc_unused Song *song) const
#endif
}
-G_GNUC_PURE
+gcc_pure
const Directory *
SimpleDatabase::LookupDirectory(const char *uri) const
{
diff --git a/src/db_error.h b/src/db_error.h
index d3be582cf..05946aaf1 100644
--- a/src/db_error.h
+++ b/src/db_error.h
@@ -20,6 +20,8 @@
#ifndef MPD_DB_ERROR_H
#define MPD_DB_ERROR_H
+#include "gcc.h"
+
#include <glib.h>
enum db_error {
@@ -35,7 +37,7 @@ enum db_error {
/**
* Quark for GError.domain; the code is an enum #db_error.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
db_quark(void)
{
diff --git a/src/decoder/DsdiffDecoderPlugin.cxx b/src/decoder/DsdiffDecoderPlugin.cxx
index 9e9dab4d2..b6d7f65cc 100644
--- a/src/decoder/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/DsdiffDecoderPlugin.cxx
@@ -477,8 +477,8 @@ dsdiff_stream_decode(struct decoder *decoder, struct input_stream *is)
static bool
dsdiff_scan_stream(struct input_stream *is,
- G_GNUC_UNUSED const struct tag_handler *handler,
- G_GNUC_UNUSED void *handler_ctx)
+ gcc_unused const struct tag_handler *handler,
+ gcc_unused void *handler_ctx)
{
DsdiffMetaData metadata;
DsdiffChunkHeader chunk_header;
diff --git a/src/decoder/DsfDecoderPlugin.cxx b/src/decoder/DsfDecoderPlugin.cxx
index ad1323d88..e487879cb 100644
--- a/src/decoder/DsfDecoderPlugin.cxx
+++ b/src/decoder/DsfDecoderPlugin.cxx
@@ -309,8 +309,8 @@ dsf_stream_decode(struct decoder *decoder, struct input_stream *is)
static bool
dsf_scan_stream(struct input_stream *is,
- G_GNUC_UNUSED const struct tag_handler *handler,
- G_GNUC_UNUSED void *handler_ctx)
+ gcc_unused const struct tag_handler *handler,
+ gcc_unused void *handler_ctx)
{
/* check DSF metadata */
DsfMetaData metadata;
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 89e57c874..4fd33807d 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -73,7 +73,7 @@ level_ffmpeg_to_glib(int level)
}
static void
-mpd_ffmpeg_log_callback(G_GNUC_UNUSED void *ptr, int level,
+mpd_ffmpeg_log_callback(gcc_unused void *ptr, int level,
const char *fmt, va_list vl)
{
const AVClass * cls = NULL;
@@ -185,7 +185,7 @@ ffmpeg_find_audio_stream(const AVFormatContext *format_context)
return -1;
}
-G_GNUC_CONST
+gcc_const
static double
time_from_ffmpeg(int64_t t, const AVRational time_base)
{
@@ -195,7 +195,7 @@ time_from_ffmpeg(int64_t t, const AVRational time_base)
/ (double)1024;
}
-G_GNUC_CONST
+gcc_const
static int64_t
time_to_ffmpeg(double t, const AVRational time_base)
{
@@ -301,7 +301,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
return cmd;
}
-G_GNUC_CONST
+gcc_const
static SampleFormat
ffmpeg_sample_format(enum AVSampleFormat sample_fmt)
{
diff --git a/src/decoder/FlacDecoderPlugin.cxx b/src/decoder/FlacDecoderPlugin.cxx
index d228c41b9..5b02c1f9e 100644
--- a/src/decoder/FlacDecoderPlugin.cxx
+++ b/src/decoder/FlacDecoderPlugin.cxx
@@ -56,7 +56,7 @@ static void flacPrintErroredState(FLAC__StreamDecoderState state)
g_warning("%s\n", FLAC__StreamDecoderStateString[state]);
}
-static void flacMetadata(G_GNUC_UNUSED const FLAC__StreamDecoder * dec,
+static void flacMetadata(gcc_unused const FLAC__StreamDecoder * dec,
const FLAC__StreamMetadata * block, void *vdata)
{
flac_metadata_common_cb(block, (struct flac_data *) vdata);
diff --git a/src/decoder/FluidsynthDecoderPlugin.cxx b/src/decoder/FluidsynthDecoderPlugin.cxx
index 7d56d4f1f..9e9c9b2ce 100644
--- a/src/decoder/FluidsynthDecoderPlugin.cxx
+++ b/src/decoder/FluidsynthDecoderPlugin.cxx
@@ -64,7 +64,7 @@ fluidsynth_level_to_glib(enum fluid_log_level level)
* logging library.
*/
static void
-fluidsynth_mpd_log_function(int level, char *message, G_GNUC_UNUSED void *data)
+fluidsynth_mpd_log_function(int level, char *message, gcc_unused void *data)
{
g_log(G_LOG_DOMAIN, fluidsynth_level_to_glib(fluid_log_level(level)),
"%s", message);
@@ -199,8 +199,8 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
static bool
fluidsynth_scan_file(const char *file,
- G_GNUC_UNUSED const struct tag_handler *handler,
- G_GNUC_UNUSED void *handler_ctx)
+ gcc_unused const struct tag_handler *handler,
+ gcc_unused void *handler_ctx)
{
return fluid_is_midifile(file);
}
diff --git a/src/decoder/SndfileDecoderPlugin.cxx b/src/decoder/SndfileDecoderPlugin.cxx
index 63401a47b..29911a04e 100644
--- a/src/decoder/SndfileDecoderPlugin.cxx
+++ b/src/decoder/SndfileDecoderPlugin.cxx
@@ -67,9 +67,9 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
}
static sf_count_t
-sndfile_vio_write(G_GNUC_UNUSED const void *ptr,
- G_GNUC_UNUSED sf_count_t count,
- G_GNUC_UNUSED void *user_data)
+sndfile_vio_write(gcc_unused const void *ptr,
+ gcc_unused sf_count_t count,
+ gcc_unused void *user_data)
{
/* no writing! */
return -1;
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index f51480d71..b9181ef75 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -87,7 +87,7 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence)
}
/* TODO: check Ogg libraries API and see if we can just not have this func */
-static int ogg_close_cb(G_GNUC_UNUSED void *data)
+static int ogg_close_cb(gcc_unused void *data)
{
return 0;
}
diff --git a/src/decoder/WavpackDecoderPlugin.cxx b/src/decoder/WavpackDecoderPlugin.cxx
index aa62a0f67..6b6c7f2ea 100644
--- a/src/decoder/WavpackDecoderPlugin.cxx
+++ b/src/decoder/WavpackDecoderPlugin.cxx
@@ -92,7 +92,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
* This function converts floating point sample data to 24-bit integer.
*/
static void
-format_samples_float(G_GNUC_UNUSED int bytes_per_sample, void *buffer,
+format_samples_float(gcc_unused int bytes_per_sample, void *buffer,
uint32_t count)
{
float *p = (float *)buffer;
diff --git a/src/encoder/FlacEncoderPlugin.cxx b/src/encoder/FlacEncoderPlugin.cxx
index a14b97f11..ef6217a93 100644
--- a/src/encoder/FlacEncoderPlugin.cxx
+++ b/src/encoder/FlacEncoderPlugin.cxx
@@ -133,11 +133,11 @@ flac_encoder_setup(struct flac_encoder *encoder, unsigned bits_per_sample,
}
static FLAC__StreamEncoderWriteStatus
-flac_write_callback(G_GNUC_UNUSED const FLAC__StreamEncoder *fse,
+flac_write_callback(gcc_unused const FLAC__StreamEncoder *fse,
const FLAC__byte data[],
size_t bytes,
- G_GNUC_UNUSED unsigned samples,
- G_GNUC_UNUSED unsigned current_frame, void *client_data)
+ gcc_unused unsigned samples,
+ gcc_unused unsigned current_frame, void *client_data)
{
struct flac_encoder *encoder = (struct flac_encoder *) client_data;
@@ -224,7 +224,7 @@ flac_encoder_open(Encoder *_encoder, AudioFormat &audio_format,
static bool
-flac_encoder_flush(Encoder *_encoder, G_GNUC_UNUSED GError **error)
+flac_encoder_flush(Encoder *_encoder, gcc_unused GError **error)
{
struct flac_encoder *encoder = (struct flac_encoder *)_encoder;
@@ -252,8 +252,8 @@ pcm16_to_flac(int32_t *out, const int16_t *in, unsigned num_samples)
static bool
flac_encoder_write(Encoder *_encoder,
- const void *data, size_t length,
- G_GNUC_UNUSED GError **error)
+ const void *data, size_t length,
+ gcc_unused GError **error)
{
struct flac_encoder *encoder = (struct flac_encoder *)_encoder;
unsigned num_frames, num_samples;
@@ -324,7 +324,7 @@ flac_encoder_read(Encoder *_encoder, void *dest, size_t length)
}
static const char *
-flac_encoder_get_mime_type(G_GNUC_UNUSED Encoder *_encoder)
+flac_encoder_get_mime_type(gcc_unused Encoder *_encoder)
{
return "audio/flac";
}
diff --git a/src/encoder/OpusEncoderPlugin.cxx b/src/encoder/OpusEncoderPlugin.cxx
index d67cf1862..9bb339312 100644
--- a/src/encoder/OpusEncoderPlugin.cxx
+++ b/src/encoder/OpusEncoderPlugin.cxx
@@ -265,7 +265,7 @@ opus_encoder_end(Encoder *_encoder, GError **error_r)
}
static bool
-opus_encoder_flush(Encoder *_encoder, G_GNUC_UNUSED GError **error)
+opus_encoder_flush(Encoder *_encoder, gcc_unused GError **error)
{
struct opus_encoder *encoder = (struct opus_encoder *)_encoder;
@@ -404,7 +404,7 @@ opus_encoder_read(Encoder *_encoder, void *dest, size_t length)
}
static const char *
-opus_encoder_get_mime_type(G_GNUC_UNUSED Encoder *_encoder)
+opus_encoder_get_mime_type(gcc_unused Encoder *_encoder)
{
return "audio/ogg";
}
diff --git a/src/encoder/VorbisEncoderPlugin.cxx b/src/encoder/VorbisEncoderPlugin.cxx
index 9d0ba9461..4fb6bb661 100644
--- a/src/encoder/VorbisEncoderPlugin.cxx
+++ b/src/encoder/VorbisEncoderPlugin.cxx
@@ -250,7 +250,7 @@ vorbis_encoder_blockout(struct vorbis_encoder *encoder)
}
static bool
-vorbis_encoder_flush(Encoder *_encoder, G_GNUC_UNUSED GError **error)
+vorbis_encoder_flush(Encoder *_encoder, gcc_unused GError **error)
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
@@ -259,7 +259,7 @@ vorbis_encoder_flush(Encoder *_encoder, G_GNUC_UNUSED GError **error)
}
static bool
-vorbis_encoder_pre_tag(Encoder *_encoder, G_GNUC_UNUSED GError **error)
+vorbis_encoder_pre_tag(Encoder *_encoder, gcc_unused GError **error)
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
@@ -290,7 +290,7 @@ copy_tag_to_vorbis_comment(vorbis_comment *vc, const Tag *tag)
static bool
vorbis_encoder_tag(Encoder *_encoder, const Tag *tag,
- G_GNUC_UNUSED GError **error)
+ gcc_unused GError **error)
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
vorbis_comment comment;
@@ -324,7 +324,7 @@ interleaved_to_vorbis_buffer(float **dest, const float *src,
static bool
vorbis_encoder_write(Encoder *_encoder,
const void *data, size_t length,
- G_GNUC_UNUSED GError **error)
+ gcc_unused GError **error)
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
@@ -352,7 +352,7 @@ vorbis_encoder_read(Encoder *_encoder, void *dest, size_t length)
}
static const char *
-vorbis_encoder_get_mime_type(G_GNUC_UNUSED Encoder *_encoder)
+vorbis_encoder_get_mime_type(gcc_unused Encoder *_encoder)
{
return "audio/ogg";
}
diff --git a/src/gcc.h b/src/gcc.h
index 1bd770597..c0796b0fb 100644
--- a/src/gcc.h
+++ b/src/gcc.h
@@ -35,6 +35,7 @@
# define gcc_const __attribute__((const))
# define gcc_pure __attribute__((pure))
# define gcc_malloc __attribute__((malloc))
+# define gcc_noreturn __attribute__((noreturn))
# define gcc_must_check __attribute__ ((warn_unused_result))
# define gcc_packed __attribute__ ((packed))
/* these are very useful for type checking */
@@ -59,6 +60,7 @@
# define gcc_const
# define gcc_pure
# define gcc_malloc
+# define gcc_noreturn
# define gcc_must_check
# define gcc_packed
# define gcc_printf
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index 5e9cbf1d8..cabde5bba 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -228,6 +228,7 @@ static struct {
CurlSockets *sockets;
} curl;
+gcc_const
static inline GQuark
curl_quark(void)
{
@@ -615,7 +616,7 @@ CurlSockets::DispatchSockets()
static bool
input_curl_init(const config_param &param,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
if (code != CURLE_OK) {
@@ -654,7 +655,7 @@ input_curl_init(const config_param &param,
}
static gpointer
-curl_destroy_sources(G_GNUC_UNUSED gpointer data)
+curl_destroy_sources(gcc_unused gpointer data)
{
delete curl.sockets;
@@ -681,7 +682,7 @@ input_curl_finish(void)
*
* The caller must lock the mutex.
*/
-G_GNUC_PURE
+gcc_pure
static size_t
curl_total_buffer_size(const struct input_curl *c)
{
@@ -869,7 +870,7 @@ input_curl_close(struct input_stream *is)
}
static bool
-input_curl_eof(G_GNUC_UNUSED struct input_stream *is)
+input_curl_eof(gcc_unused struct input_stream *is)
{
struct input_curl *c = (struct input_curl *)is;
diff --git a/src/input/DespotifyInputPlugin.cxx b/src/input/DespotifyInputPlugin.cxx
index 18e896608..501a2a5da 100644
--- a/src/input/DespotifyInputPlugin.cxx
+++ b/src/input/DespotifyInputPlugin.cxx
@@ -95,8 +95,8 @@ refill_buffer(DespotifyInputStream *ctx)
}
}
-static void callback(G_GNUC_UNUSED struct despotify_session* ds,
- int sig, G_GNUC_UNUSED void* data, void* callback_data)
+static void callback(gcc_unused struct despotify_session* ds,
+ int sig, gcc_unused void* data, void* callback_data)
{
DespotifyInputStream *ctx = (DespotifyInputStream *)callback_data;
@@ -124,7 +124,7 @@ static void callback(G_GNUC_UNUSED struct despotify_session* ds,
static struct input_stream *
input_despotify_open(const char *url,
Mutex &mutex, Cond &cond,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
struct despotify_session *session;
struct ds_link *ds_link;
@@ -172,7 +172,7 @@ input_despotify_open(const char *url,
static size_t
input_despotify_read(struct input_stream *is, void *ptr, size_t size,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
DespotifyInputStream *ctx = (DespotifyInputStream *)is;
size_t to_cpy = size;
@@ -208,9 +208,9 @@ input_despotify_eof(struct input_stream *is)
}
static bool
-input_despotify_seek(G_GNUC_UNUSED struct input_stream *is,
- G_GNUC_UNUSED goffset offset, G_GNUC_UNUSED int whence,
- G_GNUC_UNUSED GError **error_r)
+input_despotify_seek(gcc_unused struct input_stream *is,
+ gcc_unused goffset offset, gcc_unused int whence,
+ gcc_unused GError **error_r)
{
return false;
}
diff --git a/src/input/FfmpegInputPlugin.cxx b/src/input/FfmpegInputPlugin.cxx
index 3dad28730..f27348b27 100644
--- a/src/input/FfmpegInputPlugin.cxx
+++ b/src/input/FfmpegInputPlugin.cxx
@@ -77,7 +77,7 @@ input_ffmpeg_supported(void)
static bool
input_ffmpeg_init(gcc_unused const config_param &param,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
av_register_all();
@@ -154,7 +154,7 @@ input_ffmpeg_eof(struct input_stream *is)
static bool
input_ffmpeg_seek(struct input_stream *is, goffset offset, int whence,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
FfmpegInputStream *i = (FfmpegInputStream *)is;
int64_t ret = avio_seek(i->h, offset, whence);
diff --git a/src/input/MmsInputPlugin.cxx b/src/input/MmsInputPlugin.cxx
index b347eb92b..678c52f91 100644
--- a/src/input/MmsInputPlugin.cxx
+++ b/src/input/MmsInputPlugin.cxx
@@ -124,9 +124,9 @@ input_mms_eof(struct input_stream *is)
}
static bool
-input_mms_seek(G_GNUC_UNUSED struct input_stream *is,
- G_GNUC_UNUSED goffset offset, G_GNUC_UNUSED int whence,
- G_GNUC_UNUSED GError **error_r)
+input_mms_seek(gcc_unused struct input_stream *is,
+ gcc_unused goffset offset, gcc_unused int whence,
+ gcc_unused GError **error_r)
{
return false;
}
diff --git a/src/io_error.h b/src/io_error.h
index 930ced108..1442a08aa 100644
--- a/src/io_error.h
+++ b/src/io_error.h
@@ -27,7 +27,7 @@
/**
* A GQuark for GError for I/O errors. The code is an errno value.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
errno_quark(void)
{
diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx
index 31e9997e3..8f7cd608e 100644
--- a/src/mixer/AlsaMixerPlugin.cxx
+++ b/src/mixer/AlsaMixerPlugin.cxx
@@ -73,6 +73,7 @@ public:
/**
* The quark used for GError.domain.
*/
+gcc_const
static inline GQuark
alsa_mixer_quark(void)
{
@@ -124,7 +125,7 @@ AlsaMixerMonitor::DispatchSockets()
*/
static int
-alsa_mixer_elem_callback(G_GNUC_UNUSED snd_mixer_elem_t *elem, unsigned mask)
+alsa_mixer_elem_callback(gcc_unused snd_mixer_elem_t *elem, unsigned mask)
{
if (mask & SND_CTL_EVENT_MASK_VALUE)
GlobalEvents::Emit(GlobalEvents::MIXER);
@@ -149,8 +150,8 @@ AlsaMixer::Configure(const config_param &param)
}
static Mixer *
-alsa_mixer_init(G_GNUC_UNUSED void *ao, const config_param &param,
- G_GNUC_UNUSED GError **error_r)
+alsa_mixer_init(gcc_unused void *ao, const config_param &param,
+ gcc_unused GError **error_r)
{
AlsaMixer *am = new AlsaMixer();
am->Configure(param);
@@ -169,7 +170,7 @@ alsa_mixer_finish(Mixer *data)
snd_config_update_free_global();
}
-G_GNUC_PURE
+gcc_pure
static snd_mixer_elem_t *
alsa_mixer_lookup_elem(snd_mixer_t *handle, const char *name, unsigned idx)
{
diff --git a/src/mixer/OssMixerPlugin.cxx b/src/mixer/OssMixerPlugin.cxx
index bbb5b6c88..d8af6dff0 100644
--- a/src/mixer/OssMixerPlugin.cxx
+++ b/src/mixer/OssMixerPlugin.cxx
@@ -104,7 +104,7 @@ OssMixer::Configure(const config_param &param, GError **error_r)
}
static Mixer *
-oss_mixer_init(G_GNUC_UNUSED void *ao, const config_param &param,
+oss_mixer_init(gcc_unused void *ao, const config_param &param,
GError **error_r)
{
OssMixer *om = new OssMixer();
diff --git a/src/mixer/PulseMixerPlugin.cxx b/src/mixer/PulseMixerPlugin.cxx
index 9cfd2dcf8..1c99b2469 100644
--- a/src/mixer/PulseMixerPlugin.cxx
+++ b/src/mixer/PulseMixerPlugin.cxx
@@ -77,7 +77,7 @@ pulse_mixer_offline(PulseMixer *pm)
* value.
*/
static void
-pulse_mixer_volume_cb(G_GNUC_UNUSED pa_context *context, const pa_sink_input_info *i,
+pulse_mixer_volume_cb(gcc_unused pa_context *context, const pa_sink_input_info *i,
int eol, void *userdata)
{
PulseMixer *pm = (PulseMixer *)userdata;
@@ -120,7 +120,7 @@ pulse_mixer_update(PulseMixer *pm,
}
void
-pulse_mixer_on_connect(G_GNUC_UNUSED PulseMixer *pm,
+pulse_mixer_on_connect(gcc_unused PulseMixer *pm,
struct pa_context *context)
{
pa_operation *o;
@@ -182,7 +182,7 @@ pulse_mixer_finish(Mixer *data)
}
static int
-pulse_mixer_get_volume(Mixer *mixer, G_GNUC_UNUSED GError **error_r)
+pulse_mixer_get_volume(Mixer *mixer, gcc_unused GError **error_r)
{
PulseMixer *pm = (PulseMixer *) mixer;
int ret;
diff --git a/src/mixer/WinmmMixerPlugin.cxx b/src/mixer/WinmmMixerPlugin.cxx
index 139cb1399..cbfb8f6cb 100644
--- a/src/mixer/WinmmMixerPlugin.cxx
+++ b/src/mixer/WinmmMixerPlugin.cxx
@@ -61,7 +61,7 @@ winmm_volume_encode(int volume)
static Mixer *
winmm_mixer_init(void *ao, gcc_unused const config_param &param,
- G_GNUC_UNUSED GError **error_r)
+ gcc_unused GError **error_r)
{
assert(ao != nullptr);
diff --git a/src/output/AlsaOutputPlugin.cxx b/src/output/AlsaOutputPlugin.cxx
index b26a3e1df..d707166c5 100644
--- a/src/output/AlsaOutputPlugin.cxx
+++ b/src/output/AlsaOutputPlugin.cxx
@@ -197,7 +197,7 @@ alsa_finish(struct audio_output *ao)
}
static bool
-alsa_output_enable(struct audio_output *ao, G_GNUC_UNUSED GError **error_r)
+alsa_output_enable(struct audio_output *ao, gcc_unused GError **error_r)
{
AlsaOutput *ad = (AlsaOutput *)ao;
diff --git a/src/output/FifoOutputPlugin.cxx b/src/output/FifoOutputPlugin.cxx
index 50062988c..a3c76aa4d 100644
--- a/src/output/FifoOutputPlugin.cxx
+++ b/src/output/FifoOutputPlugin.cxx
@@ -228,7 +228,7 @@ fifo_output_finish(struct audio_output *ao)
static bool
fifo_output_open(struct audio_output *ao, AudioFormat &audio_format,
- G_GNUC_UNUSED GError **error)
+ gcc_unused GError **error)
{
FifoOutput *fd = (FifoOutput *)ao;
diff --git a/src/output/JackOutputPlugin.cxx b/src/output/JackOutputPlugin.cxx
index 241857d82..bca57cfc1 100644
--- a/src/output/JackOutputPlugin.cxx
+++ b/src/output/JackOutputPlugin.cxx
@@ -615,7 +615,7 @@ mpd_jack_open(struct audio_output *ao, AudioFormat &audio_format,
}
static void
-mpd_jack_close(G_GNUC_UNUSED struct audio_output *ao)
+mpd_jack_close(gcc_unused struct audio_output *ao)
{
JackOutput *jd = (JackOutput *)ao;
diff --git a/src/output/OSXOutputPlugin.cxx b/src/output/OSXOutputPlugin.cxx
index 6e42b2518..09f5581d5 100644
--- a/src/output/OSXOutputPlugin.cxx
+++ b/src/output/OSXOutputPlugin.cxx
@@ -196,10 +196,10 @@ done:
static OSStatus
osx_render(void *vdata,
- G_GNUC_UNUSED AudioUnitRenderActionFlags *io_action_flags,
- G_GNUC_UNUSED const AudioTimeStamp *in_timestamp,
- G_GNUC_UNUSED UInt32 in_bus_number,
- G_GNUC_UNUSED UInt32 in_number_frames,
+ gcc_unused AudioUnitRenderActionFlags *io_action_flags,
+ gcc_unused const AudioTimeStamp *in_timestamp,
+ gcc_unused UInt32 in_bus_number,
+ gcc_unused UInt32 in_number_frames,
AudioBufferList *buffer_list)
{
OSXOutput *od = (OSXOutput *) vdata;
@@ -390,7 +390,7 @@ osx_output_open(struct audio_output *ao, AudioFormat &audio_format, GError **err
static size_t
osx_output_play(struct audio_output *ao, const void *chunk, size_t size,
- G_GNUC_UNUSED GError **error)
+ gcc_unused GError **error)
{
OSXOutput *od = (OSXOutput *)ao;
diff --git a/src/output/OpenALOutputPlugin.cxx b/src/output/OpenALOutputPlugin.cxx
index 1864052fa..bf4f58aa7 100644
--- a/src/output/OpenALOutputPlugin.cxx
+++ b/src/output/OpenALOutputPlugin.cxx
@@ -59,6 +59,7 @@ struct OpenALOutput {
}
};
+gcc_const
static inline GQuark
openal_output_quark(void)
{
@@ -90,7 +91,7 @@ openal_audio_format(AudioFormat &audio_format)
}
}
-G_GNUC_PURE
+gcc_pure
static inline ALint
openal_get_source_i(const OpenALOutput *od, ALenum param)
{
@@ -99,14 +100,14 @@ openal_get_source_i(const OpenALOutput *od, ALenum param)
return value;
}
-G_GNUC_PURE
+gcc_pure
static inline bool
openal_has_processed(const OpenALOutput *od)
{
return openal_get_source_i(od, AL_BUFFERS_PROCESSED) > 0;
}
-G_GNUC_PURE
+gcc_pure
static inline ALint
openal_is_playing(const OpenALOutput *od)
{
@@ -230,7 +231,7 @@ openal_delay(struct audio_output *ao)
static size_t
openal_play(struct audio_output *ao, const void *chunk, size_t size,
- G_GNUC_UNUSED GError **error)
+ gcc_unused GError **error)
{
OpenALOutput *od = (OpenALOutput *)ao;
ALuint buffer;
diff --git a/src/output/OssOutputPlugin.cxx b/src/output/OssOutputPlugin.cxx
index 2ef0edd67..6362a374f 100644
--- a/src/output/OssOutputPlugin.cxx
+++ b/src/output/OssOutputPlugin.cxx
@@ -231,7 +231,7 @@ oss_output_finish(struct audio_output *ao)
#ifdef AFMT_S24_PACKED
static bool
-oss_output_enable(struct audio_output *ao, G_GNUC_UNUSED GError **error_r)
+oss_output_enable(struct audio_output *ao, gcc_unused GError **error_r)
{
OssOutput *od = (OssOutput *)ao;
diff --git a/src/output/PipeOutputPlugin.cxx b/src/output/PipeOutputPlugin.cxx
index f485f1554..9ff3bb120 100644
--- a/src/output/PipeOutputPlugin.cxx
+++ b/src/output/PipeOutputPlugin.cxx
@@ -95,8 +95,8 @@ pipe_output_finish(struct audio_output *ao)
static bool
pipe_output_open(struct audio_output *ao,
- G_GNUC_UNUSED AudioFormat &audio_format,
- G_GNUC_UNUSED GError **error)
+ gcc_unused AudioFormat &audio_format,
+ gcc_unused GError **error)
{
PipeOutput *pd = (PipeOutput *)ao;
diff --git a/src/output/PulseOutputPlugin.cxx b/src/output/PulseOutputPlugin.cxx
index f59c8d76e..d035d10b7 100644
--- a/src/output/PulseOutputPlugin.cxx
+++ b/src/output/PulseOutputPlugin.cxx
@@ -184,8 +184,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(G_GNUC_UNUSED pa_stream *s,
- G_GNUC_UNUSED int success, void *userdata)
+pulse_output_stream_success_cb(gcc_unused pa_stream *s,
+ gcc_unused int success, void *userdata)
{
PulseOutput *po = (PulseOutput *)userdata;
@@ -485,7 +485,7 @@ pulse_output_wait_connection(PulseOutput *po, GError **error_r)
#if PA_CHECK_VERSION(0,9,8)
static void
-pulse_output_stream_suspended_cb(G_GNUC_UNUSED pa_stream *stream, void *userdata)
+pulse_output_stream_suspended_cb(gcc_unused pa_stream *stream, void *userdata)
{
PulseOutput *po = (PulseOutput *)userdata;
@@ -531,7 +531,7 @@ pulse_output_stream_state_cb(pa_stream *stream, void *userdata)
}
static void
-pulse_output_stream_write_cb(G_GNUC_UNUSED pa_stream *stream, size_t nbytes,
+pulse_output_stream_write_cb(gcc_unused pa_stream *stream, size_t nbytes,
void *userdata)
{
PulseOutput *po = (PulseOutput *)userdata;
diff --git a/src/output/ShoutOutputPlugin.cxx b/src/output/ShoutOutputPlugin.cxx
index 2d2c0afd0..40f468031 100644
--- a/src/output/ShoutOutputPlugin.cxx
+++ b/src/output/ShoutOutputPlugin.cxx
@@ -391,7 +391,7 @@ my_shout_finish_driver(struct audio_output *ao)
static void
my_shout_drop_buffered_audio(struct audio_output *ao)
{
- G_GNUC_UNUSED
+ gcc_unused
ShoutOutput *sd = (ShoutOutput *)ao;
/* needs to be implemented for shout */
diff --git a/src/pcm/PcmBuffer.cxx b/src/pcm/PcmBuffer.cxx
index a70888080..adfd0e518 100644
--- a/src/pcm/PcmBuffer.cxx
+++ b/src/pcm/PcmBuffer.cxx
@@ -24,7 +24,7 @@
/**
* Align the specified size to the next 8k boundary.
*/
-G_GNUC_CONST
+constexpr
static size_t
align_8k(size_t size)
{
diff --git a/src/pcm/PcmDsdUsb.cxx b/src/pcm/PcmDsdUsb.cxx
index 7d58dec4d..2d0f33a15 100644
--- a/src/pcm/PcmDsdUsb.cxx
+++ b/src/pcm/PcmDsdUsb.cxx
@@ -22,14 +22,14 @@
#include "PcmBuffer.hxx"
#include "AudioFormat.hxx"
-G_GNUC_CONST
+constexpr
static inline uint32_t
pcm_two_dsd_to_usb_marker1(uint8_t a, uint8_t b)
{
return 0xff050000 | (a << 8) | b;
}
-G_GNUC_CONST
+constexpr
static inline uint32_t
pcm_two_dsd_to_usb_marker2(uint8_t a, uint8_t b)
{
diff --git a/src/pcm/PcmResampleInternal.hxx b/src/pcm/PcmResampleInternal.hxx
index 4ea96daea..5275c090a 100644
--- a/src/pcm/PcmResampleInternal.hxx
+++ b/src/pcm/PcmResampleInternal.hxx
@@ -65,7 +65,7 @@ pcm_resample_lsr_32(PcmResampler *state,
unsigned channels,
unsigned src_rate,
const int32_t *src_buffer,
- G_GNUC_UNUSED size_t src_size,
+ size_t src_size,
unsigned dest_rate, size_t *dest_size_r,
GError **error_r);
@@ -84,7 +84,7 @@ pcm_resample_fallback_32(PcmResampler *state,
unsigned channels,
unsigned src_rate,
const int32_t *src_buffer,
- G_GNUC_UNUSED size_t src_size,
+ size_t src_size,
unsigned dest_rate,
size_t *dest_size_r);
diff --git a/src/pcm/PcmVolume.cxx b/src/pcm/PcmVolume.cxx
index 2a8027400..ff505e29d 100644
--- a/src/pcm/PcmVolume.cxx
+++ b/src/pcm/PcmVolume.cxx
@@ -64,7 +64,7 @@ pcm_volume_change_16(int16_t *buffer, const int16_t *end, int volume)
* multiplication result instead of emulating 64 bit multiplication.
*/
static inline int32_t
-pcm_volume_sample_24(int32_t sample, int32_t volume, G_GNUC_UNUSED int32_t dither)
+pcm_volume_sample_24(int32_t sample, int32_t volume, gcc_unused int32_t dither)
{
int32_t result;
diff --git a/src/playlist/AsxPlaylistPlugin.cxx b/src/playlist/AsxPlaylistPlugin.cxx
index be94f81ff..b2287fcaf 100644
--- a/src/playlist/AsxPlaylistPlugin.cxx
+++ b/src/playlist/AsxPlaylistPlugin.cxx
@@ -79,11 +79,11 @@ get_attribute(const gchar **attribute_names, const gchar **attribute_values,
}
static void
-asx_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
+asx_start_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
AsxParser *parser = (AsxParser *)user_data;
@@ -130,9 +130,9 @@ asx_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-asx_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
+asx_end_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
AsxParser *parser = (AsxParser *)user_data;
@@ -156,9 +156,9 @@ asx_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-asx_text(G_GNUC_UNUSED GMarkupParseContext *context,
+asx_text(gcc_unused GMarkupParseContext *context,
const gchar *text, gsize text_len,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
AsxParser *parser = (AsxParser *)user_data;
diff --git a/src/playlist/RssPlaylistPlugin.cxx b/src/playlist/RssPlaylistPlugin.cxx
index e8f279bb2..df0f6bca3 100644
--- a/src/playlist/RssPlaylistPlugin.cxx
+++ b/src/playlist/RssPlaylistPlugin.cxx
@@ -78,11 +78,11 @@ get_attribute(const gchar **attribute_names, const gchar **attribute_values,
}
static void
-rss_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
+rss_start_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
RssParser *parser = (RssParser *)user_data;
@@ -127,9 +127,9 @@ rss_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-rss_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
+rss_end_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
RssParser *parser = (RssParser *)user_data;
@@ -153,9 +153,9 @@ rss_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-rss_text(G_GNUC_UNUSED GMarkupParseContext *context,
+rss_text(gcc_unused GMarkupParseContext *context,
const gchar *text, gsize text_len,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
RssParser *parser = (RssParser *)user_data;
diff --git a/src/playlist/XspfPlaylistPlugin.cxx b/src/playlist/XspfPlaylistPlugin.cxx
index cb3d19033..bf282eac9 100644
--- a/src/playlist/XspfPlaylistPlugin.cxx
+++ b/src/playlist/XspfPlaylistPlugin.cxx
@@ -67,11 +67,11 @@ struct XspfParser {
};
static void
-xspf_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
+xspf_start_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
- G_GNUC_UNUSED const gchar **attribute_names,
- G_GNUC_UNUSED const gchar **attribute_values,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gcc_unused const gchar **attribute_names,
+ gcc_unused const gchar **attribute_values,
+ gpointer user_data, gcc_unused GError **error)
{
XspfParser *parser = (XspfParser *)user_data;
@@ -121,9 +121,9 @@ xspf_start_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-xspf_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
+xspf_end_element(gcc_unused GMarkupParseContext *context,
const gchar *element_name,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
XspfParser *parser = (XspfParser *)user_data;
@@ -161,9 +161,9 @@ xspf_end_element(G_GNUC_UNUSED GMarkupParseContext *context,
}
static void
-xspf_text(G_GNUC_UNUSED GMarkupParseContext *context,
+xspf_text(gcc_unused GMarkupParseContext *context,
const gchar *text, gsize text_len,
- gpointer user_data, G_GNUC_UNUSED GError **error)
+ gpointer user_data, gcc_unused GError **error)
{
XspfParser *parser = (XspfParser *)user_data;
diff --git a/src/playlist_error.h b/src/playlist_error.h
index ad9c62cf1..9871a0365 100644
--- a/src/playlist_error.h
+++ b/src/playlist_error.h
@@ -20,6 +20,8 @@
#ifndef MPD_PLAYLIST_ERROR_H
#define MPD_PLAYLIST_ERROR_H
+#include "gcc.h"
+
#include <glib.h>
enum playlist_result {
@@ -39,7 +41,7 @@ enum playlist_result {
/**
* Quark for GError.domain; the code is an enum #playlist_result.
*/
-G_GNUC_CONST
+gcc_const
static inline GQuark
playlist_quark(void)
{
diff --git a/src/util/Tokenizer.cxx b/src/util/Tokenizer.cxx
index 37650483f..0bb6edd71 100644
--- a/src/util/Tokenizer.cxx
+++ b/src/util/Tokenizer.cxx
@@ -26,7 +26,7 @@
#include <assert.h>
#include <string.h>
-G_GNUC_CONST
+gcc_const
static GQuark
tokenizer_quark(void)
{