Prefer enums over incremental defines

This commit is contained in:
Petter Wahlman 2014-03-15 12:59:11 +01:00 committed by Thiago de Arruda
parent ed3e9d51ac
commit dbc904956a

212
src/vim.h
View File

@ -299,52 +299,54 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
/* /*
* values for xp_context when doing command line completion * values for xp_context when doing command line completion
*/ */
#define EXPAND_UNSUCCESSFUL (-2) enum {
#define EXPAND_OK (-1) EXPAND_UNSUCCESSFUL = -2,
#define EXPAND_NOTHING 0 EXPAND_OK = -1,
#define EXPAND_COMMANDS 1 EXPAND_NOTHING = 0,
#define EXPAND_FILES 2 EXPAND_COMMANDS,
#define EXPAND_DIRECTORIES 3 EXPAND_FILES,
#define EXPAND_SETTINGS 4 EXPAND_DIRECTORIES,
#define EXPAND_BOOL_SETTINGS 5 EXPAND_SETTINGS,
#define EXPAND_TAGS 6 EXPAND_BOOL_SETTINGS,
#define EXPAND_OLD_SETTING 7 EXPAND_TAGS,
#define EXPAND_HELP 8 EXPAND_OLD_SETTING,
#define EXPAND_BUFFERS 9 EXPAND_HELP,
#define EXPAND_EVENTS 10 EXPAND_BUFFERS,
#define EXPAND_MENUS 11 EXPAND_EVENTS,
#define EXPAND_SYNTAX 12 EXPAND_MENUS,
#define EXPAND_HIGHLIGHT 13 EXPAND_SYNTAX,
#define EXPAND_AUGROUP 14 EXPAND_HIGHLIGHT,
#define EXPAND_USER_VARS 15 EXPAND_AUGROUP,
#define EXPAND_MAPPINGS 16 EXPAND_USER_VARS,
#define EXPAND_TAGS_LISTFILES 17 EXPAND_MAPPINGS,
#define EXPAND_FUNCTIONS 18 EXPAND_TAGS_LISTFILES,
#define EXPAND_USER_FUNC 19 EXPAND_FUNCTIONS,
#define EXPAND_EXPRESSION 20 EXPAND_USER_FUNC,
#define EXPAND_MENUNAMES 21 EXPAND_EXPRESSION,
#define EXPAND_USER_COMMANDS 22 EXPAND_MENUNAMES,
#define EXPAND_USER_CMD_FLAGS 23 EXPAND_USER_COMMANDS,
#define EXPAND_USER_NARGS 24 EXPAND_USER_CMD_FLAGS,
#define EXPAND_USER_COMPLETE 25 EXPAND_USER_NARGS,
#define EXPAND_ENV_VARS 26 EXPAND_USER_COMPLETE,
#define EXPAND_LANGUAGE 27 EXPAND_ENV_VARS,
#define EXPAND_COLORS 28 EXPAND_LANGUAGE,
#define EXPAND_COMPILER 29 EXPAND_COLORS,
#define EXPAND_USER_DEFINED 30 EXPAND_COMPILER,
#define EXPAND_USER_LIST 31 EXPAND_USER_DEFINED,
#define EXPAND_SHELLCMD 32 EXPAND_USER_LIST,
#define EXPAND_CSCOPE 33 EXPAND_SHELLCMD,
#define EXPAND_SIGN 34 EXPAND_CSCOPE,
#define EXPAND_PROFILE 35 EXPAND_SIGN,
#define EXPAND_BEHAVE 36 EXPAND_PROFILE,
#define EXPAND_FILETYPE 37 EXPAND_BEHAVE,
#define EXPAND_FILES_IN_PATH 38 EXPAND_FILETYPE,
#define EXPAND_OWNSYNTAX 39 EXPAND_FILES_IN_PATH,
#define EXPAND_LOCALES 40 EXPAND_OWNSYNTAX,
#define EXPAND_HISTORY 41 EXPAND_LOCALES,
#define EXPAND_USER 42 EXPAND_HISTORY,
#define EXPAND_SYNTIME 43 EXPAND_USER,
EXPAND_SYNTIME,
};
/* Values for exmode_active (0 is no exmode) */ /* Values for exmode_active (0 is no exmode) */
#define EXMODE_NORMAL 1 #define EXMODE_NORMAL 1
@ -1304,64 +1306,66 @@ typedef struct timeval proftime_T;
#define VALID_HEAD 2 #define VALID_HEAD 2
/* Defines for Vim variables. These must match vimvars[] in eval.c! */ /* Defines for Vim variables. These must match vimvars[] in eval.c! */
#define VV_COUNT 0 enum {
#define VV_COUNT1 1 VV_COUNT,
#define VV_PREVCOUNT 2 VV_COUNT1,
#define VV_ERRMSG 3 VV_PREVCOUNT,
#define VV_WARNINGMSG 4 VV_ERRMSG,
#define VV_STATUSMSG 5 VV_WARNINGMSG,
#define VV_SHELL_ERROR 6 VV_STATUSMSG,
#define VV_THIS_SESSION 7 VV_SHELL_ERROR,
#define VV_VERSION 8 VV_THIS_SESSION,
#define VV_LNUM 9 VV_VERSION,
#define VV_TERMRESPONSE 10 VV_LNUM,
#define VV_FNAME 11 VV_TERMRESPONSE,
#define VV_LANG 12 VV_FNAME,
#define VV_LC_TIME 13 VV_LANG,
#define VV_CTYPE 14 VV_LC_TIME,
#define VV_CC_FROM 15 VV_CTYPE,
#define VV_CC_TO 16 VV_CC_FROM,
#define VV_FNAME_IN 17 VV_CC_TO,
#define VV_FNAME_OUT 18 VV_FNAME_IN,
#define VV_FNAME_NEW 19 VV_FNAME_OUT,
#define VV_FNAME_DIFF 20 VV_FNAME_NEW,
#define VV_CMDARG 21 VV_FNAME_DIFF,
#define VV_FOLDSTART 22 VV_CMDARG,
#define VV_FOLDEND 23 VV_FOLDSTART,
#define VV_FOLDDASHES 24 VV_FOLDEND,
#define VV_FOLDLEVEL 25 VV_FOLDDASHES,
#define VV_PROGNAME 26 VV_FOLDLEVEL,
#define VV_SEND_SERVER 27 VV_PROGNAME,
#define VV_DYING 28 VV_SEND_SERVER,
#define VV_EXCEPTION 29 VV_DYING,
#define VV_THROWPOINT 30 VV_EXCEPTION,
#define VV_REG 31 VV_THROWPOINT,
#define VV_CMDBANG 32 VV_REG,
#define VV_INSERTMODE 33 VV_CMDBANG,
#define VV_VAL 34 VV_INSERTMODE,
#define VV_KEY 35 VV_VAL,
#define VV_PROFILING 36 VV_KEY,
#define VV_FCS_REASON 37 VV_PROFILING,
#define VV_FCS_CHOICE 38 VV_FCS_REASON,
#define VV_BEVAL_BUFNR 39 VV_FCS_CHOICE,
#define VV_BEVAL_WINNR 40 VV_BEVAL_BUFNR,
#define VV_BEVAL_LNUM 41 VV_BEVAL_WINNR,
#define VV_BEVAL_COL 42 VV_BEVAL_LNUM,
#define VV_BEVAL_TEXT 43 VV_BEVAL_COL,
#define VV_SCROLLSTART 44 VV_BEVAL_TEXT,
#define VV_SWAPNAME 45 VV_SCROLLSTART,
#define VV_SWAPCHOICE 46 VV_SWAPNAME,
#define VV_SWAPCOMMAND 47 VV_SWAPCHOICE,
#define VV_CHAR 48 VV_SWAPCOMMAND,
#define VV_MOUSE_WIN 49 VV_CHAR,
#define VV_MOUSE_LNUM 50 VV_MOUSE_WIN,
#define VV_MOUSE_COL 51 VV_MOUSE_LNUM,
#define VV_OP 52 VV_MOUSE_COL,
#define VV_SEARCHFORWARD 53 VV_OP,
#define VV_HLSEARCH 54 VV_SEARCHFORWARD,
#define VV_OLDFILES 55 VV_HLSEARCH,
#define VV_WINDOWID 56 VV_OLDFILES,
#define VV_LEN 57 /* number of v: vars */ VV_WINDOWID,
VV_LEN, /* number of v: vars */
};
typedef int VimClipboard; /* This is required for the prototypes. */ typedef int VimClipboard; /* This is required for the prototypes. */