From 85b77b81caa40f8bcd03921380246cb5863d5d21 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2013 23:48:01 +0200 Subject: *: use gcc.h macros instead of GLib --- test/DumpDatabase.cxx | 4 ++-- test/dump_playlist.cxx | 44 ++++++++++++++++++++-------------------- test/dump_text_file.cxx | 4 ++-- test/read_conf.cxx | 4 ++-- test/read_mixer.cxx | 30 +++++++++++++-------------- test/read_tags.cxx | 48 ++++++++++++++++++++++---------------------- test/run_convert.cxx | 6 +++--- test/run_decoder.cxx | 40 ++++++++++++++++++------------------ test/run_encoder.cxx | 2 +- test/run_filter.cxx | 6 +++--- test/run_inotify.cxx | 6 +++--- test/run_input.cxx | 4 ++-- test/run_normalize.cxx | 2 +- test/run_output.cxx | 2 +- test/signals.c | 2 +- test/software_volume.cxx | 2 +- test/test_vorbis_encoder.cxx | 6 +++--- test/visit_archive.cxx | 4 ++-- 18 files changed, 108 insertions(+), 108 deletions(-) (limited to 'test') diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx index c6a01fa11..e788d625a 100644 --- a/test/DumpDatabase.cxx +++ b/test/DumpDatabase.cxx @@ -36,8 +36,8 @@ using std::endl; #include 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); diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx index bf8ddcdfe..5d0ea4aec 100644 --- a/test/dump_playlist.cxx +++ b/test/dump_playlist.cxx @@ -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); diff --git a/test/dump_text_file.cxx b/test/dump_text_file.cxx index 40b3a878f..8a8f9e77f 100644 --- a/test/dump_text_file.cxx +++ b/test/dump_text_file.cxx @@ -36,8 +36,8 @@ #include 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); diff --git a/test/read_conf.cxx b/test/read_conf.cxx index 8759398da..79f3eca54 100644 --- a/test/read_conf.cxx +++ b/test/read_conf.cxx @@ -26,9 +26,9 @@ #include 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; diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx index 54c92eea3..0cc84c9b9 100644 --- a/test/read_mixer.cxx +++ b/test/read_mixer.cxx @@ -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; diff --git a/test/read_tags.cxx b/test/read_tags.cxx index 420cf9f0e..5880662de 100644 --- a/test/read_tags.cxx +++ b/test/read_tags.cxx @@ -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); } diff --git a/test/run_convert.cxx b/test/run_convert.cxx index ce7df42c3..37e2c8734 100644 --- a/test/run_convert.cxx +++ b/test/run_convert.cxx @@ -38,8 +38,8 @@ #include 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; diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx index a5826b278..64efbd944 100644 --- a/test/run_decoder.cxx +++ b/test/run_decoder.cxx @@ -33,8 +33,8 @@ #include 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); diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx index 27ffddedd..b7d64e40a 100644 --- a/test/run_encoder.cxx +++ b/test/run_encoder.cxx @@ -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); } } diff --git a/test/run_filter.cxx b/test/run_filter.cxx index 761bc14e8..e39626ea5 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -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); diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx index 29fcf70ab..e8ca4c8bd 100644 --- a/test/run_inotify.cxx +++ b/test/run_inotify.cxx @@ -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); } diff --git a/test/run_input.cxx b/test/run_input.cxx index e93e817d3..764a110fa 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -37,8 +37,8 @@ #include 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); diff --git a/test/run_normalize.cxx b/test/run_normalize.cxx index 72e23054f..5b51f4631 100644 --- a/test/run_normalize.cxx +++ b/test/run_normalize.cxx @@ -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); diff --git a/test/run_output.cxx b/test/run_output.cxx index fbdeebcb6..59f962a4f 100644 --- a/test/run_output.cxx +++ b/test/run_output.cxx @@ -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; diff --git a/test/signals.c b/test/signals.c index 15761f6b0..69e64daca 100644 --- a/test/signals.c +++ b/test/signals.c @@ -30,7 +30,7 @@ #include static void -quit_signal_handler(G_GNUC_UNUSED int signum) +quit_signal_handler(gcc_unused int signum) { on_quit(); } diff --git a/test/software_volume.cxx b/test/software_volume.cxx index c46804731..d3b47d74a 100644 --- a/test/software_volume.cxx +++ b/test/software_volume.cxx @@ -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); } } diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx index 75e1462dc..12e17a785 100644 --- a/test/test_vorbis_encoder.cxx +++ b/test/test_vorbis_encoder.cxx @@ -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 */ diff --git a/test/visit_archive.cxx b/test/visit_archive.cxx index 047fe62c0..d6ed0c6a1 100644 --- a/test/visit_archive.cxx +++ b/test/visit_archive.cxx @@ -35,8 +35,8 @@ #include 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); -- cgit v1.2.3