From b0c693faa9afab66e6fcbec95437f870aba99a00 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 8 Dec 2020 12:57:31 +0100 Subject: [PATCH] vnc: use enum for features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use an enum for the vnc feature bits. That way they are enumerated automatically and we don't have to do that manually when adding or removing features. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201208115737.18581-4-kraxel@redhat.com --- ui/vnc.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index 4e2637ce6c..262fcf179b 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -438,18 +438,20 @@ enum { * *****************************************************************************/ -#define VNC_FEATURE_RESIZE 0 -#define VNC_FEATURE_HEXTILE 1 -#define VNC_FEATURE_POINTER_TYPE_CHANGE 2 -#define VNC_FEATURE_WMVI 3 -#define VNC_FEATURE_TIGHT 4 -#define VNC_FEATURE_ZLIB 5 -#define VNC_FEATURE_COPYRECT 6 -#define VNC_FEATURE_RICH_CURSOR 7 -#define VNC_FEATURE_TIGHT_PNG 8 -#define VNC_FEATURE_ZRLE 9 -#define VNC_FEATURE_ZYWRLE 10 -#define VNC_FEATURE_LED_STATE 11 +enum VncFeatures { + VNC_FEATURE_RESIZE, + VNC_FEATURE_HEXTILE, + VNC_FEATURE_POINTER_TYPE_CHANGE, + VNC_FEATURE_WMVI, + VNC_FEATURE_TIGHT, + VNC_FEATURE_ZLIB, + VNC_FEATURE_COPYRECT, + VNC_FEATURE_RICH_CURSOR, + VNC_FEATURE_TIGHT_PNG, + VNC_FEATURE_ZRLE, + VNC_FEATURE_ZYWRLE, + VNC_FEATURE_LED_STATE, +}; #define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE) #define VNC_FEATURE_HEXTILE_MASK (1 << VNC_FEATURE_HEXTILE)