Cleanup compiler warnings.

- Unused var.
- Missing switch statement.
- Change fallthrough for older compilers.
This commit is contained in:
Dave Davenport 2017-09-17 18:17:26 +02:00
parent d1f9927343
commit ff4946edaf
7 changed files with 23 additions and 17 deletions

View File

@ -250,6 +250,11 @@ static void rofi_theme_print_property_index ( size_t pnl, int depth, Property *p
case P_LINK:
printf ( "%s;", p->value.link.name );
break;
case P_INHERIT:
printf ( "inherit;" );
break;
default:
break;
}
putchar ( '\n' );
}
@ -354,7 +359,7 @@ void yyerror ( YYLTYPE *yylloc, const char *what, const char* s )
rofi_add_error_message ( str );
}
static void rofi_theme_copy_property_int ( gpointer key, gpointer value, gpointer user_data )
static void rofi_theme_copy_property_int ( G_GNUC_UNUSED gpointer key, gpointer value, gpointer user_data )
{
GHashTable *table = (GHashTable *) user_data;
Property *p = rofi_theme_property_copy( (Property*) value);

View File

@ -308,30 +308,31 @@ static void rofi_view_calculate_window_position ( RofiViewState *state )
{
case WL_NORTH_WEST:
state->x = CacheState.mon.x;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WL_NORTH:
state->y = CacheState.mon.y;
break;
case WL_NORTH_EAST:
state->y = CacheState.mon.y;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WL_EAST:
state->x = CacheState.mon.x + CacheState.mon.w;
break;
case WL_SOUTH_EAST:
state->x = CacheState.mon.x + CacheState.mon.w;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WL_SOUTH:
state->y = CacheState.mon.y + CacheState.mon.h;
break;
case WL_SOUTH_WEST:
state->y = CacheState.mon.y + CacheState.mon.h;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WL_WEST:
state->x = CacheState.mon.x;
break;
case WL_CENTER:
; __attribute__ ( ( fallthrough ) );
;
/* FALLTHRU */
default:
break;
}
@ -1363,10 +1364,10 @@ gboolean rofi_view_trigger_action ( RofiViewState *state, BindingsScope scope, g
return FALSE;
case WIDGET_TRIGGER_ACTION_RESULT_GRAB_MOTION_END:
target = NULL;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WIDGET_TRIGGER_ACTION_RESULT_GRAB_MOTION_BEGIN:
state->mouse.motion_target = target;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case WIDGET_TRIGGER_ACTION_RESULT_HANDLED:
return TRUE;
}
@ -1516,7 +1517,7 @@ static void rofi_view_listview_mouse_activated_cb ( listview *lv, gboolean custo
state->skip_absorb = TRUE;
}
static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget, const char *parent, const char *name )
static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget, const char *name )
{
char *defaults = NULL;
widget *wid = NULL;
@ -1587,7 +1588,7 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
return;
}
state->mesg_box = container_create ( parent_widget, name );
state->mesg_tb = textbox_create ( state->mesg_box, WIDGET_TYPE_TEXTBOX_TEXT, "textbox", TB_AUTOHEIGHT | TB_MARKUP | TB_WRAP, NORMAL, NULL, 0, 0 );
state->mesg_tb = textbox_create ( WIDGET ( state->mesg_box ), WIDGET_TYPE_TEXTBOX_TEXT, "textbox", TB_AUTOHEIGHT | TB_MARKUP | TB_WRAP, NORMAL, NULL, 0, 0 );
container_add ( state->mesg_box, WIDGET ( state->mesg_tb ) );
rofi_view_reload_message_bar ( state );
box_add ( (box *) parent_widget, WIDGET ( state->mesg_box ), FALSE );
@ -1645,7 +1646,7 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
if ( wid ) {
GList *list = rofi_theme_get_list ( wid, "children", defaults );
for ( const GList *iter = list; iter != NULL; iter = g_list_next ( iter ) ) {
rofi_view_add_widget ( state, wid, "", (const char *) iter->data );
rofi_view_add_widget ( state, wid, (const char *) iter->data );
}
g_list_free_full ( list, g_free );
}
@ -1682,7 +1683,7 @@ RofiViewState *rofi_view_create ( Mode *sw,
// Get children.
GList *list = rofi_theme_get_list ( WIDGET ( state->main_window ), "children", "mainbox" );
for ( const GList *iter = list; iter != NULL; iter = g_list_next ( iter ) ) {
rofi_view_add_widget ( state, WIDGET ( state->main_window ), "window", (const char *) iter->data );
rofi_view_add_widget ( state, WIDGET ( state->main_window ), (const char *) iter->data );
}
g_list_free_full ( list, g_free );

View File

@ -502,7 +502,7 @@ static WidgetTriggerActionResult listview_element_trigger_action ( widget *wid,
break;
case ACCEPT_HOVERED_CUSTOM:
custom = TRUE;
__attribute__ ( ( fallthrough ) );
/* FALLTHRU */
case ACCEPT_HOVERED_ENTRY:
listview_set_selected ( lv, lv->last_offset + i );
lv->mouse_activated ( lv, custom, lv->mouse_activated_data );

View File

@ -63,7 +63,7 @@ unsigned int test =0;
} \
}
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, char **error )
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{
return FALSE;
}

View File

@ -59,7 +59,7 @@ char * helper_get_theme_path ( const char *file )
{
return g_strdup ( file );
}
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, char **error )
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{
return FALSE;
}

View File

@ -52,7 +52,7 @@ unsigned int normal_window_mode = 0;
#include "view.h"
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, char **error )
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{
return FALSE;
}

View File

@ -43,7 +43,7 @@ unsigned int test =0;
assert ( a ); \
printf ( "Test %3i passed (%s)\n", ++test, # a ); \
}
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, char **error )
gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNUSED char **error )
{
return FALSE;
}