Use enum for long options constants

This avoids to manually assign values.
This commit is contained in:
Romain Vimont 2023-02-21 19:47:27 +01:00
parent 5973d4cdd7
commit 5d6bcc5966

View file

@ -17,47 +17,49 @@
#define STR_IMPL_(x) #x #define STR_IMPL_(x) #x
#define STR(x) STR_IMPL_(x) #define STR(x) STR_IMPL_(x)
#define OPT_RENDER_EXPIRED_FRAMES 1000 enum {
#define OPT_WINDOW_TITLE 1001 OPT_RENDER_EXPIRED_FRAMES = 1000,
#define OPT_PUSH_TARGET 1002 OPT_WINDOW_TITLE,
#define OPT_ALWAYS_ON_TOP 1003 OPT_PUSH_TARGET,
#define OPT_CROP 1004 OPT_ALWAYS_ON_TOP,
#define OPT_RECORD_FORMAT 1005 OPT_CROP,
#define OPT_PREFER_TEXT 1006 OPT_RECORD_FORMAT,
#define OPT_WINDOW_X 1007 OPT_PREFER_TEXT,
#define OPT_WINDOW_Y 1008 OPT_WINDOW_X,
#define OPT_WINDOW_WIDTH 1009 OPT_WINDOW_Y,
#define OPT_WINDOW_HEIGHT 1010 OPT_WINDOW_WIDTH,
#define OPT_WINDOW_BORDERLESS 1011 OPT_WINDOW_HEIGHT,
#define OPT_MAX_FPS 1012 OPT_WINDOW_BORDERLESS,
#define OPT_LOCK_VIDEO_ORIENTATION 1013 OPT_MAX_FPS,
#define OPT_DISPLAY_ID 1014 OPT_LOCK_VIDEO_ORIENTATION,
#define OPT_ROTATION 1015 OPT_DISPLAY_ID,
#define OPT_RENDER_DRIVER 1016 OPT_ROTATION,
#define OPT_NO_MIPMAPS 1017 OPT_RENDER_DRIVER,
#define OPT_CODEC_OPTIONS 1018 OPT_NO_MIPMAPS,
#define OPT_FORCE_ADB_FORWARD 1019 OPT_CODEC_OPTIONS,
#define OPT_DISABLE_SCREENSAVER 1020 OPT_FORCE_ADB_FORWARD,
#define OPT_SHORTCUT_MOD 1021 OPT_DISABLE_SCREENSAVER,
#define OPT_NO_KEY_REPEAT 1022 OPT_SHORTCUT_MOD,
#define OPT_FORWARD_ALL_CLICKS 1023 OPT_NO_KEY_REPEAT,
#define OPT_LEGACY_PASTE 1024 OPT_FORWARD_ALL_CLICKS,
#define OPT_ENCODER_NAME 1025 OPT_LEGACY_PASTE,
#define OPT_POWER_OFF_ON_CLOSE 1026 OPT_ENCODER_NAME,
#define OPT_V4L2_SINK 1027 OPT_POWER_OFF_ON_CLOSE,
#define OPT_DISPLAY_BUFFER 1028 OPT_V4L2_SINK,
#define OPT_V4L2_BUFFER 1029 OPT_DISPLAY_BUFFER,
#define OPT_TUNNEL_HOST 1030 OPT_V4L2_BUFFER,
#define OPT_TUNNEL_PORT 1031 OPT_TUNNEL_HOST,
#define OPT_NO_CLIPBOARD_AUTOSYNC 1032 OPT_TUNNEL_PORT,
#define OPT_TCPIP 1033 OPT_NO_CLIPBOARD_AUTOSYNC,
#define OPT_RAW_KEY_EVENTS 1034 OPT_TCPIP,
#define OPT_NO_DOWNSIZE_ON_ERROR 1035 OPT_RAW_KEY_EVENTS,
#define OPT_OTG 1036 OPT_NO_DOWNSIZE_ON_ERROR,
#define OPT_NO_CLEANUP 1037 OPT_OTG,
#define OPT_PRINT_FPS 1038 OPT_NO_CLEANUP,
#define OPT_NO_POWER_ON 1039 OPT_PRINT_FPS,
#define OPT_CODEC 1040 OPT_NO_POWER_ON,
OPT_CODEC,
};
struct sc_option { struct sc_option {
char shortopt; char shortopt;