Make the compiler STFU about desired fallthroughs.

* https://dzone.com/articles/implicit-fallthrough-in-gcc-7
This commit is contained in:
Dave Davenport 2017-06-12 07:47:44 +02:00
parent 5d3f69ff69
commit c53e6cc20c
2 changed files with 8 additions and 0 deletions

View File

@ -288,25 +288,30 @@ static void rofi_view_calculate_window_position ( RofiViewState *state )
{
case WL_NORTH_WEST:
state->x = CacheState.mon.x;
__attribute__ ((fallthrough));
case WL_NORTH:
state->y = CacheState.mon.y;
break;
case WL_NORTH_EAST:
state->y = CacheState.mon.y;
__attribute__ ((fallthrough));
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));
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));
case WL_WEST:
state->x = CacheState.mon.x;
break;
case WL_CENTER:
__attribute__ ((fallthrough));
default:
break;
}
@ -1337,8 +1342,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));
case WIDGET_TRIGGER_ACTION_RESULT_GRAB_MOTION_BEGIN:
state->mouse.motion_target = target;
__attribute__ ((fallthrough));
case WIDGET_TRIGGER_ACTION_RESULT_HANDLED:
return TRUE;
}

View File

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