ui: drop VNC feature _MASK constants
commit0e74eb86eaf3ef57e9f9741cb668784c96e654ff
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 7 Dec 2023 13:45:01 +0000 (7 13:45 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 9 Feb 2024 12:48:02 +0000 (9 12:48 +0000)
tree896e77a63f4d28e7cec532702280855cb4eb6257
parent03e471c41d8b1b6eb16c9714f387449f52fe5c1d
ui: drop VNC feature _MASK constants

Each VNC feature enum entry has a corresponding _MASK constant
which is the bit-shifted value. It is very easy for contributors
to accidentally use the _MASK constant, instead of the non-_MASK
constant, or the reverse. No compiler warning is possible and
it'll just silently do the wrong thing at runtime.

By introducing the vnc_set_feature helper method, we can drop
all the _MASK constants and thus prevent any future accidents.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
ui/vnc.c
ui/vnc.h