diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-01-14 11:48:07 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-01-19 19:47:27 +0100 |
commit | b716b047e0926cd510e4ba4455b29f388caff749 (patch) | |
tree | ebf2ef27cdca16c78229afe716bd3da7b323e084 /src | |
parent | c03913c991787eb81de8832fccfe328ff9a86e9c (diff) | |
download | rneovim-b716b047e0926cd510e4ba4455b29f388caff749.tar.gz rneovim-b716b047e0926cd510e4ba4455b29f388caff749.tar.bz2 rneovim-b716b047e0926cd510e4ba4455b29f388caff749.zip |
Remove long_u: ex_docmd.c: Refactor long_u.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 28 |
3 files changed, 18 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 1833461fa9..8db473d4be 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10332,7 +10332,7 @@ static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog) if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN) { char_u *xp_name; int xp_namelen; - long argt; + uint32_t argt; /* input() with a third argument: completion */ rettv->vval.v_string = NULL; diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h index 3f3ef8b275..1b920511b6 100644 --- a/src/nvim/ex_cmds_defs.h +++ b/src/nvim/ex_cmds_defs.h @@ -96,7 +96,7 @@ struct exarg { char_u *cmd; ///< the name of the command (except for :make) char_u **cmdlinep; ///< pointer to pointer of allocated cmdline cmdidx_T cmdidx; ///< the index for the command - long argt; ///< flags for the command + uint32_t argt; ///< flags for the command int skip; ///< don't execute the command, only parse it int forceit; ///< TRUE if ! present int addr_count; ///< the number of addresses given diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index b4dfe99aed..065c27013e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -12,6 +12,7 @@ #include <string.h> #include <stdbool.h> +#include <stdint.h> #include <errno.h> #include <inttypes.h> @@ -77,7 +78,7 @@ static int ex_pressedreturn = FALSE; typedef struct ucmd { char_u *uc_name; /* The command name */ - long_u uc_argt; /* The argument type */ + uint32_t uc_argt; /* The argument type */ char_u *uc_rep; /* The command's replacement string */ long uc_def; /* The default value for a range/count */ int uc_compl; /* completion type */ @@ -1422,7 +1423,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, goto doend; if (*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2)) { ea.cmdidx = CMD_print; - ea.argt = RANGE+COUNT+TRLBAR; + ea.argt = RANGE | COUNT | TRLBAR; if ((errormsg = invalid_range(&ea)) == NULL) { correct_range(&ea); ex_print(&ea); @@ -1509,7 +1510,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, * 5. parse arguments */ if (!IS_USER_CMDIDX(ea.cmdidx)) { - ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt; + ea.argt = cmdnames[(int)ea.cmdidx].cmd_argt; } if (!ea.skip) { @@ -2204,7 +2205,7 @@ find_ucmd ( eap->cmdidx = CMD_USER; else eap->cmdidx = CMD_USER_BUF; - eap->argt = (long)uc->uc_argt; + eap->argt = uc->uc_argt; eap->useridx = j; if (compl != NULL) @@ -2470,7 +2471,7 @@ set_one_cmd_context ( * 5. parse arguments */ if (!IS_USER_CMDIDX(ea.cmdidx)) { - ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt; + ea.argt = cmdnames[(int)ea.cmdidx].cmd_argt; } arg = skipwhite(p); @@ -4122,7 +4123,9 @@ char_u *get_command_name(expand_T *xp, int idx) } -static int uc_add_command(char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int force) +static int uc_add_command(char_u *name, size_t name_len, char_u *rep, + uint32_t argt, long def, int flags, int compl, + char_u *compl_arg, int force) { ucmd_T *cmd = NULL; char_u *p; @@ -4257,7 +4260,7 @@ static void uc_list(char_u *name, size_t name_len) int found = FALSE; ucmd_T *cmd; int len; - long a; + uint32_t a; garray_T *gap; gap = &curbuf->b_ucmds; @@ -4265,7 +4268,7 @@ static void uc_list(char_u *name, size_t name_len) int i; for (i = 0; i < gap->ga_len; ++i) { cmd = USER_CMD_GA(gap, i); - a = (long)cmd->uc_argt; + a = cmd->uc_argt; /* Skip commands which don't match the requested prefix */ if (STRNCMP(name, cmd->uc_name, name_len) != 0) @@ -4296,7 +4299,7 @@ static void uc_list(char_u *name, size_t name_len) len = 0; /* Arguments */ - switch ((int)(a & (EXTRA|NOSPC|NEEDARG))) { + switch (a & (EXTRA|NOSPC|NEEDARG)) { case 0: IObuff[len++] = '0'; break; case (EXTRA): IObuff[len++] = '*'; break; case (EXTRA|NOSPC): IObuff[len++] = '?'; break; @@ -4374,7 +4377,7 @@ static char_u *uc_fun_cmd(void) return IObuff; } -static int uc_scan_attr(char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg) +static int uc_scan_attr(char_u *attr, size_t len, uint32_t *argt, long *def, int *flags, int *compl, char_u **compl_arg) { char_u *p; @@ -4493,7 +4496,7 @@ static void ex_command(exarg_T *eap) char_u *name; char_u *end; char_u *p; - long argt = 0; + uint32_t argt = 0; long def = -1; int flags = 0; int compl = EXPAND_NOTHING; @@ -5026,7 +5029,8 @@ char_u *get_user_cmd_complete(expand_T *xp, int idx) * copied to allocated memory and stored in "*compl_arg". * Returns FAIL if something is wrong. */ -int parse_compl_arg(char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg) +int parse_compl_arg(char_u *value, int vallen, int *complp, + uint32_t *argt, char_u **compl_arg) { char_u *arg = NULL; size_t arglen = 0; |