*: use gcc.h macros instead of GLib

This commit is contained in:
Max Kellermann 2013-08-04 23:48:01 +02:00
parent 5bf2ec5a74
commit 85b77b81ca
98 changed files with 369 additions and 349 deletions

View File

@ -1158,7 +1158,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = G_GNUC_UNUSED=
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.

View File

@ -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;

View File

@ -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)
{

View File

@ -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, ...)
{

View File

@ -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))

View File

@ -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);

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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 = "";

View File

@ -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)
{

View File

@ -47,7 +47,7 @@ enum {
DB_FORMAT = 1,
};
G_GNUC_CONST
gcc_const
static GQuark
db_quark(void)
{

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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)
{
}

View File

@ -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

View File

@ -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)
{

View File

@ -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);

View File

@ -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;

View File

@ -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));

View File

@ -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);

View File

@ -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)
{

View File

@ -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());

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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);

View File

@ -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.");

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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
{

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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);

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
@ -253,7 +253,7 @@ 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)
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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 */

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -26,7 +26,7 @@
#include <assert.h>
#include <string.h>
G_GNUC_CONST
gcc_const
static GQuark
tokenizer_quark(void)
{

View File

@ -36,8 +36,8 @@ using std::endl;
#include <stdlib.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);

View File

@ -40,8 +40,8 @@ Directory::Directory() {}
Directory::~Directory() {}
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);
@ -50,37 +50,37 @@ my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
}
void
decoder_initialized(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED const AudioFormat audio_format,
G_GNUC_UNUSED bool seekable,
G_GNUC_UNUSED float total_time)
decoder_initialized(gcc_unused struct decoder *decoder,
gcc_unused const AudioFormat audio_format,
gcc_unused bool seekable,
gcc_unused float total_time)
{
}
enum decoder_command
decoder_get_command(G_GNUC_UNUSED struct decoder *decoder)
decoder_get_command(gcc_unused struct decoder *decoder)
{
return DECODE_COMMAND_NONE;
}
void
decoder_command_finished(G_GNUC_UNUSED struct decoder *decoder)
decoder_command_finished(gcc_unused struct decoder *decoder)
{
}
double
decoder_seek_where(G_GNUC_UNUSED struct decoder *decoder)
decoder_seek_where(gcc_unused struct decoder *decoder)
{
return 1.0;
}
void
decoder_seek_error(G_GNUC_UNUSED struct decoder *decoder)
decoder_seek_error(gcc_unused struct decoder *decoder)
{
}
size_t
decoder_read(G_GNUC_UNUSED struct decoder *decoder,
decoder_read(gcc_unused struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
@ -88,31 +88,31 @@ decoder_read(G_GNUC_UNUSED struct decoder *decoder,
}
void
decoder_timestamp(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED double t)
decoder_timestamp(gcc_unused struct decoder *decoder,
gcc_unused double t)
{
}
enum decoder_command
decoder_data(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
decoder_data(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
const void *data, size_t datalen,
G_GNUC_UNUSED uint16_t kbit_rate)
gcc_unused uint16_t kbit_rate)
{
G_GNUC_UNUSED ssize_t nbytes = write(1, data, datalen);
gcc_unused ssize_t nbytes = write(1, data, datalen);
return DECODE_COMMAND_NONE;
}
enum decoder_command
decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
G_GNUC_UNUSED Tag &&tag)
decoder_tag(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
gcc_unused Tag &&tag)
{
return DECODE_COMMAND_NONE;
}
void
decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
decoder_replay_gain(gcc_unused struct decoder *decoder,
const struct replay_gain_info *replay_gain_info)
{
const struct replay_gain_tuple *tuple =
@ -128,7 +128,7 @@ decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
}
void
decoder_mixramp(G_GNUC_UNUSED struct decoder *decoder,
decoder_mixramp(gcc_unused struct decoder *decoder,
char *mixramp_start, char *mixramp_end)
{
g_free(mixramp_start);

View File

@ -36,8 +36,8 @@
#include <stdlib.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);

View File

@ -26,9 +26,9 @@
#include <assert.h>
static void
my_log_func(G_GNUC_UNUSED const gchar *log_domain,
my_log_func(gcc_unused const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
const gchar *message, gcc_unused gpointer user_data)
{
if (log_level > G_LOG_LEVEL_WARNING)
return;

View File

@ -39,31 +39,31 @@ EventLoop *main_loop;
#include "output/PulseOutputPlugin.hxx"
void
pulse_output_lock(G_GNUC_UNUSED PulseOutput *po)
pulse_output_lock(gcc_unused PulseOutput *po)
{
}
void
pulse_output_unlock(G_GNUC_UNUSED PulseOutput *po)
pulse_output_unlock(gcc_unused PulseOutput *po)
{
}
void
pulse_output_set_mixer(G_GNUC_UNUSED PulseOutput *po,
G_GNUC_UNUSED PulseMixer *pm)
pulse_output_set_mixer(gcc_unused PulseOutput *po,
gcc_unused PulseMixer *pm)
{
}
void
pulse_output_clear_mixer(G_GNUC_UNUSED PulseOutput *po,
G_GNUC_UNUSED PulseMixer *pm)
pulse_output_clear_mixer(gcc_unused PulseOutput *po,
gcc_unused PulseMixer *pm)
{
}
bool
pulse_output_set_volume(G_GNUC_UNUSED PulseOutput *po,
G_GNUC_UNUSED const struct pa_cvolume *volume,
G_GNUC_UNUSED GError **error_r)
pulse_output_set_volume(gcc_unused PulseOutput *po,
gcc_unused const struct pa_cvolume *volume,
gcc_unused GError **error_r)
{
return false;
}
@ -81,7 +81,7 @@ roar_output_get_volume(gcc_unused RoarOutput *roar)
bool
roar_output_set_volume(gcc_unused RoarOutput *roar,
G_GNUC_UNUSED unsigned volume)
gcc_unused unsigned volume)
{
return true;
}
@ -94,22 +94,22 @@ GlobalEvents::Emit(gcc_unused Event event)
}
const struct filter_plugin *
filter_plugin_by_name(G_GNUC_UNUSED const char *name)
filter_plugin_by_name(gcc_unused const char *name)
{
assert(false);
return NULL;
}
bool
pcm_volume(G_GNUC_UNUSED void *buffer, G_GNUC_UNUSED size_t length,
G_GNUC_UNUSED SampleFormat format,
G_GNUC_UNUSED int volume)
pcm_volume(gcc_unused void *buffer, gcc_unused size_t length,
gcc_unused SampleFormat format,
gcc_unused int volume)
{
assert(false);
return false;
}
int main(int argc, G_GNUC_UNUSED char **argv)
int main(int argc, gcc_unused char **argv)
{
GError *error = NULL;
bool success;

View File

@ -39,34 +39,34 @@
#endif
void
decoder_initialized(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED const AudioFormat audio_format,
G_GNUC_UNUSED bool seekable,
G_GNUC_UNUSED float total_time)
decoder_initialized(gcc_unused struct decoder *decoder,
gcc_unused const AudioFormat audio_format,
gcc_unused bool seekable,
gcc_unused float total_time)
{
}
enum decoder_command
decoder_get_command(G_GNUC_UNUSED struct decoder *decoder)
decoder_get_command(gcc_unused struct decoder *decoder)
{
return DECODE_COMMAND_NONE;
}
void decoder_command_finished(G_GNUC_UNUSED struct decoder *decoder)
void decoder_command_finished(gcc_unused struct decoder *decoder)
{
}
double decoder_seek_where(G_GNUC_UNUSED struct decoder *decoder)
double decoder_seek_where(gcc_unused struct decoder *decoder)
{
return 1.0;
}
void decoder_seek_error(G_GNUC_UNUSED struct decoder *decoder)
void decoder_seek_error(gcc_unused struct decoder *decoder)
{
}
size_t
decoder_read(G_GNUC_UNUSED struct decoder *decoder,
decoder_read(gcc_unused struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
@ -74,37 +74,37 @@ decoder_read(G_GNUC_UNUSED struct decoder *decoder,
}
void
decoder_timestamp(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED double t)
decoder_timestamp(gcc_unused struct decoder *decoder,
gcc_unused double t)
{
}
enum decoder_command
decoder_data(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
decoder_data(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
const void *data, size_t datalen,
G_GNUC_UNUSED uint16_t bit_rate)
gcc_unused uint16_t bit_rate)
{
G_GNUC_UNUSED ssize_t nbytes = write(1, data, datalen);
gcc_unused ssize_t nbytes = write(1, data, datalen);
return DECODE_COMMAND_NONE;
}
enum decoder_command
decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
G_GNUC_UNUSED Tag &&tag)
decoder_tag(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
gcc_unused Tag &&tag)
{
return DECODE_COMMAND_NONE;
}
void
decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED const struct replay_gain_info *replay_gain_info)
decoder_replay_gain(gcc_unused struct decoder *decoder,
gcc_unused const struct replay_gain_info *replay_gain_info)
{
}
void
decoder_mixramp(G_GNUC_UNUSED struct decoder *decoder,
decoder_mixramp(gcc_unused struct decoder *decoder,
char *mixramp_start, char *mixramp_end)
{
g_free(mixramp_start);
@ -114,20 +114,20 @@ decoder_mixramp(G_GNUC_UNUSED struct decoder *decoder,
static bool empty = true;
static void
print_duration(unsigned seconds, G_GNUC_UNUSED void *ctx)
print_duration(unsigned seconds, gcc_unused void *ctx)
{
g_print("duration=%d\n", seconds);
}
static void
print_tag(enum tag_type type, const char *value, G_GNUC_UNUSED void *ctx)
print_tag(enum tag_type type, const char *value, gcc_unused void *ctx)
{
g_print("[%s]=%s\n", tag_item_names[type], value);
empty = false;
}
static void
print_pair(const char *name, const char *value, G_GNUC_UNUSED void *ctx)
print_pair(const char *name, const char *value, gcc_unused void *ctx)
{
g_print("\"%s\"=%s\n", name, value);
}

View File

@ -38,8 +38,8 @@
#include <unistd.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);
@ -119,7 +119,7 @@ int main(int argc, char **argv)
return 2;
}
G_GNUC_UNUSED ssize_t ignored = write(1, output, length);
gcc_unused ssize_t ignored = write(1, output, length);
}
return EXIT_SUCCESS;

View File

@ -33,8 +33,8 @@
#include <stdlib.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);
@ -53,8 +53,8 @@ struct decoder {
void
decoder_initialized(struct decoder *decoder,
const AudioFormat audio_format,
G_GNUC_UNUSED bool seekable,
G_GNUC_UNUSED float total_time)
gcc_unused bool seekable,
gcc_unused float total_time)
{
struct audio_format_string af_string;
@ -68,26 +68,26 @@ decoder_initialized(struct decoder *decoder,
}
enum decoder_command
decoder_get_command(G_GNUC_UNUSED struct decoder *decoder)
decoder_get_command(gcc_unused struct decoder *decoder)
{
return DECODE_COMMAND_NONE;
}
void decoder_command_finished(G_GNUC_UNUSED struct decoder *decoder)
void decoder_command_finished(gcc_unused struct decoder *decoder)
{
}
double decoder_seek_where(G_GNUC_UNUSED struct decoder *decoder)
double decoder_seek_where(gcc_unused struct decoder *decoder)
{
return 1.0;
}
void decoder_seek_error(G_GNUC_UNUSED struct decoder *decoder)
void decoder_seek_error(gcc_unused struct decoder *decoder)
{
}
size_t
decoder_read(G_GNUC_UNUSED struct decoder *decoder,
decoder_read(gcc_unused struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
@ -95,31 +95,31 @@ decoder_read(G_GNUC_UNUSED struct decoder *decoder,
}
void
decoder_timestamp(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED double t)
decoder_timestamp(gcc_unused struct decoder *decoder,
gcc_unused double t)
{
}
enum decoder_command
decoder_data(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
decoder_data(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
const void *data, size_t datalen,
G_GNUC_UNUSED uint16_t kbit_rate)
gcc_unused uint16_t kbit_rate)
{
G_GNUC_UNUSED ssize_t nbytes = write(1, data, datalen);
gcc_unused ssize_t nbytes = write(1, data, datalen);
return DECODE_COMMAND_NONE;
}
enum decoder_command
decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
G_GNUC_UNUSED struct input_stream *is,
G_GNUC_UNUSED Tag &&tag)
decoder_tag(gcc_unused struct decoder *decoder,
gcc_unused struct input_stream *is,
gcc_unused Tag &&tag)
{
return DECODE_COMMAND_NONE;
}
void
decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
decoder_replay_gain(gcc_unused struct decoder *decoder,
const struct replay_gain_info *replay_gain_info)
{
const struct replay_gain_tuple *tuple =
@ -135,7 +135,7 @@ decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
}
void
decoder_mixramp(G_GNUC_UNUSED struct decoder *decoder,
decoder_mixramp(gcc_unused struct decoder *decoder,
char *mixramp_start, char *mixramp_end)
{
g_free(mixramp_start);

View File

@ -37,7 +37,7 @@ encoder_to_stdout(Encoder &encoder)
static char buffer[32768];
while ((length = encoder_read(&encoder, buffer, sizeof(buffer))) > 0) {
G_GNUC_UNUSED ssize_t ignored = write(1, buffer, length);
gcc_unused ssize_t ignored = write(1, buffer, length);
}
}

View File

@ -37,14 +37,14 @@
bool
mixer_set_volume(gcc_unused Mixer *mixer,
G_GNUC_UNUSED unsigned volume, G_GNUC_UNUSED GError **error_r)
gcc_unused unsigned volume, gcc_unused GError **error_r)
{
return true;
}
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);

View File

@ -29,7 +29,7 @@
static EventLoop *event_loop;
static void
exit_signal_handler(G_GNUC_UNUSED int signum)
exit_signal_handler(gcc_unused int signum)
{
event_loop->Break();
}
@ -43,8 +43,8 @@ enum {
};
static void
my_inotify_callback(G_GNUC_UNUSED int wd, unsigned mask,
const char *name, G_GNUC_UNUSED void *ctx)
my_inotify_callback(gcc_unused int wd, unsigned mask,
const char *name, gcc_unused void *ctx)
{
g_print("mask=0x%x name='%s'\n", mask, name);
}

View File

@ -37,8 +37,8 @@
#include <stdlib.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);

View File

@ -65,7 +65,7 @@ int main(int argc, char **argv)
Compressor_Process_int16(compressor,
(int16_t *)buffer, nbytes / 2);
G_GNUC_UNUSED ssize_t ignored = write(1, buffer, nbytes);
gcc_unused ssize_t ignored = write(1, buffer, nbytes);
}
Compressor_delete(compressor);

View File

@ -64,7 +64,7 @@ PcmConvert::Convert(gcc_unused const AudioFormat src_format,
}
const struct filter_plugin *
filter_plugin_by_name(G_GNUC_UNUSED const char *name)
filter_plugin_by_name(gcc_unused const char *name)
{
assert(false);
return NULL;

View File

@ -30,7 +30,7 @@
#include <string.h>
static void
quit_signal_handler(G_GNUC_UNUSED int signum)
quit_signal_handler(gcc_unused int signum)
{
on_quit();
}

View File

@ -65,6 +65,6 @@ int main(int argc, char **argv)
return 2;
}
G_GNUC_UNUSED ssize_t ignored = write(1, buffer, nbytes);
gcc_unused ssize_t ignored = write(1, buffer, nbytes);
}
}

View File

@ -39,14 +39,14 @@ encoder_to_stdout(Encoder &encoder)
static char buffer[32768];
while ((length = encoder_read(&encoder, buffer, sizeof(buffer))) > 0) {
G_GNUC_UNUSED ssize_t ignored = write(1, buffer, length);
gcc_unused ssize_t ignored = write(1, buffer, length);
}
}
int
main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
main(gcc_unused int argc, gcc_unused char **argv)
{
G_GNUC_UNUSED bool success;
gcc_unused bool success;
/* create the encoder */

View File

@ -35,8 +35,8 @@
#include <stdlib.h>
static void
my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
const gchar *message, gcc_unused gpointer user_data)
{
if (log_domain != NULL)
g_printerr("%s: %s\n", log_domain, message);