From 5fdb0f970fb0411ff5f382b361f4dd514c3483cf Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 23 Aug 2016 20:52:04 +0200 Subject: Fix warnings from compiler option '-Wswitch-enum' Signed-off-by: Thomas Zimmermann --- bus/config-parser-trivial.c | 43 +++++++++++++++++++++++++++++++++++++++++++ bus/config-parser.c | 22 ++++++++++++++++++++++ configure.ac | 1 - dbus/dbus-auth-script.c | 2 ++ dbus/dbus-marshal-validate.c | 2 ++ dbus/dbus-transport-socket.c | 3 +++ dbus/dbus-transport.c | 6 ++++++ test/test-utils-glib.c | 2 ++ tools/dbus-monitor.c | 4 ++++ 9 files changed, 84 insertions(+), 1 deletion(-) diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c index 129431d..2811eb4 100644 --- a/bus/config-parser-trivial.c +++ b/bus/config-parser-trivial.c @@ -185,6 +185,27 @@ bus_config_parser_start_element (BusConfigParser *parser, break; } + case ELEMENT_NONE: + case ELEMENT_BUSCONFIG: + case ELEMENT_INCLUDE: + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: + case ELEMENT_SERVICEDIR: + case ELEMENT_INCLUDEDIR: + case ELEMENT_SELINUX: + case ELEMENT_ASSOCIATE: + case ELEMENT_STANDARD_SESSION_SERVICEDIRS: + case ELEMENT_KEEP_UMASK: + case ELEMENT_SYSLOG: + case ELEMENT_ALLOW_ANONYMOUS: + case ELEMENT_APPARMOR: + /* fall through */ default: { /* we really don't care about the others... */ @@ -286,6 +307,28 @@ bus_config_parser_content (BusConfigParser *parser, } } break; + + case ELEMENT_NONE: + case ELEMENT_BUSCONFIG: + case ELEMENT_INCLUDE: + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: + case ELEMENT_INCLUDEDIR: + case ELEMENT_SELINUX: + case ELEMENT_ASSOCIATE: + case ELEMENT_STANDARD_SESSION_SERVICEDIRS: + case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS: + case ELEMENT_KEEP_UMASK: + case ELEMENT_SYSLOG: + case ELEMENT_ALLOW_ANONYMOUS: + case ELEMENT_APPARMOR: + /* fall through */ default: { /* we don't care about the others... really */ diff --git a/bus/config-parser.c b/bus/config-parser.c index 780e211..1dca539 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3101,6 +3101,28 @@ elements_equal (const Element *a, return FALSE; break; + case ELEMENT_NONE: + case ELEMENT_BUSCONFIG: + case ELEMENT_USER: + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_ALLOW: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: + case ELEMENT_SERVICEDIR: + case ELEMENT_SERVICEHELPER: + case ELEMENT_INCLUDEDIR: + case ELEMENT_CONFIGTYPE: + case ELEMENT_SELINUX: + case ELEMENT_ASSOCIATE: + case ELEMENT_STANDARD_SESSION_SERVICEDIRS: + case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS: + case ELEMENT_KEEP_UMASK: + case ELEMENT_SYSLOG: + case ELEMENT_ALLOW_ANONYMOUS: + case ELEMENT_APPARMOR: + /* fall through */ default: /* do nothing */ break; diff --git a/configure.ac b/configure.ac index 772fdea..b3126e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1365,7 +1365,6 @@ dnl code and remove these flags. DISABLE_WARNINGS="$DISABLE_WARNINGS -Wno-suggest-attribute=format -Wno-suggest-attribute=noreturn - -Wno-switch-enum -Wno-type-limits -Wno-undef" diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c index 5ec010f..23b665a 100644 --- a/dbus/dbus-auth-script.c +++ b/dbus/dbus-auth-script.c @@ -164,6 +164,8 @@ auth_state_to_string (DBusAuthState state) return "NEED_DISCONNECT"; case DBUS_AUTH_STATE_AUTHENTICATED: return "AUTHENTICATED"; + case DBUS_AUTH_STATE_INVALID: + return "INVALID"; default: break; } diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c index e122499..578b09f 100644 --- a/dbus/dbus-marshal-validate.c +++ b/dbus/dbus-marshal-validate.c @@ -898,7 +898,9 @@ _dbus_validity_to_error_message (DBusValidity validity) case DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS: return "Dict entry has too many fields"; case DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY: return "Dict entry not inside array"; case DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE: return "Dict key must be basic type"; + case DBUS_INVALID_MISSING_UNIX_FDS: return "Unix file descriptor missing"; case DBUS_INVALID_NESTED_TOO_DEEPLY: return "Variants cannot be used to create a hugely recursive tree of values"; + case DBUS_VALIDITY_LAST: default: return "Invalid"; } diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c index 88fde42..eedaac5 100644 --- a/dbus/dbus-transport-socket.c +++ b/dbus/dbus-transport-socket.c @@ -476,6 +476,9 @@ do_authentication (DBusTransport *transport, _dbus_verbose (" %s auth state: authenticated\n", TRANSPORT_SIDE (transport)); break; + + case DBUS_AUTH_STATE_INVALID: + /* fall through */ default: _dbus_assert_not_reached ("invalid auth state"); } diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index e3656d1..cc977cc 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -748,6 +748,12 @@ _dbus_transport_try_to_authenticate (DBusTransport *transport) case DBUS_AUTH_STATE_AUTHENTICATED: /* leave as maybe_authenticated */ break; + case DBUS_AUTH_STATE_WAITING_FOR_INPUT: + case DBUS_AUTH_STATE_WAITING_FOR_MEMORY: + case DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND: + case DBUS_AUTH_STATE_NEED_DISCONNECT: + case DBUS_AUTH_STATE_INVALID: + /* fall through */ default: maybe_authenticated = FALSE; } diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index e084977..c46cb73 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -149,6 +149,8 @@ spawn_dbus_daemon (const gchar *binary, break; + case TEST_USER_ME: + /* fall through */ default: g_assert_not_reached (); } diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index 2839a7f..7a98d3f 100644 --- a/tools/dbus-monitor.c +++ b/tools/dbus-monitor.c @@ -241,6 +241,8 @@ binary_filter_func (DBusConnection *connection, break; case BINARY_MODE_RAW: + case BINARY_MODE_NOT: + /* fall through */ default: /* nothing special, just the raw message stream */ break; @@ -472,6 +474,8 @@ main (int argc, char *argv[]) case DBUS_BUS_SESSION: where = "session bus"; break; + case DBUS_BUS_STARTER: + /* fall through */ default: where = ""; } -- 2.7.4