From 25def3fecc5a56fccd1cfdc3c6d1ce7643b78400 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 17 Jan 2017 20:54:20 +0000 Subject: [PATCH 11/16] sysdeps: assert that log severity is one we expect This silences -Wswitch-default. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie --- dbus/dbus-sysdeps-unix.c | 2 +- dbus/dbus-sysdeps-win.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 39c13360..8b6ac306 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -4628,7 +4628,7 @@ _dbus_logv (DBusSystemLogSeverity severity, flags = LOG_DAEMON|LOG_CRIT; break; default: - return; + _dbus_assert_not_reached ("invalid log severity"); } DBUS_VA_COPY (tmp, args); diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index e5cab351..5a94eaf5 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -3720,6 +3720,7 @@ _dbus_logv (DBusSystemLogSeverity severity, case DBUS_SYSTEM_LOG_WARNING: s = "warning"; break; case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break; case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break; + default: _dbus_assert_not_reached ("invalid log severity"); } if (log_flags & DBUS_LOG_FLAGS_SYSTEM_LOG) -- 2.11.0