config-parser: assert elements are of a known type
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 17 Jan 2017 20:59:57 +0000 (20:59 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 7 Apr 2017 11:08:30 +0000 (12:08 +0100)
This silences -Wswitch-default.

Based on part of a patch from Thomas Zimmermann.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191

bus/config-parser.c

index 492cbc2..c8d026f 100644 (file)
@@ -2165,6 +2165,7 @@ bus_config_parser_end_element (BusConfigParser   *parser,
   switch (e->type)
     {
     case ELEMENT_NONE:
+    default:
       _dbus_assert_not_reached ("element in stack has no type");
       break;
 
@@ -2506,6 +2507,7 @@ bus_config_parser_content (BusConfigParser   *parser,
   switch (top_element_type (parser))
     {
     case ELEMENT_NONE:
+    default:
       _dbus_assert_not_reached ("element at top of stack has no type");
       return FALSE;