Explicitly enumerate the states where we reset the maybe_authenticated
flag, and assert that _dbus_auth_do_work() doesn't return an impossible
or invalid state (by source code inspection, it doesn't).
This silences -Wswitch-enum. 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
case DBUS_AUTH_STATE_AUTHENTICATED:
/* leave as maybe_authenticated */
break;
- default:
+
+ 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:
maybe_authenticated = FALSE;
+ break;
+
+ case DBUS_AUTH_STATE_INVALID:
+ default:
+ _dbus_assert_not_reached ("invalid authentication state");
}
}