From dbf551ec15328307ad5b956e3070f0e707a1b8f4 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 3 May 2017 17:57:08 +0200 Subject: [PATCH] Cleanup some compile warning on the tests --- test/box-test.c | 10 +++++----- test/helper-config-cmdline-parser.c | 14 +++++++------- test/helper-expand.c | 2 +- test/helper-pidfile.c | 6 +++--- test/helper-test.c | 2 +- test/helper-tokenize.c | 6 +++--- test/mode-test.c | 11 ++++++----- test/scrollbar-test.c | 10 +++++----- test/textbox-test.c | 6 +++--- test/widget-test.c | 6 +++--- 10 files changed, 37 insertions(+), 36 deletions(-) diff --git a/test/box-test.c b/test/box-test.c index bb104cab..a2840c49 100644 --- a/test/box-test.c +++ b/test/box-test.c @@ -50,19 +50,19 @@ unsigned int test =0; } \ } -void config_parse_set_property ( const void *p ) +void config_parse_set_property ( G_GNUC_UNUSED const void *p ) { } -char * rofi_expand_path ( const char *path ) +char * rofi_expand_path ( G_GNUC_UNUSED const char *path ) { - + return NULL; } char * helper_get_theme_path ( const char *file ) { return g_strdup ( file ); } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } int textbox_get_estimated_char_height ( void ); @@ -70,7 +70,7 @@ int textbox_get_estimated_char_height ( void ) { return 16; } -void rofi_view_get_current_monitor ( int *width, int *height ) +void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height ) { } diff --git a/test/helper-config-cmdline-parser.c b/test/helper-config-cmdline-parser.c index f3642f53..473a4f85 100644 --- a/test/helper-config-cmdline-parser.c +++ b/test/helper-config-cmdline-parser.c @@ -51,7 +51,7 @@ struct xcb_stuff *xcb; abort ( ); \ } \ } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) @@ -66,7 +66,7 @@ int show_error_message ( const char *msg, int markup ) return 0; } -int main ( int argc, char ** argv ) +int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) { if ( setlocale ( LC_ALL, "" ) == NULL ) { @@ -103,17 +103,17 @@ int main ( int argc, char ** argv ) TASSERT ( str == list[3] ); unsigned int u = 1234; - unsigned int i = -1234; + int d = -1234; TASSERT ( find_arg_uint ( "-x", &u ) == FALSE ); TASSERT ( u == 1234 ); - TASSERT ( find_arg_int ( "-x", &i ) == FALSE ); - TASSERT ( i == -1234 ); + TASSERT ( find_arg_int ( "-x", &d ) == FALSE ); + TASSERT ( d == -1234 ); TASSERT ( find_arg_uint ( "-u", &u ) == TRUE ); TASSERT ( u == 4 ); TASSERT ( find_arg_uint ( "-i", &u ) == TRUE ); TASSERT ( u == 4294967293 ); - TASSERT ( find_arg_int ( "-i", &i ) == TRUE ); - TASSERT ( i == -3 ); + TASSERT ( find_arg_int ( "-i", &d ) == TRUE ); + TASSERT ( d == -3 ); g_strfreev ( list ); diff --git a/test/helper-expand.c b/test/helper-expand.c index 9b30b41e..bbc9c155 100644 --- a/test/helper-expand.c +++ b/test/helper-expand.c @@ -51,7 +51,7 @@ struct xcb_stuff *xcb; abort ( ); \ } \ } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } diff --git a/test/helper-pidfile.c b/test/helper-pidfile.c index 889d1766..0815c9cf 100644 --- a/test/helper-pidfile.c +++ b/test/helper-pidfile.c @@ -42,7 +42,7 @@ static int test = 0; assert ( a ); \ printf ( "Test %i passed (%s)\n", ++test, # a ); \ } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) @@ -51,7 +51,7 @@ int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) return TRUE; } -int show_error_message ( const char *msg, int markup ) +int show_error_message ( const char *msg, G_GNUC_UNUSED int markup ) { fputs ( msg, stderr ); return 0; @@ -61,7 +61,7 @@ xcb_ewmh_connection_t xcb_ewmh; int xcb_screen_nbr; #include -int main ( int argc, char ** argv ) +int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) { if ( setlocale ( LC_ALL, "" ) == NULL ) { fprintf ( stderr, "Failed to set locale.\n" ); diff --git a/test/helper-test.c b/test/helper-test.c index 86d65144..4114d0b5 100644 --- a/test/helper-test.c +++ b/test/helper-test.c @@ -59,7 +59,7 @@ struct xcb_stuff *xcb; abort ( ); \ } \ } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } diff --git a/test/helper-tokenize.c b/test/helper-tokenize.c index 6f2b31f7..22fffd03 100644 --- a/test/helper-tokenize.c +++ b/test/helper-tokenize.c @@ -42,7 +42,7 @@ static int test = 0; assert ( a ); \ printf ( "Test %i passed (%s)\n", ++test, # a ); \ } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) @@ -51,7 +51,7 @@ int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup ) return TRUE; } -int show_error_message ( const char *msg, int markup ) +int show_error_message ( const char *msg, G_GNUC_UNUSED int markup ) { fputs ( msg, stderr ); return 0; @@ -61,7 +61,7 @@ xcb_ewmh_connection_t xcb_ewmh; int xcb_screen_nbr; #include -int main ( int argc, char ** argv ) +int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv ) { if ( setlocale ( LC_ALL, "" ) == NULL ) { fprintf ( stderr, "Failed to set locale.\n" ); diff --git a/test/mode-test.c b/test/mode-test.c index 49d441b8..0510c408 100644 --- a/test/mode-test.c +++ b/test/mode-test.c @@ -42,10 +42,10 @@ #include -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } -int monitor_active ( void *d ) +int monitor_active ( G_GNUC_UNUSED void *d ) { return 0; } @@ -59,7 +59,7 @@ int textbox_get_estimated_char_height ( void ) { return 16; } -void rofi_view_get_current_monitor ( int *width, int *height ) +void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height ) { } @@ -67,10 +67,11 @@ void * rofi_view_get_active ( void ) { return NULL; } -gboolean rofi_view_trigger_action ( void *state, KeyBindingAction action ) +gboolean rofi_view_trigger_action ( G_GNUC_UNUSED void *state, G_GNUC_UNUSED KeyBindingAction action ) { + return FALSE; } -gboolean x11_parse_key ( const char *combo, unsigned int *mod, xkb_keysym_t *key, gboolean *release, GString *msg ) +gboolean x11_parse_key ( G_GNUC_UNUSED const char *combo, G_GNUC_UNUSED unsigned int *mod, G_GNUC_UNUSED xkb_keysym_t *key, G_GNUC_UNUSED gboolean *release, G_GNUC_UNUSED GString *msg ) { return TRUE; } diff --git a/test/scrollbar-test.c b/test/scrollbar-test.c index 17c51d4b..1a9ee848 100644 --- a/test/scrollbar-test.c +++ b/test/scrollbar-test.c @@ -54,15 +54,15 @@ char * helper_get_theme_path ( const char *file ) { return g_strdup ( file ); } -void config_parse_set_property ( const void *p ) +void config_parse_set_property ( G_GNUC_UNUSED const void *p ) { } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) {} -char * rofi_expand_path ( const char *path ) +char * rofi_expand_path ( G_GNUC_UNUSED const char *path ) { - + return NULL; } int textbox_get_estimated_char_height ( void ); int textbox_get_estimated_char_height ( void ) @@ -74,7 +74,7 @@ void color_separator ( G_GNUC_UNUSED void *d ) } -void rofi_view_get_current_monitor ( int *width, int *height ) +void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height ) { } diff --git a/test/textbox-test.c b/test/textbox-test.c index ce954f3c..3b1ceb7e 100644 --- a/test/textbox-test.c +++ b/test/textbox-test.c @@ -49,17 +49,17 @@ unsigned int normal_window_mode = 0; #include "view.h" -void config_parse_set_property ( void *p ) +void config_parse_set_property ( G_GNUC_UNUSED void *p ) { } -void rofi_add_error_message ( GString *msg) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg) { } void rofi_view_queue_redraw () { } -void rofi_view_get_current_monitor ( int *width, int *height ) +void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height ) { } diff --git a/test/widget-test.c b/test/widget-test.c index eab08e4a..ab9da425 100644 --- a/test/widget-test.c +++ b/test/widget-test.c @@ -39,17 +39,17 @@ unsigned int test =0; assert ( a ); \ printf ( "Test %3i passed (%s)\n", ++test, # a ); \ } -void config_parse_set_property ( const void *p ) +void config_parse_set_property ( G_GNUC_UNUSED const void *p ) { } -void rofi_add_error_message ( GString *msg ) +void rofi_add_error_message ( G_GNUC_UNUSED GString *msg ) { } void rofi_view_queue_redraw ( void ) { } -void rofi_view_get_current_monitor ( int *width, int *height ) +void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height ) { }