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

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