mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #18387 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
This commit is contained in:
commit
4f17e7e1c3
@ -1819,7 +1819,7 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()*
|
||||
• lockmarks: (boolean) |:lockmarks|.
|
||||
• noswapfile: (boolean) |:noswapfile|.
|
||||
• tab: (integer) |:tab|.
|
||||
• verbose: (integer) |:verbose|.
|
||||
• verbose: (integer) |:verbose|. -1 when omitted.
|
||||
• vertical: (boolean) |:vertical|.
|
||||
• split: (string) Split modifier string, is an empty
|
||||
string when there's no split modifier. If there is a
|
||||
|
@ -474,7 +474,7 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc
|
||||
Object *command = &opts->command;
|
||||
if (command->type == kObjectTypeString) {
|
||||
aucmd.type = CALLABLE_EX;
|
||||
aucmd.callable.cmd = (char_u *)string_to_cstr(command->data.string);
|
||||
aucmd.callable.cmd = string_to_cstr(command->data.string);
|
||||
} else {
|
||||
api_set_error(err,
|
||||
kErrorTypeValidation,
|
||||
@ -657,8 +657,6 @@ void nvim_clear_autocmds(Dict(clear_autocmds) *opts, Error *err)
|
||||
cleanup:
|
||||
api_free_array(event_array);
|
||||
api_free_array(patterns);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/// Create or get an autocommand group |autocmd-groups|.
|
||||
|
@ -2210,7 +2210,7 @@ Array nvim_get_mark(String name, Dictionary opts, Error *err)
|
||||
allocated = true;
|
||||
// Marks comes from shada
|
||||
} else {
|
||||
filename = (char *)mark.fname;
|
||||
filename = mark.fname;
|
||||
bufnr = 0;
|
||||
}
|
||||
|
||||
|
@ -827,7 +827,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err)
|
||||
bool done = false;
|
||||
|
||||
while (!done) {
|
||||
done = uc_split_args_iter(ea.arg, length, &end, buf, &len);
|
||||
done = uc_split_args_iter((char_u *)ea.arg, length, &end, buf, &len);
|
||||
if (len > 0) {
|
||||
ADD(args, STRING_OBJ(cstrn_to_string(buf, len)));
|
||||
}
|
||||
|
@ -972,7 +972,7 @@ int do_autocmd_event(event_T event, char_u *pat, bool once, int nested, char_u *
|
||||
if (is_adding_cmd) {
|
||||
AucmdExecutable exec = AUCMD_EXECUTABLE_INIT;
|
||||
exec.type = CALLABLE_EX;
|
||||
exec.callable.cmd = cmd;
|
||||
exec.callable.cmd = (char *)cmd;
|
||||
autocmd_register(0, event, pat, patlen, group, once, nested, NULL, exec);
|
||||
}
|
||||
|
||||
@ -1240,7 +1240,7 @@ void ex_doautoall(exarg_T *eap)
|
||||
{
|
||||
int retval = OK;
|
||||
aco_save_T aco;
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
int call_do_modelines = check_nomodeline(&arg);
|
||||
bufref_T bufref;
|
||||
bool did_aucmd;
|
||||
@ -2142,7 +2142,7 @@ char_u *getnextac(int c, void *cookie, int indent, bool do_concat)
|
||||
// However, my expectation would be that could be expensive.
|
||||
retval = vim_strsave((char_u *)"");
|
||||
} else {
|
||||
retval = vim_strsave(ac->exec.callable.cmd);
|
||||
retval = vim_strsave((char_u *)ac->exec.callable.cmd);
|
||||
}
|
||||
|
||||
// Remove one-shot ("once") autocmd in anticipation of its execution.
|
||||
@ -2241,7 +2241,7 @@ char_u *set_context_in_autocmd(expand_T *xp, char_u *arg, int doautocmd)
|
||||
autocmd_include_groups = true;
|
||||
}
|
||||
xp->xp_context = EXPAND_EVENTS; // expand event name
|
||||
xp->xp_pattern = arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2501,7 +2501,7 @@ char *aucmd_exec_to_string(AutoCmd *ac, AucmdExecutable acc)
|
||||
{
|
||||
switch (acc.type) {
|
||||
case CALLABLE_EX:
|
||||
return (char *)acc.callable.cmd;
|
||||
return acc.callable.cmd;
|
||||
case CALLABLE_CB:
|
||||
return ac->desc;
|
||||
case CALLABLE_NONE:
|
||||
@ -2534,7 +2534,7 @@ AucmdExecutable aucmd_exec_copy(AucmdExecutable src)
|
||||
switch (src.type) {
|
||||
case CALLABLE_EX:
|
||||
dest.type = CALLABLE_EX;
|
||||
dest.callable.cmd = vim_strsave(src.callable.cmd);
|
||||
dest.callable.cmd = xstrdup(src.callable.cmd);
|
||||
return dest;
|
||||
case CALLABLE_CB:
|
||||
dest.type = CALLABLE_CB;
|
||||
|
@ -2622,7 +2622,7 @@ void buflist_list(exarg_T *eap)
|
||||
garray_T buflist;
|
||||
buf_T **buflist_data = NULL;
|
||||
|
||||
if (vim_strchr(eap->arg, 't')) {
|
||||
if (vim_strchr((char_u *)eap->arg, 't')) {
|
||||
ga_init(&buflist, sizeof(buf_T *), 50);
|
||||
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
|
||||
ga_grow(&buflist, 1);
|
||||
@ -2645,21 +2645,21 @@ void buflist_list(exarg_T *eap)
|
||||
const bool job_running = buf->terminal && terminal_running(buf->terminal);
|
||||
|
||||
// skip unspecified buffers
|
||||
if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u'))
|
||||
|| (vim_strchr(eap->arg, 'u') && buf->b_p_bl)
|
||||
|| (vim_strchr(eap->arg, '+')
|
||||
if ((!buf->b_p_bl && !eap->forceit && !vim_strchr((char_u *)eap->arg, 'u'))
|
||||
|| (vim_strchr((char_u *)eap->arg, 'u') && buf->b_p_bl)
|
||||
|| (vim_strchr((char_u *)eap->arg, '+')
|
||||
&& ((buf->b_flags & BF_READERR) || !bufIsChanged(buf)))
|
||||
|| (vim_strchr(eap->arg, 'a')
|
||||
|| (vim_strchr((char_u *)eap->arg, 'a')
|
||||
&& (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0))
|
||||
|| (vim_strchr(eap->arg, 'h')
|
||||
|| (vim_strchr((char_u *)eap->arg, 'h')
|
||||
&& (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0))
|
||||
|| (vim_strchr(eap->arg, 'R') && (!is_terminal || !job_running))
|
||||
|| (vim_strchr(eap->arg, 'F') && (!is_terminal || job_running))
|
||||
|| (vim_strchr(eap->arg, '-') && buf->b_p_ma)
|
||||
|| (vim_strchr(eap->arg, '=') && !buf->b_p_ro)
|
||||
|| (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR))
|
||||
|| (vim_strchr(eap->arg, '%') && buf != curbuf)
|
||||
|| (vim_strchr(eap->arg, '#')
|
||||
|| (vim_strchr((char_u *)eap->arg, 'R') && (!is_terminal || !job_running))
|
||||
|| (vim_strchr((char_u *)eap->arg, 'F') && (!is_terminal || job_running))
|
||||
|| (vim_strchr((char_u *)eap->arg, '-') && buf->b_p_ma)
|
||||
|| (vim_strchr((char_u *)eap->arg, '=') && !buf->b_p_ro)
|
||||
|| (vim_strchr((char_u *)eap->arg, 'x') && !(buf->b_flags & BF_READERR))
|
||||
|| (vim_strchr((char_u *)eap->arg, '%') && buf != curbuf)
|
||||
|| (vim_strchr((char_u *)eap->arg, '#')
|
||||
&& (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) {
|
||||
continue;
|
||||
}
|
||||
@ -2700,7 +2700,7 @@ void buflist_list(exarg_T *eap)
|
||||
do {
|
||||
IObuff[len++] = ' ';
|
||||
} while (--i > 0 && len < IOSIZE - 18);
|
||||
if (vim_strchr(eap->arg, 't') && buf->b_last_used) {
|
||||
if (vim_strchr((char_u *)eap->arg, 't') && buf->b_last_used) {
|
||||
undo_fmt_time(IObuff + len, (size_t)(IOSIZE - len), buf->b_last_used);
|
||||
} else {
|
||||
vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len), _("line %" PRId64),
|
||||
|
@ -94,11 +94,11 @@ Array mode_style_array(void)
|
||||
/// @returns error message for an illegal option, NULL otherwise.
|
||||
char *parse_shape_opt(int what)
|
||||
{
|
||||
char_u *colonp;
|
||||
char_u *commap;
|
||||
char_u *slashp;
|
||||
char_u *p = NULL;
|
||||
char_u *endp;
|
||||
char *colonp;
|
||||
char *commap;
|
||||
char *slashp;
|
||||
char *p = NULL;
|
||||
char *endp;
|
||||
int idx = 0; // init for GCC
|
||||
int all_idx;
|
||||
int len;
|
||||
@ -118,10 +118,10 @@ char *parse_shape_opt(int what)
|
||||
}
|
||||
}
|
||||
// Repeat for all comma separated parts.
|
||||
char_u *modep = p_guicursor;
|
||||
char *modep = (char *)p_guicursor;
|
||||
while (modep != NULL && *modep != NUL) {
|
||||
colonp = vim_strchr(modep, ':');
|
||||
commap = vim_strchr(modep, ',');
|
||||
colonp = (char *)vim_strchr((char_u *)modep, ':');
|
||||
commap = (char *)vim_strchr((char_u *)modep, ',');
|
||||
|
||||
if (colonp == NULL || (commap != NULL && commap < colonp)) {
|
||||
return N_("E545: Missing colon");
|
||||
@ -169,7 +169,7 @@ char *parse_shape_opt(int what)
|
||||
for (p = colonp + 1; *p && *p != ',';) {
|
||||
{
|
||||
// First handle the ones with a number argument.
|
||||
i = *p;
|
||||
i = (uint8_t)(*p);
|
||||
len = 0;
|
||||
if (STRNICMP(p, "ver", 3) == 0) {
|
||||
len = 3;
|
||||
@ -187,7 +187,7 @@ char *parse_shape_opt(int what)
|
||||
if (!ascii_isdigit(*p)) {
|
||||
return N_("E548: digit expected");
|
||||
}
|
||||
int n = getdigits_int(&p, false, 0);
|
||||
int n = getdigits_int((char_u **)&p, false, 0);
|
||||
if (len == 3) { // "ver" or "hor"
|
||||
if (n == 0) {
|
||||
return N_("E549: Illegal percentage");
|
||||
@ -215,7 +215,7 @@ char *parse_shape_opt(int what)
|
||||
}
|
||||
p += 5;
|
||||
} else { // must be a highlight group name then
|
||||
endp = vim_strchr(p, '-');
|
||||
endp = (char *)vim_strchr((char_u *)p, '-');
|
||||
if (commap == NULL) { // last part
|
||||
if (endp == NULL) {
|
||||
endp = p + STRLEN(p); // find end of part
|
||||
@ -223,14 +223,14 @@ char *parse_shape_opt(int what)
|
||||
} else if (endp > commap || endp == NULL) {
|
||||
endp = commap;
|
||||
}
|
||||
slashp = vim_strchr(p, '/');
|
||||
slashp = (char *)vim_strchr((char_u *)p, '/');
|
||||
if (slashp != NULL && slashp < endp) {
|
||||
// "group/langmap_group"
|
||||
i = syn_check_group((char *)p, (size_t)(slashp - p));
|
||||
i = syn_check_group(p, (size_t)(slashp - p));
|
||||
p = slashp + 1;
|
||||
}
|
||||
if (round == 2) {
|
||||
shape_table[idx].id = syn_check_group((char *)p, (size_t)(endp - p));
|
||||
shape_table[idx].id = syn_check_group(p, (size_t)(endp - p));
|
||||
shape_table[idx].id_lm = shape_table[idx].id;
|
||||
if (slashp != NULL && slashp < endp) {
|
||||
shape_table[idx].id = i;
|
||||
|
@ -366,7 +366,7 @@ void ex_debug(exarg_T *eap)
|
||||
int debug_break_level_save = debug_break_level;
|
||||
|
||||
debug_break_level = 9999;
|
||||
do_cmdline_cmd((char *)eap->arg);
|
||||
do_cmdline_cmd(eap->arg);
|
||||
debug_break_level = debug_break_level_save;
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ void ex_breakadd(exarg_T *eap)
|
||||
gap = &prof_ga;
|
||||
}
|
||||
|
||||
if (dbg_parsearg(eap->arg, gap) == OK) {
|
||||
if (dbg_parsearg((char_u *)eap->arg, gap) == OK) {
|
||||
struct debuggy *bp = &DEBUGGY(gap, gap->ga_len);
|
||||
bp->dbg_forceit = eap->forceit;
|
||||
|
||||
@ -618,7 +618,7 @@ void ex_breakdel(exarg_T *eap)
|
||||
|
||||
if (ascii_isdigit(*eap->arg)) {
|
||||
// ":breakdel {nr}"
|
||||
int nr = atoi((char *)eap->arg);
|
||||
int nr = atoi(eap->arg);
|
||||
for (int i = 0; i < gap->ga_len; i++) {
|
||||
if (DEBUGGY(gap, i).dbg_nr == nr) {
|
||||
todel = i;
|
||||
@ -630,7 +630,7 @@ void ex_breakdel(exarg_T *eap)
|
||||
del_all = true;
|
||||
} else {
|
||||
// ":breakdel {func|file|expr} [lnum] {name}"
|
||||
if (dbg_parsearg(eap->arg, gap) == FAIL) {
|
||||
if (dbg_parsearg((char_u *)eap->arg, gap) == FAIL) {
|
||||
return;
|
||||
}
|
||||
bp = &DEBUGGY(gap, gap->ga_len);
|
||||
|
@ -1186,9 +1186,9 @@ void ex_diffpatch(exarg_T *eap)
|
||||
|
||||
#ifdef UNIX
|
||||
// Get the absolute path of the patchfile, changing directory below.
|
||||
fullname = FullName_save((char *)eap->arg, false);
|
||||
fullname = FullName_save(eap->arg, false);
|
||||
esc_name =
|
||||
vim_strsave_shellescape((fullname != NULL ? (char_u *)fullname : eap->arg), true, true);
|
||||
vim_strsave_shellescape((char_u *)(fullname != NULL ? fullname : eap->arg), true, true);
|
||||
#else
|
||||
esc_name = vim_strsave_shellescape(eap->arg, true, true);
|
||||
#endif
|
||||
@ -1219,7 +1219,7 @@ void ex_diffpatch(exarg_T *eap)
|
||||
// Use 'patchexpr' to generate the new file.
|
||||
#ifdef UNIX
|
||||
eval_patch((char *)tmp_orig,
|
||||
(fullname != NULL ? fullname : (char *)eap->arg),
|
||||
(fullname != NULL ? fullname : eap->arg),
|
||||
(char *)tmp_new);
|
||||
#else
|
||||
eval_patch((char *)tmp_orig, (char *)eap->arg, (char *)tmp_new);
|
||||
@ -1268,7 +1268,7 @@ void ex_diffpatch(exarg_T *eap)
|
||||
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL) {
|
||||
// Pretend it was a ":split fname" command
|
||||
eap->cmdidx = CMD_split;
|
||||
eap->arg = tmp_new;
|
||||
eap->arg = (char *)tmp_new;
|
||||
do_exedit(eap, old_curwin);
|
||||
|
||||
// check that split worked and editing tmp_new
|
||||
@ -1279,7 +1279,7 @@ void ex_diffpatch(exarg_T *eap)
|
||||
|
||||
if (newname != NULL) {
|
||||
// do a ":file filename.new" on the patched buffer
|
||||
eap->arg = newname;
|
||||
eap->arg = (char *)newname;
|
||||
ex_file(eap);
|
||||
|
||||
// Do filetype detection with the new name.
|
||||
@ -2469,10 +2469,10 @@ void nv_diffgetput(bool put, size_t count)
|
||||
return;
|
||||
}
|
||||
if (count == 0) {
|
||||
ea.arg = (char_u *)"";
|
||||
ea.arg = "";
|
||||
} else {
|
||||
vim_snprintf(buf, sizeof(buf), "%zu", count);
|
||||
ea.arg = (char_u *)buf;
|
||||
ea.arg = buf;
|
||||
}
|
||||
|
||||
if (put) {
|
||||
@ -2553,18 +2553,18 @@ void ex_diffgetput(exarg_T *eap)
|
||||
}
|
||||
} else {
|
||||
// Buffer number or pattern given. Ignore trailing white space.
|
||||
p = eap->arg + STRLEN(eap->arg);
|
||||
while (p > eap->arg && ascii_iswhite(p[-1])) {
|
||||
p = (char_u *)eap->arg + STRLEN(eap->arg);
|
||||
while (p > (char_u *)eap->arg && ascii_iswhite(p[-1])) {
|
||||
p--;
|
||||
}
|
||||
|
||||
for (i = 0; ascii_isdigit(eap->arg[i]) && eap->arg + i < p; i++) {}
|
||||
for (i = 0; ascii_isdigit(eap->arg[i]) && (char_u *)eap->arg + i < p; i++) {}
|
||||
|
||||
if (eap->arg + i == p) {
|
||||
if ((char_u *)eap->arg + i == p) {
|
||||
// digits only
|
||||
i = (int)atol((char *)eap->arg);
|
||||
i = (int)atol(eap->arg);
|
||||
} else {
|
||||
i = buflist_findpat(eap->arg, p, false, true, false);
|
||||
i = buflist_findpat((char_u *)eap->arg, p, false, true, false);
|
||||
|
||||
if (i < 0) {
|
||||
// error message already given
|
||||
|
@ -5278,7 +5278,7 @@ static int ins_complete(int c, bool enable_pum)
|
||||
// "pattern not found" message.
|
||||
compl_col = curs_col;
|
||||
} else {
|
||||
compl_col = (int)(compl_xp.xp_pattern - compl_pattern);
|
||||
compl_col = (int)((char_u *)compl_xp.xp_pattern - compl_pattern);
|
||||
}
|
||||
compl_length = curs_col - compl_col;
|
||||
} else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI
|
||||
|
@ -1296,7 +1296,7 @@ static list_T *heredoc_get(exarg_T *eap, char *cmd)
|
||||
// The amount of indentation trimmed is the same as the indentation of
|
||||
// the first line after the :let command line. To find the end marker
|
||||
// the indent of the :let command line is trimmed.
|
||||
p = (char *)(*eap->cmdlinep);
|
||||
p = *eap->cmdlinep;
|
||||
while (ascii_iswhite(*p)) {
|
||||
p++;
|
||||
marker_indent_len++;
|
||||
@ -1389,7 +1389,7 @@ void ex_let(exarg_T *eap)
|
||||
|
||||
static void ex_let_const(exarg_T *eap, const bool is_const)
|
||||
{
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
char *expr = NULL;
|
||||
typval_T rettv;
|
||||
int i;
|
||||
@ -1425,7 +1425,7 @@ static void ex_let_const(exarg_T *eap, const bool is_const)
|
||||
list_func_vars(&first);
|
||||
list_vim_vars(&first);
|
||||
}
|
||||
eap->nextcmd = check_nextcmd((char_u *)arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)arg);
|
||||
} else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<') {
|
||||
// HERE document
|
||||
list_T *l = heredoc_get(eap, expr + 3);
|
||||
@ -1434,7 +1434,7 @@ static void ex_let_const(exarg_T *eap, const bool is_const)
|
||||
if (!eap->skip) {
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
(void)ex_let_vars((char *)eap->arg, &rettv, false, semicolon, var_count,
|
||||
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
||||
is_const, (char *)op);
|
||||
}
|
||||
tv_clear(&rettv);
|
||||
@ -1457,14 +1457,14 @@ static void ex_let_const(exarg_T *eap, const bool is_const)
|
||||
if (eap->skip) {
|
||||
++emsg_skip;
|
||||
}
|
||||
i = eval0(expr, &rettv, (char **)&eap->nextcmd, !eap->skip);
|
||||
i = eval0(expr, &rettv, &eap->nextcmd, !eap->skip);
|
||||
if (eap->skip) {
|
||||
if (i != FAIL) {
|
||||
tv_clear(&rettv);
|
||||
}
|
||||
emsg_skip--;
|
||||
} else if (i != FAIL) {
|
||||
(void)ex_let_vars((char *)eap->arg, &rettv, false, semicolon, var_count,
|
||||
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
||||
is_const, (char *)op);
|
||||
tv_clear(&rettv);
|
||||
}
|
||||
@ -2715,7 +2715,7 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
if (strpbrk(arg, "\"'+-*/%.=!?~|&$([<>,#") == NULL) {
|
||||
// ":let var1 var2 ...": find last space.
|
||||
for (p = arg + STRLEN(arg); p >= arg;) {
|
||||
xp->xp_pattern = (char_u *)p;
|
||||
xp->xp_pattern = p;
|
||||
MB_PTR_BACK(arg, p);
|
||||
if (ascii_iswhite(*p)) {
|
||||
break;
|
||||
@ -2727,10 +2727,10 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
xp->xp_context = cmdidx == CMD_call ? EXPAND_FUNCTIONS
|
||||
: EXPAND_EXPRESSION;
|
||||
}
|
||||
while ((xp->xp_pattern = (char_u *)strpbrk(arg, "\"'+-*/%.=!?~|&$([<>,#")) != NULL) {
|
||||
c = *xp->xp_pattern;
|
||||
while ((xp->xp_pattern = strpbrk(arg, "\"'+-*/%.=!?~|&$([<>,#")) != NULL) {
|
||||
c = (uint8_t)(*xp->xp_pattern);
|
||||
if (c == '&') {
|
||||
c = xp->xp_pattern[1];
|
||||
c = (uint8_t)xp->xp_pattern[1];
|
||||
if (c == '&') {
|
||||
++xp->xp_pattern;
|
||||
xp->xp_context = cmdidx != CMD_let || got_eq
|
||||
@ -2753,12 +2753,12 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
break;
|
||||
} else if ((c == '<' || c == '#')
|
||||
&& xp->xp_context == EXPAND_FUNCTIONS
|
||||
&& vim_strchr(xp->xp_pattern, '(') == NULL) {
|
||||
&& vim_strchr((char_u *)xp->xp_pattern, '(') == NULL) {
|
||||
// Function name can start with "<SNR>" and contain '#'.
|
||||
break;
|
||||
} else if (cmdidx != CMD_let || got_eq) {
|
||||
if (c == '"') { // string
|
||||
while ((c = *++xp->xp_pattern) != NUL && c != '"') {
|
||||
while ((c = (uint8_t)(*++xp->xp_pattern)) != NUL && c != '"') {
|
||||
if (c == '\\' && xp->xp_pattern[1] != NUL) {
|
||||
xp->xp_pattern++;
|
||||
}
|
||||
@ -2766,7 +2766,7 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else if (c == '\'') { // literal string
|
||||
// Trick: '' is like stopping and starting a literal string.
|
||||
while ((c = *++xp->xp_pattern) != NUL && c != '\'') {}
|
||||
while ((c = (uint8_t)(*++xp->xp_pattern)) != NUL && c != '\'') {}
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else if (c == '|') {
|
||||
if (xp->xp_pattern[1] == '|') {
|
||||
@ -2783,7 +2783,7 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
// anyway.
|
||||
xp->xp_context = EXPAND_EXPRESSION;
|
||||
}
|
||||
arg = (char *)xp->xp_pattern;
|
||||
arg = xp->xp_pattern;
|
||||
if (*arg != NUL) {
|
||||
while ((c = (char_u)(*++arg)) != NUL && (c == ' ' || c == '\t')) {}
|
||||
}
|
||||
@ -2805,13 +2805,13 @@ void set_context_for_expression(expand_T *xp, char *arg, cmdidx_T cmdidx)
|
||||
}
|
||||
}
|
||||
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = arg;
|
||||
}
|
||||
|
||||
/// ":unlet[!] var1 ... " command.
|
||||
void ex_unlet(exarg_T *eap)
|
||||
{
|
||||
ex_unletlock(eap, (char *)eap->arg, 0, do_unlet_var);
|
||||
ex_unletlock(eap, eap->arg, 0, do_unlet_var);
|
||||
}
|
||||
|
||||
// TODO(ZyX-I): move to eval/ex_cmds
|
||||
@ -2819,7 +2819,7 @@ void ex_unlet(exarg_T *eap)
|
||||
/// ":lockvar" and ":unlockvar" commands
|
||||
void ex_lockvar(exarg_T *eap)
|
||||
{
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
int deep = 2;
|
||||
|
||||
if (eap->forceit) {
|
||||
@ -2894,7 +2894,7 @@ static void ex_unletlock(exarg_T *eap, char *argstart, int deep, ex_unletlock_ca
|
||||
arg = (char *)skipwhite((char_u *)name_end);
|
||||
} while (!ends_excmd(*arg));
|
||||
|
||||
eap->nextcmd = check_nextcmd((char_u *)arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)arg);
|
||||
}
|
||||
|
||||
// TODO(ZyX-I): move to eval/ex_cmds
|
||||
@ -9422,7 +9422,7 @@ int var_item_copy(const vimconv_T *const conv, typval_T *const from, typval_T *c
|
||||
/// ":echon expr1 ..." print each argument plain.
|
||||
void ex_echo(exarg_T *eap)
|
||||
{
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
typval_T rettv;
|
||||
bool atstart = true;
|
||||
bool need_clear = true;
|
||||
@ -9478,7 +9478,7 @@ void ex_echo(exarg_T *eap)
|
||||
tv_clear(&rettv);
|
||||
arg = (char *)skipwhite((char_u *)arg);
|
||||
}
|
||||
eap->nextcmd = check_nextcmd((char_u *)arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)arg);
|
||||
|
||||
if (eap->skip) {
|
||||
emsg_skip--;
|
||||
@ -9496,7 +9496,7 @@ void ex_echo(exarg_T *eap)
|
||||
/// ":echohl {name}".
|
||||
void ex_echohl(exarg_T *eap)
|
||||
{
|
||||
echo_attr = syn_name2attr(eap->arg);
|
||||
echo_attr = syn_name2attr((char_u *)eap->arg);
|
||||
}
|
||||
|
||||
/// ":execute expr1 ..." execute the result of an expression.
|
||||
@ -9506,7 +9506,7 @@ void ex_echohl(exarg_T *eap)
|
||||
/// echo commands
|
||||
void ex_execute(exarg_T *eap)
|
||||
{
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
typval_T rettv;
|
||||
int ret = OK;
|
||||
garray_T ga;
|
||||
@ -9576,7 +9576,7 @@ void ex_execute(exarg_T *eap)
|
||||
--emsg_skip;
|
||||
}
|
||||
|
||||
eap->nextcmd = check_nextcmd((char_u *)arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)arg);
|
||||
}
|
||||
|
||||
/// Skip over the name of an option: "&option", "&g:option" or "&l:option".
|
||||
|
@ -2194,7 +2194,7 @@ static void f_expandcmd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
|
||||
exarg_T eap = {
|
||||
.cmd = (char *)cmdstr,
|
||||
.arg = cmdstr,
|
||||
.arg = (char *)cmdstr,
|
||||
.usefilter = false,
|
||||
.nextcmd = NULL,
|
||||
.cmdidx = CMD_USER,
|
||||
@ -3246,7 +3246,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
|
||||
ExpandInit(&xpc);
|
||||
xpc.xp_pattern = (char_u *)pattern;
|
||||
xpc.xp_pattern = (char *)pattern;
|
||||
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
|
||||
xpc.xp_context = cmdcomplete_str_to_type(type);
|
||||
if (xpc.xp_context == EXPAND_NOTHING) {
|
||||
@ -3255,7 +3255,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
|
||||
if (xpc.xp_context == EXPAND_MENUS) {
|
||||
set_context_in_menu_cmd(&xpc, "menu", (char *)xpc.xp_pattern, false);
|
||||
set_context_in_menu_cmd(&xpc, "menu", xpc.xp_pattern, false);
|
||||
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
|
||||
}
|
||||
|
||||
@ -3265,12 +3265,12 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
|
||||
if (xpc.xp_context == EXPAND_SIGN) {
|
||||
set_context_in_sign_cmd(&xpc, xpc.xp_pattern);
|
||||
set_context_in_sign_cmd(&xpc, (char_u *)xpc.xp_pattern);
|
||||
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
|
||||
}
|
||||
|
||||
theend:
|
||||
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
||||
pat = addstar((char_u *)xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
||||
ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP);
|
||||
tv_list_alloc_ret(rettv, xpc.xp_numfiles);
|
||||
|
||||
@ -3528,7 +3528,7 @@ static void f_getjumplist(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
tv_dict_add_nr(d, S_LEN("coladd"), wp->w_jumplist[i].fmark.mark.coladd);
|
||||
tv_dict_add_nr(d, S_LEN("bufnr"), wp->w_jumplist[i].fmark.fnum);
|
||||
if (wp->w_jumplist[i].fname != NULL) {
|
||||
tv_dict_add_str(d, S_LEN("filename"), (char *)wp->w_jumplist[i].fname);
|
||||
tv_dict_add_str(d, S_LEN("filename"), wp->w_jumplist[i].fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10994,7 +10994,6 @@ static void f_tr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
error:
|
||||
semsg(_(e_invarg2), fromstr);
|
||||
ga_clear(&ga);
|
||||
return;
|
||||
}
|
||||
|
||||
/// "trim({expr})" function
|
||||
|
@ -1953,7 +1953,7 @@ void ex_function(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(eap->arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)eap->arg);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1961,13 +1961,13 @@ void ex_function(exarg_T *eap)
|
||||
* ":function /pat": list functions matching pattern.
|
||||
*/
|
||||
if (*eap->arg == '/') {
|
||||
p = skip_regexp(eap->arg + 1, '/', TRUE, NULL);
|
||||
p = skip_regexp((char_u *)eap->arg + 1, '/', true, NULL);
|
||||
if (!eap->skip) {
|
||||
regmatch_T regmatch;
|
||||
|
||||
c = *p;
|
||||
*p = NUL;
|
||||
regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC);
|
||||
regmatch.regprog = vim_regcomp((char_u *)eap->arg + 1, RE_MAGIC);
|
||||
*p = c;
|
||||
if (regmatch.regprog != NULL) {
|
||||
regmatch.rm_ic = p_ic;
|
||||
@ -1989,7 +1989,7 @@ void ex_function(exarg_T *eap)
|
||||
if (*p == '/') {
|
||||
++p;
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(p);
|
||||
eap->nextcmd = (char *)check_nextcmd(p);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2007,7 +2007,7 @@ void ex_function(exarg_T *eap)
|
||||
// "fudi.fd_di" set, "fudi.fd_newkey" == NULL
|
||||
// s:func script-local function name
|
||||
// g:func global function name, same as "func"
|
||||
p = eap->arg;
|
||||
p = (char_u *)eap->arg;
|
||||
name = trans_function_name(&p, eap->skip, TFN_NO_AUTOLOAD, &fudi, NULL);
|
||||
paren = (vim_strchr(p, '(') != NULL);
|
||||
if (name == NULL && (fudi.fd_dict == NULL || !paren) && !eap->skip) {
|
||||
@ -2043,7 +2043,7 @@ void ex_function(exarg_T *eap)
|
||||
emsg(_(e_trailing));
|
||||
goto ret_free;
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(p);
|
||||
eap->nextcmd = (char *)check_nextcmd(p);
|
||||
if (eap->nextcmd != NULL) {
|
||||
*p = NUL;
|
||||
}
|
||||
@ -2289,10 +2289,10 @@ void ex_function(exarg_T *eap)
|
||||
// Another command follows. If the line came from "eap" we
|
||||
// can simply point into it, otherwise we need to change
|
||||
// "eap->cmdlinep".
|
||||
eap->nextcmd = nextcmd;
|
||||
eap->nextcmd = (char *)nextcmd;
|
||||
if (line_to_free != NULL) {
|
||||
xfree(*eap->cmdlinep);
|
||||
*eap->cmdlinep = line_to_free;
|
||||
*eap->cmdlinep = (char *)line_to_free;
|
||||
line_to_free = NULL;
|
||||
}
|
||||
}
|
||||
@ -2693,7 +2693,7 @@ void ex_delfunction(exarg_T *eap)
|
||||
char_u *name;
|
||||
funcdict_T fudi;
|
||||
|
||||
p = eap->arg;
|
||||
p = (char_u *)eap->arg;
|
||||
name = trans_function_name(&p, eap->skip, 0, &fudi, NULL);
|
||||
xfree(fudi.fd_newkey);
|
||||
if (name == NULL) {
|
||||
@ -2707,7 +2707,7 @@ void ex_delfunction(exarg_T *eap)
|
||||
emsg(_(e_trailing));
|
||||
return;
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(p);
|
||||
eap->nextcmd = (char *)check_nextcmd(p);
|
||||
if (eap->nextcmd != NULL) {
|
||||
*p = NUL;
|
||||
}
|
||||
@ -2858,7 +2858,7 @@ static int can_free_funccal(funccall_T *fc, int copyID)
|
||||
/// ":return [expr]"
|
||||
void ex_return(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
typval_T rettv;
|
||||
int returning = FALSE;
|
||||
|
||||
@ -2873,7 +2873,7 @@ void ex_return(exarg_T *eap)
|
||||
|
||||
eap->nextcmd = NULL;
|
||||
if ((*arg != NUL && *arg != '|' && *arg != '\n')
|
||||
&& eval0((char *)arg, &rettv, (char **)&eap->nextcmd, !eap->skip) != FAIL) {
|
||||
&& eval0((char *)arg, &rettv, &eap->nextcmd, !eap->skip) != FAIL) {
|
||||
if (!eap->skip) {
|
||||
returning = do_return(eap, false, true, &rettv);
|
||||
} else {
|
||||
@ -2896,7 +2896,7 @@ void ex_return(exarg_T *eap)
|
||||
if (returning) {
|
||||
eap->nextcmd = NULL;
|
||||
} else if (eap->nextcmd == NULL) { // no argument
|
||||
eap->nextcmd = check_nextcmd(arg);
|
||||
eap->nextcmd = (char *)check_nextcmd(arg);
|
||||
}
|
||||
|
||||
if (eap->skip) {
|
||||
@ -2909,7 +2909,7 @@ void ex_return(exarg_T *eap)
|
||||
/// ":1,25call func(arg1, arg2)" function call.
|
||||
void ex_call(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *startarg;
|
||||
char_u *name;
|
||||
char_u *tofree;
|
||||
@ -2926,7 +2926,7 @@ void ex_call(exarg_T *eap)
|
||||
// instead to skip to any following command, e.g. for:
|
||||
// :if 0 | call dict.foo().bar() | endif.
|
||||
emsg_skip++;
|
||||
if (eval0((char *)eap->arg, &rettv, (char **)&eap->nextcmd, false) != FAIL) {
|
||||
if (eval0(eap->arg, &rettv, &eap->nextcmd, false) != FAIL) {
|
||||
tv_clear(&rettv);
|
||||
}
|
||||
emsg_skip--;
|
||||
@ -3025,7 +3025,7 @@ void ex_call(exarg_T *eap)
|
||||
emsg(_(e_trailing));
|
||||
}
|
||||
} else {
|
||||
eap->nextcmd = check_nextcmd(arg);
|
||||
eap->nextcmd = (char *)check_nextcmd(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ void ex_align(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
width = atoi((char *)eap->arg);
|
||||
width = atoi(eap->arg);
|
||||
save_curpos = curwin->w_cursor;
|
||||
if (eap->cmdidx == CMD_left) { // width is used for new indent
|
||||
if (width >= 0) {
|
||||
@ -484,7 +484,7 @@ void ex_sort(exarg_T *eap)
|
||||
size_t format_found = 0;
|
||||
bool change_occurred = false; // Buffer contents changed.
|
||||
|
||||
for (p = (char *)eap->arg; *p != NUL; p++) {
|
||||
for (p = eap->arg; *p != NUL; p++) {
|
||||
if (ascii_iswhite(*p)) {
|
||||
// Skip
|
||||
} else if (*p == 'i') {
|
||||
@ -514,7 +514,7 @@ void ex_sort(exarg_T *eap)
|
||||
// comment start
|
||||
break;
|
||||
} else if (check_nextcmd((char_u *)p) != NULL) {
|
||||
eap->nextcmd = check_nextcmd((char_u *)p);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)p);
|
||||
break;
|
||||
} else if (!ASCII_ISALPHA(*p) && regmatch.regprog == NULL) {
|
||||
s = (char *)skip_regexp((char_u *)p + 1, *p, true, NULL);
|
||||
@ -746,8 +746,8 @@ void ex_retab(exarg_T *eap)
|
||||
save_list = curwin->w_p_list;
|
||||
curwin->w_p_list = 0; // don't want list mode here
|
||||
|
||||
new_ts_str = (char *)eap->arg;
|
||||
if (!tabstop_set(eap->arg, &new_vts_array)) {
|
||||
new_ts_str = eap->arg;
|
||||
if (!tabstop_set((char_u *)eap->arg, &new_vts_array)) {
|
||||
return;
|
||||
}
|
||||
while (ascii_isdigit(*(eap->arg)) || *(eap->arg) == ',') {
|
||||
@ -761,7 +761,7 @@ void ex_retab(exarg_T *eap)
|
||||
new_vts_array = curbuf->b_p_vts_array;
|
||||
new_ts_str = NULL;
|
||||
} else {
|
||||
new_ts_str = xstrnsave(new_ts_str, eap->arg - (char_u *)new_ts_str);
|
||||
new_ts_str = xstrnsave(new_ts_str, eap->arg - new_ts_str);
|
||||
}
|
||||
for (lnum = eap->line1; !got_int && lnum <= eap->line2; lnum++) {
|
||||
ptr = (char *)ml_get(lnum);
|
||||
@ -1129,7 +1129,7 @@ void free_prev_shellcmd(void)
|
||||
void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
char *arg = (char *)eap->arg; // command
|
||||
char *arg = eap->arg; // command
|
||||
linenr_T line1 = eap->line1; // start of range
|
||||
linenr_T line2 = eap->line2; // end of range
|
||||
char *newcmd = NULL; // the new command
|
||||
@ -1755,7 +1755,7 @@ void ex_file(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (*eap->arg != NUL || eap->addr_count == 1) {
|
||||
if (rename_buffer((char *)eap->arg) == FAIL) {
|
||||
if (rename_buffer(eap->arg) == FAIL) {
|
||||
return;
|
||||
}
|
||||
redraw_tabline = true;
|
||||
@ -1811,7 +1811,7 @@ int do_write(exarg_T *eap)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
ffname = (char *)eap->arg;
|
||||
ffname = eap->arg;
|
||||
if (*ffname == NUL) {
|
||||
if (eap->cmdidx == CMD_saveas) {
|
||||
emsg(_(e_argreq));
|
||||
@ -2307,7 +2307,7 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
|
||||
long *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
|
||||
|
||||
if (eap != NULL) {
|
||||
command = (char *)eap->do_ecmd_cmd;
|
||||
command = eap->do_ecmd_cmd;
|
||||
}
|
||||
|
||||
set_bufref(&old_curbuf, curbuf);
|
||||
@ -2961,15 +2961,15 @@ void ex_append(exarg_T *eap)
|
||||
if (eap->nextcmd == NULL || *eap->nextcmd == NUL) {
|
||||
break;
|
||||
}
|
||||
p = (char *)vim_strchr(eap->nextcmd, NL);
|
||||
p = (char *)vim_strchr((char_u *)eap->nextcmd, NL);
|
||||
if (p == NULL) {
|
||||
p = (char *)eap->nextcmd + STRLEN(eap->nextcmd);
|
||||
p = eap->nextcmd + STRLEN(eap->nextcmd);
|
||||
}
|
||||
theline = (char *)vim_strnsave(eap->nextcmd, (char_u *)p - eap->nextcmd);
|
||||
theline = xstrnsave(eap->nextcmd, p - eap->nextcmd);
|
||||
if (*p != NUL) {
|
||||
p++;
|
||||
}
|
||||
eap->nextcmd = (char_u *)p;
|
||||
eap->nextcmd = p;
|
||||
} else {
|
||||
// Set State to avoid the cursor shape to be set to INSERT mode
|
||||
// when getline() returns.
|
||||
@ -3105,7 +3105,7 @@ void ex_z(exarg_T *eap)
|
||||
bigness = 1;
|
||||
}
|
||||
|
||||
x = (char *)eap->arg;
|
||||
x = eap->arg;
|
||||
kind = x;
|
||||
if (*kind == '-' || *kind == '+' || *kind == '='
|
||||
|| *kind == '^' || *kind == '.') {
|
||||
@ -3463,7 +3463,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle
|
||||
bool got_quit = false;
|
||||
bool got_match = false;
|
||||
int which_pat;
|
||||
char *cmd = (char *)eap->arg;
|
||||
char *cmd = eap->arg;
|
||||
linenr_T first_line = 0; // first changed line
|
||||
linenr_T last_line= 0; // below last changed line AFTER the change
|
||||
linenr_T old_line_count = curbuf->b_ml.ml_line_count;
|
||||
@ -3519,7 +3519,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle
|
||||
which_pat = RE_LAST; // use last used regexp
|
||||
delimiter = (char_u)(*cmd++); // remember delimiter character
|
||||
pat = cmd; // remember start of search pat
|
||||
cmd = (char *)skip_regexp((char_u *)cmd, delimiter, p_magic, &eap->arg);
|
||||
cmd = (char *)skip_regexp((char_u *)cmd, delimiter, p_magic, (char_u **)&eap->arg);
|
||||
if (cmd[0] == delimiter) { // end delimiter found
|
||||
*cmd++ = NUL; // replace it with a NUL
|
||||
has_second_delim = true;
|
||||
@ -3592,7 +3592,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, bool do_buf_event, handle
|
||||
*/
|
||||
cmd = (char *)skipwhite((char_u *)cmd);
|
||||
if (*cmd && *cmd != '"') { // if not end-of-line or comment
|
||||
eap->nextcmd = check_nextcmd((char_u *)cmd);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)cmd);
|
||||
if (eap->nextcmd == NULL) {
|
||||
emsg(_(e_trailing));
|
||||
return NULL;
|
||||
@ -4570,7 +4570,7 @@ void ex_global(exarg_T *eap)
|
||||
} else {
|
||||
type = (uint8_t)(*eap->cmd);
|
||||
}
|
||||
cmd = (char *)eap->arg;
|
||||
cmd = eap->arg;
|
||||
which_pat = RE_LAST; // default: use last used regexp
|
||||
|
||||
/*
|
||||
@ -4600,7 +4600,7 @@ void ex_global(exarg_T *eap)
|
||||
delim = *cmd; // get the delimiter
|
||||
cmd++; // skip delimiter if there is one
|
||||
pat = cmd; // remember start of pattern
|
||||
cmd = (char *)skip_regexp((char_u *)cmd, delim, p_magic, &eap->arg);
|
||||
cmd = (char *)skip_regexp((char_u *)cmd, delim, p_magic, (char_u **)&eap->arg);
|
||||
if (cmd[0] == delim) { // end delimiter found
|
||||
*cmd++ = NUL; // replace it with a NUL
|
||||
}
|
||||
@ -4776,15 +4776,15 @@ void ex_help(exarg_T *eap)
|
||||
* A ":help" command ends at the first LF, or at a '|' that is
|
||||
* followed by some text. Set nextcmd to the following command.
|
||||
*/
|
||||
for (arg = (char *)eap->arg; *arg; arg++) {
|
||||
for (arg = eap->arg; *arg; arg++) {
|
||||
if (*arg == '\n' || *arg == '\r'
|
||||
|| (*arg == '|' && arg[1] != NUL && arg[1] != '|')) {
|
||||
*arg++ = NUL;
|
||||
eap->nextcmd = (char_u *)arg;
|
||||
eap->nextcmd = arg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
arg = (char *)eap->arg;
|
||||
arg = eap->arg;
|
||||
|
||||
if (eap->forceit && *arg == NUL && !curbuf->b_help) {
|
||||
emsg(_("E478: Don't panic!"));
|
||||
@ -5835,7 +5835,7 @@ void ex_helptags(exarg_T *eap)
|
||||
// Check for ":helptags ++t {dir}".
|
||||
if (STRNCMP(eap->arg, "++t", 3) == 0 && ascii_iswhite(eap->arg[3])) {
|
||||
add_help_tags = true;
|
||||
eap->arg = skipwhite(eap->arg + 3);
|
||||
eap->arg = (char *)skipwhite((char_u *)eap->arg + 3);
|
||||
}
|
||||
|
||||
if (STRCMP(eap->arg, "ALL") == 0) {
|
||||
@ -5843,7 +5843,7 @@ void ex_helptags(exarg_T *eap)
|
||||
} else {
|
||||
ExpandInit(&xpc);
|
||||
xpc.xp_context = EXPAND_DIRECTORIES;
|
||||
dirname = (char *)ExpandOne(&xpc, eap->arg, NULL,
|
||||
dirname = (char *)ExpandOne(&xpc, (char_u *)eap->arg, NULL,
|
||||
WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
|
||||
if (dirname == NULL || !os_isdir((char_u *)dirname)) {
|
||||
semsg(_("E150: Not a directory: %s"), eap->arg);
|
||||
@ -6060,7 +6060,7 @@ void ex_substitute(exarg_T *eap)
|
||||
|
||||
block_autocmds(); // Disable events during command preview.
|
||||
|
||||
char *save_eap = (char *)eap->arg;
|
||||
char *save_eap = eap->arg;
|
||||
garray_T save_view;
|
||||
win_size_save(&save_view); // Save current window sizes.
|
||||
save_search_patterns();
|
||||
@ -6101,7 +6101,7 @@ void ex_substitute(exarg_T *eap)
|
||||
curbuf->b_p_ul = save_b_p_ul;
|
||||
curwin->w_p_cul = save_w_p_cul; // Restore 'cursorline'
|
||||
curwin->w_p_cuc = save_w_p_cuc; // Restore 'cursorcolumn'
|
||||
eap->arg = (char_u *)save_eap;
|
||||
eap->arg = save_eap;
|
||||
restore_search_patterns();
|
||||
win_size_restore(&save_view);
|
||||
ga_clear(&save_view);
|
||||
@ -6204,7 +6204,7 @@ void ex_oldfiles(exarg_T *eap)
|
||||
return;
|
||||
}
|
||||
char *const s = (char *)expand_env_save((char_u *)p);
|
||||
eap->arg = (char_u *)s;
|
||||
eap->arg = s;
|
||||
eap->cmdidx = CMD_edit;
|
||||
cmdmod.browse = false;
|
||||
do_exedit(eap, NULL);
|
||||
|
@ -100,8 +100,8 @@ void ex_profile(exarg_T *eap)
|
||||
char_u *e;
|
||||
int len;
|
||||
|
||||
e = skiptowhite(eap->arg);
|
||||
len = (int)(e - eap->arg);
|
||||
e = skiptowhite((char_u *)eap->arg);
|
||||
len = (int)(e - (char_u *)eap->arg);
|
||||
e = skipwhite(e);
|
||||
|
||||
if (len == 5 && STRNCMP(eap->arg, "start", 5) == 0 && *e != NUL) {
|
||||
@ -218,7 +218,7 @@ void set_context_in_profile_cmd(expand_T *xp, const char *arg)
|
||||
// Default: expand subcommands.
|
||||
xp->xp_context = EXPAND_PROFILE;
|
||||
pexpand_what = PEXP_SUBCMD;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
|
||||
char_u *const end_subcmd = skiptowhite((const char_u *)arg);
|
||||
if (*end_subcmd == NUL) {
|
||||
@ -227,7 +227,7 @@ void set_context_in_profile_cmd(expand_T *xp, const char *arg)
|
||||
|
||||
if ((const char *)end_subcmd - arg == 5 && strncmp(arg, "start", 5) == 0) {
|
||||
xp->xp_context = EXPAND_FILES;
|
||||
xp->xp_pattern = skipwhite((const char_u *)end_subcmd);
|
||||
xp->xp_pattern = (char *)skipwhite((const char_u *)end_subcmd);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1191,7 +1191,7 @@ void ex_next(exarg_T *eap)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD)) {
|
||||
if (*eap->arg != NUL) { // redefine file list
|
||||
if (do_arglist(eap->arg, AL_SET, 0, true) == FAIL) {
|
||||
if (do_arglist((char_u *)eap->arg, AL_SET, 0, true) == FAIL) {
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
@ -1209,7 +1209,7 @@ void ex_argedit(exarg_T *eap)
|
||||
// Whether curbuf will be reused, curbuf->b_ffname will be set.
|
||||
bool curbuf_is_reusable = curbuf_reusable();
|
||||
|
||||
if (do_arglist(eap->arg, AL_ADD, i, true) == FAIL) {
|
||||
if (do_arglist((char_u *)eap->arg, AL_ADD, i, true) == FAIL) {
|
||||
return;
|
||||
}
|
||||
maketitle();
|
||||
@ -1228,7 +1228,7 @@ void ex_argedit(exarg_T *eap)
|
||||
/// ":argadd"
|
||||
void ex_argadd(exarg_T *eap)
|
||||
{
|
||||
do_arglist(eap->arg, AL_ADD,
|
||||
do_arglist((char_u *)eap->arg, AL_ADD,
|
||||
eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1,
|
||||
false);
|
||||
maketitle();
|
||||
@ -1277,7 +1277,7 @@ void ex_argdelete(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
do_arglist(eap->arg, AL_DEL, 0, false);
|
||||
do_arglist((char_u *)eap->arg, AL_DEL, 0, false);
|
||||
}
|
||||
maketitle();
|
||||
}
|
||||
@ -1427,7 +1427,7 @@ void ex_listdo(exarg_T *eap)
|
||||
i++;
|
||||
// execute the command
|
||||
if (execute) {
|
||||
do_cmdline((char *)eap->arg, eap->getline, eap->cookie, DOCMD_VERBOSE + DOCMD_NOWAIT);
|
||||
do_cmdline(eap->arg, eap->getline, eap->cookie, DOCMD_VERBOSE + DOCMD_NOWAIT);
|
||||
}
|
||||
|
||||
if (eap->cmdidx == CMD_bufdo) {
|
||||
@ -1657,7 +1657,7 @@ void ex_options(exarg_T *eap)
|
||||
/// ":source [{fname}]"
|
||||
void ex_source(exarg_T *eap)
|
||||
{
|
||||
cmd_source(eap->arg, eap);
|
||||
cmd_source((char_u *)eap->arg, eap);
|
||||
}
|
||||
|
||||
static void cmd_source(char_u *fname, exarg_T *eap)
|
||||
@ -2207,7 +2207,7 @@ void ex_scriptnames(exarg_T *eap)
|
||||
if (eap->line2 < 1 || eap->line2 > script_items.ga_len) {
|
||||
emsg(_(e_invarg));
|
||||
} else {
|
||||
eap->arg = SCRIPT_ITEM(eap->line2).sn_name;
|
||||
eap->arg = (char *)SCRIPT_ITEM(eap->line2).sn_name;
|
||||
do_exedit(eap, NULL);
|
||||
}
|
||||
return;
|
||||
@ -2575,16 +2575,16 @@ void ex_scriptencoding(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (*eap->arg != NUL) {
|
||||
name = enc_canonize(eap->arg);
|
||||
name = enc_canonize((char_u *)eap->arg);
|
||||
} else {
|
||||
name = eap->arg;
|
||||
name = (char_u *)eap->arg;
|
||||
}
|
||||
|
||||
// Setup for conversion from the specified encoding to 'encoding'.
|
||||
sp = (struct source_cookie *)getline_cookie(eap->getline, eap->cookie);
|
||||
convert_setup(&sp->conv, name, p_enc);
|
||||
|
||||
if (name != eap->arg) {
|
||||
if (name != (char_u *)eap->arg) {
|
||||
xfree(name);
|
||||
}
|
||||
}
|
||||
@ -2786,26 +2786,26 @@ void ex_language(exarg_T *eap)
|
||||
# define VIM_LC_MESSAGES 6789
|
||||
# endif
|
||||
|
||||
name = eap->arg;
|
||||
name = (char_u *)eap->arg;
|
||||
|
||||
// Check for "messages {name}", "ctype {name}" or "time {name}" argument.
|
||||
// Allow abbreviation, but require at least 3 characters to avoid
|
||||
// confusion with a two letter language name "me" or "ct".
|
||||
p = skiptowhite(eap->arg);
|
||||
if ((*p == NUL || ascii_iswhite(*p)) && p - eap->arg >= 3) {
|
||||
if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0) {
|
||||
p = skiptowhite((char_u *)eap->arg);
|
||||
if ((*p == NUL || ascii_iswhite(*p)) && p - (char_u *)eap->arg >= 3) {
|
||||
if (STRNICMP(eap->arg, "messages", p - (char_u *)eap->arg) == 0) {
|
||||
what = VIM_LC_MESSAGES;
|
||||
name = skipwhite(p);
|
||||
whatstr = "messages ";
|
||||
} else if (STRNICMP(eap->arg, "ctype", p - eap->arg) == 0) {
|
||||
} else if (STRNICMP(eap->arg, "ctype", p - (char_u *)eap->arg) == 0) {
|
||||
what = LC_CTYPE;
|
||||
name = skipwhite(p);
|
||||
whatstr = "ctype ";
|
||||
} else if (STRNICMP(eap->arg, "time", p - eap->arg) == 0) {
|
||||
} else if (STRNICMP(eap->arg, "time", p - (char_u *)eap->arg) == 0) {
|
||||
what = LC_TIME;
|
||||
name = skipwhite(p);
|
||||
whatstr = "time ";
|
||||
} else if (STRNICMP(eap->arg, "collate", p - eap->arg) == 0) {
|
||||
} else if (STRNICMP(eap->arg, "collate", p - (char_u *)eap->arg) == 0) {
|
||||
what = LC_COLLATE;
|
||||
name = skipwhite(p);
|
||||
whatstr = "collate ";
|
||||
@ -2999,7 +2999,7 @@ static void script_host_execute_file(char *name, exarg_T *eap)
|
||||
{
|
||||
if (!eap->skip) {
|
||||
uint8_t buffer[MAXPATHL];
|
||||
vim_FullName((char *)eap->arg, (char *)buffer, sizeof(buffer), false);
|
||||
vim_FullName(eap->arg, (char *)buffer, sizeof(buffer), false);
|
||||
|
||||
list_T *args = tv_list_alloc(3);
|
||||
// filename
|
||||
@ -3036,7 +3036,7 @@ void ex_drop(exarg_T *eap)
|
||||
// and mostly only one file is dropped.
|
||||
// This also ignores wildcards, since it is very unlikely the user is
|
||||
// editing a file name with a wildcard character.
|
||||
do_arglist(eap->arg, AL_SET, 0, false);
|
||||
do_arglist((char_u *)eap->arg, AL_SET, 0, false);
|
||||
|
||||
// Expanding wildcards may result in an empty argument list. E.g. when
|
||||
// editing "foo.pyc" and ".pyc" is in 'wildignore'. Assume that we
|
||||
|
@ -114,7 +114,7 @@ typedef struct aucmd_executable_t AucmdExecutable;
|
||||
struct aucmd_executable_t {
|
||||
AucmdExecutableType type;
|
||||
union {
|
||||
char_u *cmd;
|
||||
char *cmd;
|
||||
Callback cb;
|
||||
} callable;
|
||||
};
|
||||
@ -174,10 +174,10 @@ enum {
|
||||
|
||||
/// Arguments used for Ex commands.
|
||||
struct exarg {
|
||||
char_u *arg; ///< argument of the command
|
||||
char_u *nextcmd; ///< next command (NULL if none)
|
||||
char *cmd; ///< the name of the command (except for :make)
|
||||
char_u **cmdlinep; ///< pointer to pointer of allocated cmdline
|
||||
char *arg; ///< argument of the command
|
||||
char *nextcmd; ///< next command (NULL if none)
|
||||
char *cmd; ///< the name of the command (except for :make)
|
||||
char **cmdlinep; ///< pointer to pointer of allocated cmdline
|
||||
cmdidx_T cmdidx; ///< the index for the command
|
||||
uint32_t argt; ///< flags for the command
|
||||
int skip; ///< don't execute the command, only parse it
|
||||
@ -187,7 +187,7 @@ struct exarg {
|
||||
linenr_T line2; ///< the second line number or count
|
||||
cmd_addr_T addr_type; ///< type of the count/range
|
||||
int flags; ///< extra flags after count: EXFLAG_
|
||||
char_u *do_ecmd_cmd; ///< +command arg to be used in edited file
|
||||
char *do_ecmd_cmd; ///< +command arg to be used in edited file
|
||||
linenr_T do_ecmd_lnum; ///< the line number in an edited file
|
||||
int append; ///< TRUE with ":w >>file" command
|
||||
int usefilter; ///< TRUE with ":w !command" and ":r!command"
|
||||
@ -201,7 +201,7 @@ struct exarg {
|
||||
int useridx; ///< user command index
|
||||
char *errmsg; ///< returned error message
|
||||
LineGetter getline; ///< Function used to get the next line
|
||||
void *cookie; ///< argument for getline()
|
||||
void *cookie; ///< argument for getline()
|
||||
cstack_T *cstack; ///< condition stack for ":if" etc.
|
||||
long verbose_save; ///< saved value of p_verbose
|
||||
int save_msg_silent; ///< saved value of msg_silent
|
||||
@ -219,10 +219,10 @@ struct exarg {
|
||||
|
||||
// used for completion on the command line
|
||||
struct expand {
|
||||
char_u *xp_pattern; // start of item to expand
|
||||
char *xp_pattern; // start of item to expand
|
||||
int xp_context; // type of expansion
|
||||
size_t xp_pattern_len; // bytes in xp_pattern before cursor
|
||||
char_u *xp_arg; // completion function
|
||||
char *xp_arg; // completion function
|
||||
LuaRef xp_luaref; // Ref to Lua completion function
|
||||
sctx_T xp_script_ctx; // SCTX for completion function
|
||||
int xp_backslash; // one of the XP_BS_ values
|
||||
@ -232,8 +232,8 @@ struct expand {
|
||||
#endif
|
||||
int xp_numfiles; // number of files found by file name completion
|
||||
int xp_col; // cursor position in line
|
||||
char_u **xp_files; // list of files
|
||||
char_u *xp_line; // text being completed
|
||||
char **xp_files; // list of files
|
||||
char *xp_line; // text being completed
|
||||
};
|
||||
|
||||
// values for xp_backslash
|
||||
@ -256,7 +256,7 @@ typedef struct {
|
||||
bool keeppatterns; ///< true when ":keeppatterns" was used
|
||||
bool lockmarks; ///< true when ":lockmarks" was used
|
||||
bool noswapfile; ///< true when ":noswapfile" was used
|
||||
char_u *save_ei; ///< saved value of 'eventignore'
|
||||
char *save_ei; ///< saved value of 'eventignore'
|
||||
regmatch_T filter_regmatch; ///< set by :filter /pat/
|
||||
bool filter_force; ///< set for :filter!
|
||||
} cmdmod_T;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -148,7 +148,7 @@ int aborted_in_try(void)
|
||||
/// When several messages appear in the same command, the first is usually the
|
||||
/// most specific one and used as the exception value. The "severe" flag can be
|
||||
/// set to true, if a later but severer message should be used instead.
|
||||
bool cause_errthrow(const char_u *mesg, bool severe, bool *ignore)
|
||||
bool cause_errthrow(const char *mesg, bool severe, bool *ignore)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
struct msglist *elem;
|
||||
@ -197,7 +197,7 @@ bool cause_errthrow(const char_u *mesg, bool severe, bool *ignore)
|
||||
* interrupt exception is catchable by the innermost try conditional and
|
||||
* not replaced by an interrupt message error exception.
|
||||
*/
|
||||
if (mesg == (char_u *)_(e_interr)) {
|
||||
if (mesg == _(e_interr)) {
|
||||
*ignore = true;
|
||||
return true;
|
||||
}
|
||||
@ -255,7 +255,7 @@ bool cause_errthrow(const char_u *mesg, bool severe, bool *ignore)
|
||||
}
|
||||
|
||||
elem = xmalloc(sizeof(struct msglist));
|
||||
elem->msg = (char *)vim_strsave(mesg);
|
||||
elem->msg = xstrdup(mesg);
|
||||
elem->next = NULL;
|
||||
elem->throw_msg = NULL;
|
||||
*plist = elem;
|
||||
@ -305,7 +305,7 @@ void free_global_msglist(void)
|
||||
/// Throw the message specified in the call to cause_errthrow() above as an
|
||||
/// error exception. If cstack is NULL, postpone the throw until do_cmdline()
|
||||
/// has returned (see do_one_cmd()).
|
||||
void do_errthrow(cstack_T *cstack, char_u *cmdname)
|
||||
void do_errthrow(cstack_T *cstack, char *cmdname)
|
||||
{
|
||||
/*
|
||||
* Ensure that all commands in nested function calls and sourced files
|
||||
@ -382,7 +382,7 @@ int do_intthrow(cstack_T *cstack)
|
||||
}
|
||||
|
||||
/// Get an exception message that is to be stored in current_exception->value.
|
||||
char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free)
|
||||
char *get_exception_string(void *value, except_type_T type, char *cmdname, int *should_free)
|
||||
{
|
||||
char *ret, *mesg;
|
||||
char *p, *val;
|
||||
@ -446,7 +446,7 @@ char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int
|
||||
///
|
||||
/// @return FAIL when out of memory or it was tried to throw an illegal user
|
||||
/// exception.
|
||||
static int throw_exception(void *value, except_type_T type, char_u *cmdname)
|
||||
static int throw_exception(void *value, except_type_T type, char *cmdname)
|
||||
{
|
||||
except_T *excp;
|
||||
int should_free;
|
||||
@ -479,8 +479,7 @@ static int throw_exception(void *value, except_type_T type, char_u *cmdname)
|
||||
}
|
||||
|
||||
excp->type = type;
|
||||
excp->throw_name = vim_strsave(sourcing_name == NULL
|
||||
? (char_u *)"" : sourcing_name);
|
||||
excp->throw_name = (char *)vim_strsave(sourcing_name == NULL ? (char_u *)"" : sourcing_name);
|
||||
excp->throw_lnum = sourcing_lnum;
|
||||
|
||||
if (p_verbose >= 13 || debug_break_level > 0) {
|
||||
@ -525,7 +524,7 @@ fail:
|
||||
/// caught and the catch clause has been ended normally.
|
||||
static void discard_exception(except_T *excp, bool was_finished)
|
||||
{
|
||||
char_u *saved_IObuff;
|
||||
char *saved_IObuff;
|
||||
|
||||
if (current_exception == excp) {
|
||||
current_exception = NULL;
|
||||
@ -538,7 +537,7 @@ static void discard_exception(except_T *excp, bool was_finished)
|
||||
if (p_verbose >= 13 || debug_break_level > 0) {
|
||||
int save_msg_silent = msg_silent;
|
||||
|
||||
saved_IObuff = vim_strsave(IObuff);
|
||||
saved_IObuff = (char *)vim_strsave(IObuff);
|
||||
if (debug_break_level > 0) {
|
||||
msg_silent = FALSE; // display messages
|
||||
} else {
|
||||
@ -801,7 +800,7 @@ void ex_eval(exarg_T *eap)
|
||||
{
|
||||
typval_T tv;
|
||||
|
||||
if (eval0((char *)eap->arg, &tv, (char **)&eap->nextcmd, !eap->skip) == OK) {
|
||||
if (eval0(eap->arg, &tv, &eap->nextcmd, !eap->skip) == OK) {
|
||||
tv_clear(&tv);
|
||||
}
|
||||
}
|
||||
@ -822,7 +821,7 @@ void ex_if(exarg_T *eap)
|
||||
skip = CHECK_SKIP;
|
||||
|
||||
bool error;
|
||||
result = eval_to_bool((char *)eap->arg, &error, (char **)&eap->nextcmd, skip);
|
||||
result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
|
||||
|
||||
if (!skip && !error) {
|
||||
if (result) {
|
||||
@ -911,7 +910,7 @@ void ex_else(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_elseif) {
|
||||
bool error;
|
||||
result = eval_to_bool((char *)eap->arg, &error, (char **)&eap->nextcmd, skip);
|
||||
result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
|
||||
// When throwing error exceptions, we want to throw always the first
|
||||
// of several errors in a row. This is what actually happens when
|
||||
// a conditional error was detected above and there is another failure
|
||||
@ -962,7 +961,7 @@ void ex_while(exarg_T *eap)
|
||||
/*
|
||||
* ":while bool-expr"
|
||||
*/
|
||||
result = eval_to_bool((char *)eap->arg, &error, (char **)&eap->nextcmd, skip);
|
||||
result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
|
||||
} else {
|
||||
void *fi;
|
||||
|
||||
@ -976,13 +975,13 @@ void ex_while(exarg_T *eap)
|
||||
error = FALSE;
|
||||
} else {
|
||||
// Evaluate the argument and get the info in a structure.
|
||||
fi = eval_for_line((char *)eap->arg, &error, (char **)&eap->nextcmd, skip);
|
||||
fi = eval_for_line(eap->arg, &error, &eap->nextcmd, skip);
|
||||
cstack->cs_forinfo[cstack->cs_idx] = fi;
|
||||
}
|
||||
|
||||
// use the element at the start of the list and advance
|
||||
if (!error && fi != NULL && !skip) {
|
||||
result = next_for_item(fi, (char *)eap->arg);
|
||||
result = next_for_item(fi, eap->arg);
|
||||
} else {
|
||||
result = FALSE;
|
||||
}
|
||||
@ -1283,13 +1282,13 @@ void ex_catch(exarg_T *eap)
|
||||
bool give_up = false;
|
||||
bool skip = false;
|
||||
bool caught = false;
|
||||
char_u *end;
|
||||
char_u save_char = 0;
|
||||
char_u *save_cpo;
|
||||
char *end;
|
||||
char save_char = 0;
|
||||
char *save_cpo;
|
||||
regmatch_T regmatch;
|
||||
int prev_got_int;
|
||||
cstack_T *const cstack = eap->cstack;
|
||||
char_u *pat;
|
||||
char *pat;
|
||||
|
||||
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) {
|
||||
eap->errmsg = N_("E603: :catch without :try");
|
||||
@ -1318,12 +1317,12 @@ void ex_catch(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (ends_excmd(*eap->arg)) { // no argument, catch all errors
|
||||
pat = (char_u *)".*";
|
||||
pat = ".*";
|
||||
end = NULL;
|
||||
eap->nextcmd = find_nextcmd(eap->arg);
|
||||
eap->nextcmd = (char *)find_nextcmd((char_u *)eap->arg);
|
||||
} else {
|
||||
pat = eap->arg + 1;
|
||||
end = skip_regexp(pat, *eap->arg, TRUE, NULL);
|
||||
end = (char *)skip_regexp((char_u *)pat, *eap->arg, true, NULL);
|
||||
}
|
||||
|
||||
if (!give_up) {
|
||||
@ -1343,7 +1342,7 @@ void ex_catch(exarg_T *eap)
|
||||
*/
|
||||
if (!skip && (cstack->cs_flags[idx] & CSF_THROWN)
|
||||
&& !(cstack->cs_flags[idx] & CSF_CAUGHT)) {
|
||||
if (end != NULL && *end != NUL && !ends_excmd(*skipwhite(end + 1))) {
|
||||
if (end != NULL && *end != NUL && !ends_excmd(*skipwhite((char_u *)end + 1))) {
|
||||
emsg(_(e_trailing));
|
||||
return;
|
||||
}
|
||||
@ -1362,18 +1361,18 @@ void ex_catch(exarg_T *eap)
|
||||
save_char = *end;
|
||||
*end = NUL;
|
||||
}
|
||||
save_cpo = p_cpo;
|
||||
save_cpo = (char *)p_cpo;
|
||||
p_cpo = (char_u *)"";
|
||||
// Disable error messages, it will make current exception
|
||||
// invalid
|
||||
emsg_off++;
|
||||
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
|
||||
regmatch.regprog = vim_regcomp((char_u *)pat, RE_MAGIC + RE_STRING);
|
||||
emsg_off--;
|
||||
regmatch.rm_ic = false;
|
||||
if (end != NULL) {
|
||||
*end = save_char;
|
||||
}
|
||||
p_cpo = save_cpo;
|
||||
p_cpo = (char_u *)save_cpo;
|
||||
if (regmatch.regprog == NULL) {
|
||||
semsg(_(e_invarg2), pat);
|
||||
} else {
|
||||
@ -1426,7 +1425,7 @@ void ex_catch(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (end != NULL) {
|
||||
eap->nextcmd = find_nextcmd(end);
|
||||
eap->nextcmd = (char *)find_nextcmd((char_u *)end);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2036,7 +2035,7 @@ void ex_endfunction(exarg_T *eap)
|
||||
}
|
||||
|
||||
/// @return TRUE if the string "p" looks like a ":while" or ":for" command.
|
||||
int has_loop_cmd(char_u *p)
|
||||
int has_loop_cmd(char *p)
|
||||
{
|
||||
int len;
|
||||
|
||||
@ -2045,7 +2044,7 @@ int has_loop_cmd(char_u *p)
|
||||
while (*p == ' ' || *p == '\t' || *p == ':') {
|
||||
++p;
|
||||
}
|
||||
len = modifier_len((char *)p);
|
||||
len = modifier_len(p);
|
||||
if (len == 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ struct vim_exception {
|
||||
except_type_T type; // exception type
|
||||
char *value; // exception value
|
||||
struct msglist *messages; // message(s) causing error exception
|
||||
char_u *throw_name; // name of the throw point
|
||||
char *throw_name; // name of the throw point
|
||||
linenr_T throw_lnum; // line number of the throw point
|
||||
except_T *caught; // next exception on the caught stack
|
||||
};
|
||||
|
@ -833,8 +833,8 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init
|
||||
|
||||
if (ccline.input_fn) {
|
||||
s->xpc.xp_context = ccline.xp_context;
|
||||
s->xpc.xp_pattern = ccline.cmdbuff;
|
||||
s->xpc.xp_arg = ccline.xp_arg;
|
||||
s->xpc.xp_pattern = (char *)ccline.cmdbuff;
|
||||
s->xpc.xp_arg = (char *)ccline.xp_arg;
|
||||
}
|
||||
|
||||
// Avoid scrolling when called by a recursive do_cmdline(), e.g. when
|
||||
@ -1210,7 +1210,7 @@ static int command_line_execute(VimState *state, int key)
|
||||
// cursor
|
||||
int found = false;
|
||||
|
||||
int j = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
int j = (int)((char_u *)s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
int i = 0;
|
||||
while (--j > 0) {
|
||||
// check for start of menu name
|
||||
@ -1265,7 +1265,7 @@ static int command_line_execute(VimState *state, int key)
|
||||
int found = false;
|
||||
|
||||
int j = ccline.cmdpos;
|
||||
int i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
int i = (int)((char_u *)s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
while (--j > i) {
|
||||
j -= utf_head_off(ccline.cmdbuff, ccline.cmdbuff + j);
|
||||
if (vim_ispathsep(ccline.cmdbuff[j])) {
|
||||
@ -1286,7 +1286,7 @@ static int command_line_execute(VimState *state, int key)
|
||||
int found = false;
|
||||
|
||||
int j = ccline.cmdpos - 1;
|
||||
int i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
int i = (int)((char_u *)s->xpc.xp_pattern - ccline.cmdbuff);
|
||||
while (--j > i) {
|
||||
j -= utf_head_off(ccline.cmdbuff, ccline.cmdbuff + j);
|
||||
if (vim_ispathsep(ccline.cmdbuff[j])
|
||||
@ -2665,12 +2665,12 @@ static void realloc_cmdbuff(int len)
|
||||
&& ccline.xpc->xp_pattern != NULL
|
||||
&& ccline.xpc->xp_context != EXPAND_NOTHING
|
||||
&& ccline.xpc->xp_context != EXPAND_UNSUCCESSFUL) {
|
||||
int i = (int)(ccline.xpc->xp_pattern - p);
|
||||
int i = (int)((char_u *)ccline.xpc->xp_pattern - p);
|
||||
|
||||
// If xp_pattern points inside the old cmdbuff it needs to be adjusted
|
||||
// to point into the newly allocated memory.
|
||||
if (i >= 0 && i <= ccline.cmdlen) {
|
||||
ccline.xpc->xp_pattern = ccline.cmdbuff + i;
|
||||
ccline.xpc->xp_pattern = (char *)ccline.cmdbuff + i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3764,7 +3764,7 @@ static int nextwild(expand_T *xp, int type, int options, int escape)
|
||||
ui_flush();
|
||||
}
|
||||
|
||||
i = (int)(xp->xp_pattern - ccline.cmdbuff);
|
||||
i = (int)((char_u *)xp->xp_pattern - ccline.cmdbuff);
|
||||
assert(ccline.cmdpos >= i);
|
||||
xp->xp_pattern_len = (size_t)ccline.cmdpos - (size_t)i;
|
||||
|
||||
@ -3773,7 +3773,7 @@ static int nextwild(expand_T *xp, int type, int options, int escape)
|
||||
p2 = ExpandOne(xp, NULL, NULL, 0, type);
|
||||
} else {
|
||||
// Translate string into pattern and expand it.
|
||||
p1 = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
|
||||
p1 = addstar((char_u *)xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
|
||||
const int use_options = (
|
||||
options
|
||||
| WILD_HOME_REPLACE
|
||||
@ -3787,7 +3787,7 @@ static int nextwild(expand_T *xp, int type, int options, int escape)
|
||||
|
||||
// xp->xp_pattern might have been modified by ExpandOne (for example,
|
||||
// in lua completion), so recompute the pattern index and length
|
||||
i = (int)(xp->xp_pattern - ccline.cmdbuff);
|
||||
i = (int)((char_u *)xp->xp_pattern - ccline.cmdbuff);
|
||||
xp->xp_pattern_len = (size_t)ccline.cmdpos - (size_t)i;
|
||||
|
||||
// Longest match: make sure it is not shorter, happens with :help.
|
||||
@ -3808,7 +3808,7 @@ static int nextwild(expand_T *xp, int type, int options, int escape)
|
||||
difflen = (int)STRLEN(p2) - (int)(xp->xp_pattern_len);
|
||||
if (ccline.cmdlen + difflen + 4 > ccline.cmdbufflen) {
|
||||
realloc_cmdbuff(ccline.cmdlen + difflen + 4);
|
||||
xp->xp_pattern = ccline.cmdbuff + i;
|
||||
xp->xp_pattern = (char *)ccline.cmdbuff + i;
|
||||
}
|
||||
assert(ccline.cmdpos <= ccline.cmdlen);
|
||||
memmove(&ccline.cmdbuff[ccline.cmdpos + difflen],
|
||||
@ -3918,13 +3918,13 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
compl_selected = findex;
|
||||
cmdline_pum_display(false);
|
||||
} else if (p_wmnu) {
|
||||
win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files,
|
||||
win_redr_status_matches(xp, xp->xp_numfiles, (char_u **)xp->xp_files,
|
||||
findex, cmd_showtail);
|
||||
}
|
||||
if (findex == -1) {
|
||||
return vim_strsave(orig_save);
|
||||
}
|
||||
return vim_strsave(xp->xp_files[findex]);
|
||||
return vim_strsave((char_u *)xp->xp_files[findex]);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
@ -3934,12 +3934,12 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
ss = vim_strsave(orig_save ? orig_save : (char_u *)"");
|
||||
} else if (mode == WILD_APPLY) {
|
||||
ss = vim_strsave(findex == -1 ? (orig_save ? orig_save : (char_u *)"") :
|
||||
xp->xp_files[findex]);
|
||||
(char_u *)xp->xp_files[findex]);
|
||||
}
|
||||
|
||||
// free old names
|
||||
if (xp->xp_numfiles != -1 && mode != WILD_ALL && mode != WILD_LONGEST) {
|
||||
FreeWild(xp->xp_numfiles, xp->xp_files);
|
||||
FreeWild(xp->xp_numfiles, (char_u **)xp->xp_files);
|
||||
xp->xp_numfiles = -1;
|
||||
XFREE_CLEAR(orig_save);
|
||||
}
|
||||
@ -3957,7 +3957,7 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
/*
|
||||
* Do the expansion.
|
||||
*/
|
||||
if (ExpandFromContext(xp, str, &xp->xp_numfiles, &xp->xp_files,
|
||||
if (ExpandFromContext(xp, str, &xp->xp_numfiles, (char_u ***)&xp->xp_files,
|
||||
options) == FAIL) {
|
||||
#ifdef FNAME_ILLEGAL
|
||||
/* Illegal file name has been silently skipped. But when there
|
||||
@ -3974,7 +3974,7 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
}
|
||||
} else {
|
||||
// Escape the matches for use on the command line.
|
||||
ExpandEscape(xp, str, xp->xp_numfiles, xp->xp_files, options);
|
||||
ExpandEscape(xp, str, xp->xp_numfiles, (char_u **)xp->xp_files, options);
|
||||
|
||||
/*
|
||||
* Check for matching suffixes in file names.
|
||||
@ -3995,9 +3995,9 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
* expand_wildcards, only need to check the first two.
|
||||
*/
|
||||
non_suf_match = 0;
|
||||
for (i = 0; i < 2; ++i) {
|
||||
if (match_suffix(xp->xp_files[i])) {
|
||||
++non_suf_match;
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (match_suffix((char_u *)xp->xp_files[i])) {
|
||||
non_suf_match++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4014,7 +4014,7 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
}
|
||||
}
|
||||
if (!(non_suf_match != 1 && mode == WILD_EXPAND_FREE)) {
|
||||
ss = vim_strsave(xp->xp_files[0]);
|
||||
ss = vim_strsave((char_u *)xp->xp_files[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4025,10 +4025,10 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
size_t len = 0;
|
||||
|
||||
for (size_t mb_len; xp->xp_files[0][len]; len += mb_len) {
|
||||
mb_len = (size_t)utfc_ptr2len(&xp->xp_files[0][len]);
|
||||
int c0 = utf_ptr2char(&xp->xp_files[0][len]);
|
||||
mb_len = (size_t)utfc_ptr2len((char_u *)&xp->xp_files[0][len]);
|
||||
int c0 = utf_ptr2char((char_u *)&xp->xp_files[0][len]);
|
||||
for (i = 1; i < xp->xp_numfiles; i++) {
|
||||
int ci = utf_ptr2char(&xp->xp_files[i][len]);
|
||||
int ci = utf_ptr2char((char_u *)&xp->xp_files[i][len]);
|
||||
|
||||
if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES
|
||||
|| xp->xp_context == EXPAND_FILES
|
||||
@ -4049,7 +4049,7 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
|
||||
}
|
||||
}
|
||||
|
||||
ss = (char_u *)xstrndup((char *)xp->xp_files[0], len);
|
||||
ss = (char_u *)xstrndup(xp->xp_files[0], len);
|
||||
findex = -1; // next p_wc gets first one
|
||||
}
|
||||
|
||||
@ -4099,7 +4099,7 @@ void ExpandInit(expand_T *xp)
|
||||
void ExpandCleanup(expand_T *xp)
|
||||
{
|
||||
if (xp->xp_numfiles >= 0) {
|
||||
FreeWild(xp->xp_numfiles, xp->xp_files);
|
||||
FreeWild(xp->xp_numfiles, (char_u **)xp->xp_files);
|
||||
xp->xp_numfiles = -1;
|
||||
}
|
||||
}
|
||||
@ -4288,7 +4288,7 @@ static int showmatches(expand_T *xp, int wildmenu)
|
||||
}
|
||||
} else {
|
||||
num_files = xp->xp_numfiles;
|
||||
files_found = xp->xp_files;
|
||||
files_found = (char_u **)xp->xp_files;
|
||||
showtail = cmd_showtail;
|
||||
}
|
||||
|
||||
@ -4306,7 +4306,7 @@ static int showmatches(expand_T *xp, int wildmenu)
|
||||
compl_match_array[i].pum_text = L_SHOWFILE(i);
|
||||
}
|
||||
char_u *endpos = (showtail
|
||||
? sm_gettail(xp->xp_pattern, true) : xp->xp_pattern);
|
||||
? sm_gettail((char_u *)xp->xp_pattern, true) : (char_u *)xp->xp_pattern);
|
||||
if (ui_has(kUICmdline)) {
|
||||
compl_startcol = (int)(endpos - ccline.cmdbuff);
|
||||
} else {
|
||||
@ -4490,14 +4490,14 @@ static int expand_showtail(expand_T *xp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
end = path_tail(xp->xp_pattern);
|
||||
if (end == xp->xp_pattern) { // there is no path separator
|
||||
return FALSE;
|
||||
end = path_tail((char_u *)xp->xp_pattern);
|
||||
if (end == (char_u *)xp->xp_pattern) { // there is no path separator
|
||||
return false;
|
||||
}
|
||||
|
||||
for (s = xp->xp_pattern; s < end; s++) {
|
||||
/* Skip escaped wildcards. Only when the backslash is not a path
|
||||
* separator, on DOS the '*' "path\*\file" must not be skipped. */
|
||||
for (s = (char_u *)xp->xp_pattern; s < end; s++) {
|
||||
// Skip escaped wildcards. Only when the backslash is not a path
|
||||
// separator, on DOS the '*' "path\*\file" must not be skipped.
|
||||
if (rem_backslash(s)) {
|
||||
++s;
|
||||
} else if (vim_strchr((char_u *)"*?[", *s) != NULL) {
|
||||
@ -4718,8 +4718,8 @@ void set_cmd_context(expand_T *xp, char_u *str, int len, int col, int use_ccline
|
||||
set_context_for_expression(xp, (char *)str, CMD_SIZE);
|
||||
} else if (use_ccline && ccline.input_fn) {
|
||||
xp->xp_context = ccline.xp_context;
|
||||
xp->xp_pattern = ccline.cmdbuff;
|
||||
xp->xp_arg = ccline.xp_arg;
|
||||
xp->xp_pattern = (char *)ccline.cmdbuff;
|
||||
xp->xp_arg = (char *)ccline.xp_arg;
|
||||
} else {
|
||||
while (nextcomm != NULL) {
|
||||
nextcomm = set_one_cmd_context(xp, nextcomm);
|
||||
@ -4728,7 +4728,7 @@ void set_cmd_context(expand_T *xp, char_u *str, int len, int col, int use_ccline
|
||||
|
||||
/* Store the string here so that call_user_expand_func() can get to them
|
||||
* easily. */
|
||||
xp->xp_line = str;
|
||||
xp->xp_line = (char *)str;
|
||||
xp->xp_col = col;
|
||||
|
||||
str[col] = old_char;
|
||||
@ -4763,9 +4763,9 @@ int expand_cmdline(expand_T *xp, char_u *str, int col, int *matchcount, char_u *
|
||||
}
|
||||
|
||||
// add star to file name, or convert to regexp if not exp. files.
|
||||
assert((str + col) - xp->xp_pattern >= 0);
|
||||
xp->xp_pattern_len = (size_t)((str + col) - xp->xp_pattern);
|
||||
file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
|
||||
assert((str + col) - (char_u *)xp->xp_pattern >= 0);
|
||||
xp->xp_pattern_len = (size_t)((str + col) - (char_u *)xp->xp_pattern);
|
||||
file_str = addstar((char_u *)xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
|
||||
|
||||
if (p_wic) {
|
||||
options += WILD_ICASE;
|
||||
@ -5312,18 +5312,18 @@ static void *call_user_expand_func(user_expand_func_T user_expand_func, expand_T
|
||||
ccline.cmdbuff[ccline.cmdlen] = 0;
|
||||
}
|
||||
|
||||
pat = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len);
|
||||
pat = vim_strnsave((char_u *)xp->xp_pattern, xp->xp_pattern_len);
|
||||
args[0].v_type = VAR_STRING;
|
||||
args[1].v_type = VAR_STRING;
|
||||
args[2].v_type = VAR_NUMBER;
|
||||
args[3].v_type = VAR_UNKNOWN;
|
||||
args[0].vval.v_string = pat;
|
||||
args[1].vval.v_string = xp->xp_line;
|
||||
args[1].vval.v_string = (char_u *)xp->xp_line;
|
||||
args[2].vval.v_number = xp->xp_col;
|
||||
|
||||
current_sctx = xp->xp_script_ctx;
|
||||
|
||||
void *const ret = user_expand_func(xp->xp_arg, 3, args);
|
||||
void *const ret = user_expand_func((char_u *)xp->xp_arg, 3, args);
|
||||
|
||||
current_sctx = save_current_sctx;
|
||||
if (ccline.cmdbuff != NULL) {
|
||||
@ -6239,7 +6239,7 @@ void ex_history(exarg_T *eap)
|
||||
int idx;
|
||||
int i, j, k;
|
||||
char_u *end;
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
|
||||
if (hislen == 0) {
|
||||
msg(_("'history' option is zero"));
|
||||
|
@ -3938,7 +3938,7 @@ char_u *set_context_in_map_cmd(expand_T *xp, char_u *cmd, char_u *arg, bool forc
|
||||
}
|
||||
break;
|
||||
}
|
||||
xp->xp_pattern = arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -641,15 +641,15 @@ void ex_hardcopy(exarg_T *eap)
|
||||
char *errormsg = NULL;
|
||||
|
||||
// Expand things like "%.ps".
|
||||
if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL) {
|
||||
if (expand_filename(eap, (char_u **)eap->cmdlinep, &errormsg) == FAIL) {
|
||||
if (errormsg != NULL) {
|
||||
emsg(errormsg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
settings.outfile = skipwhite(eap->arg + 1);
|
||||
settings.outfile = skipwhite((char_u *)eap->arg + 1);
|
||||
} else if (*eap->arg != NUL) {
|
||||
settings.arguments = eap->arg;
|
||||
settings.arguments = (char_u *)eap->arg;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1453,8 +1453,7 @@ static bool highlight_list_arg(const int id, bool didh, const int type, int iarg
|
||||
}
|
||||
}
|
||||
|
||||
(void)syn_list_header(didh, (int)(vim_strsize((char_u *)ts) + (int)STRLEN(name)
|
||||
+ 1), id, false);
|
||||
(void)syn_list_header(didh, vim_strsize((char_u *)ts) + (int)STRLEN(name) + 1, id, false);
|
||||
didh = true;
|
||||
if (!got_int) {
|
||||
if (*name != NUL) {
|
||||
@ -1973,7 +1972,7 @@ void set_context_in_highlight_cmd(expand_T *xp, const char *arg)
|
||||
{
|
||||
// Default: expand group names.
|
||||
xp->xp_context = EXPAND_HIGHLIGHT;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
include_link = 2;
|
||||
include_default = 1;
|
||||
|
||||
@ -1984,7 +1983,7 @@ void set_context_in_highlight_cmd(expand_T *xp, const char *arg)
|
||||
include_default = 0;
|
||||
if (strncmp("default", arg, (unsigned)(p - arg)) == 0) {
|
||||
arg = (const char *)skipwhite((const char_u *)p);
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
p = (const char *)skiptowhite((const char_u *)arg);
|
||||
}
|
||||
if (*p != NUL) { // past group name
|
||||
@ -1994,11 +1993,11 @@ void set_context_in_highlight_cmd(expand_T *xp, const char *arg)
|
||||
}
|
||||
if (strncmp("link", arg, (unsigned)(p - arg)) == 0
|
||||
|| strncmp("clear", arg, (unsigned)(p - arg)) == 0) {
|
||||
xp->xp_pattern = skipwhite((const char_u *)p);
|
||||
p = (const char *)skiptowhite(xp->xp_pattern);
|
||||
xp->xp_pattern = (char *)skipwhite((const char_u *)p);
|
||||
p = (const char *)skiptowhite((char_u *)xp->xp_pattern);
|
||||
if (*p != NUL) { // Past first group name.
|
||||
xp->xp_pattern = skipwhite((const char_u *)p);
|
||||
p = (const char *)skiptowhite(xp->xp_pattern);
|
||||
xp->xp_pattern = (char *)skipwhite((const char_u *)p);
|
||||
p = (const char *)skiptowhite((char_u *)xp->xp_pattern);
|
||||
}
|
||||
}
|
||||
if (*p != NUL) { // Past group name(s).
|
||||
|
@ -145,7 +145,7 @@ void set_context_in_cscope_cmd(expand_T *xp, const char *arg, cmdidx_T cmdidx)
|
||||
{
|
||||
// Default: expand subcommands.
|
||||
xp->xp_context = EXPAND_CSCOPE;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
expand_what = ((cmdidx == CMD_scscope)
|
||||
? EXP_SCSCOPE_SUBCMD : EXP_CSCOPE_SUBCMD);
|
||||
|
||||
@ -153,8 +153,8 @@ void set_context_in_cscope_cmd(expand_T *xp, const char *arg, cmdidx_T cmdidx)
|
||||
if (*arg != NUL) {
|
||||
const char *p = (const char *)skiptowhite((const char_u *)arg);
|
||||
if (*p != NUL) { // Past first word.
|
||||
xp->xp_pattern = skipwhite((const char_u *)p);
|
||||
if (*skiptowhite(xp->xp_pattern) != NUL) {
|
||||
xp->xp_pattern = (char *)skipwhite((const char_u *)p);
|
||||
if (*skiptowhite((char_u *)xp->xp_pattern) != NUL) {
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else if (STRNICMP(arg, "add", p - arg) == 0) {
|
||||
xp->xp_context = EXPAND_FILES;
|
||||
@ -224,8 +224,8 @@ void ex_cstag(exarg_T *eap)
|
||||
switch (p_csto) {
|
||||
case 0:
|
||||
if (cs_check_for_connections()) {
|
||||
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, false,
|
||||
false, *eap->cmdlinep);
|
||||
ret = cs_find_common("g", eap->arg, eap->forceit, false,
|
||||
false, (char_u *)(*eap->cmdlinep));
|
||||
if (ret == false) {
|
||||
cs_free_tags();
|
||||
if (msg_col) {
|
||||
@ -233,32 +233,32 @@ void ex_cstag(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (cs_check_for_tags()) {
|
||||
ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
|
||||
ret = do_tag((char_u *)eap->arg, DT_JUMP, 0, eap->forceit, false);
|
||||
}
|
||||
}
|
||||
} else if (cs_check_for_tags()) {
|
||||
ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
|
||||
ret = do_tag((char_u *)eap->arg, DT_JUMP, 0, eap->forceit, false);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (cs_check_for_tags()) {
|
||||
ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
|
||||
if (ret == FALSE) {
|
||||
ret = do_tag((char_u *)eap->arg, DT_JUMP, 0, eap->forceit, false);
|
||||
if (ret == false) {
|
||||
if (msg_col) {
|
||||
msg_putchar('\n');
|
||||
}
|
||||
|
||||
if (cs_check_for_connections()) {
|
||||
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit,
|
||||
false, false, *eap->cmdlinep);
|
||||
ret = cs_find_common("g", eap->arg, eap->forceit,
|
||||
false, false, (char_u *)(*eap->cmdlinep));
|
||||
if (ret == false) {
|
||||
cs_free_tags();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cs_check_for_connections()) {
|
||||
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, false,
|
||||
false, *eap->cmdlinep);
|
||||
ret = cs_find_common("g", eap->arg, eap->forceit, false,
|
||||
false, (char_u *)(*eap->cmdlinep));
|
||||
if (ret == false) {
|
||||
cs_free_tags();
|
||||
}
|
||||
@ -899,7 +899,7 @@ static int cs_find(exarg_T *eap)
|
||||
}
|
||||
|
||||
pat = opt + strlen(opt) + 1;
|
||||
if (pat >= (char *)eap->arg + eap_arg_len) {
|
||||
if (pat >= eap->arg + eap_arg_len) {
|
||||
cs_usage_msg(Find);
|
||||
return false;
|
||||
}
|
||||
@ -915,7 +915,7 @@ static int cs_find(exarg_T *eap)
|
||||
}
|
||||
|
||||
return cs_find_common(opt, pat, eap->forceit, true,
|
||||
eap->cmdidx == CMD_lcscope, *eap->cmdlinep);
|
||||
eap->cmdidx == CMD_lcscope, (char_u *)(*eap->cmdlinep));
|
||||
}
|
||||
|
||||
|
||||
@ -1210,7 +1210,7 @@ static cscmd_T *cs_lookup_cmd(exarg_T *eap)
|
||||
// Store length of eap->arg before it gets modified by strtok().
|
||||
eap_arg_len = (int)STRLEN(eap->arg);
|
||||
|
||||
if ((stok = strtok((char *)(eap->arg), (const char *)" ")) == NULL) {
|
||||
if ((stok = strtok(eap->arg, (const char *)" ")) == NULL) { // NOLINT(runtime/threadsafe_fn)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1873,7 +1873,7 @@ void nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap)
|
||||
char *buf = xcalloc(length, sizeof(char));
|
||||
bool done = false;
|
||||
while (!done) {
|
||||
done = uc_split_args_iter(eap->arg, length, &end, buf, &len);
|
||||
done = uc_split_args_iter((char_u *)eap->arg, length, &end, buf, &len);
|
||||
if (len > 0) {
|
||||
lua_pushlstring(lstate, buf, len);
|
||||
lua_rawseti(lstate, -2, i);
|
||||
|
@ -513,7 +513,7 @@ int main(int argc, char **argv)
|
||||
|
||||
// Need to jump to the tag before executing the '-c command'.
|
||||
// Makes "vim -c '/return' -t main" work.
|
||||
handle_tag(params.tagname);
|
||||
handle_tag((char_u *)params.tagname);
|
||||
|
||||
// Execute any "+", "-c" and "-S" arguments.
|
||||
if (params.n_commands > 0) {
|
||||
@ -1131,7 +1131,7 @@ static void command_line_scan(mparm_T *parmp)
|
||||
}
|
||||
parmp->edit_type = EDIT_QF;
|
||||
if (argv[0][argv_idx]) { // "-q{errorfile}"
|
||||
parmp->use_ef = (char_u *)argv[0] + argv_idx;
|
||||
parmp->use_ef = argv[0] + argv_idx;
|
||||
argv_idx = -1;
|
||||
} else if (argc > 1) { // "-q {errorfile}"
|
||||
want_argument = true;
|
||||
@ -1160,7 +1160,7 @@ static void command_line_scan(mparm_T *parmp)
|
||||
}
|
||||
parmp->edit_type = EDIT_TAG;
|
||||
if (argv[0][argv_idx]) { // "-t{tag}"
|
||||
parmp->tagname = (char_u *)argv[0] + argv_idx;
|
||||
parmp->tagname = argv[0] + argv_idx;
|
||||
argv_idx = -1;
|
||||
} else { // "-t {tag}"
|
||||
want_argument = true;
|
||||
@ -1272,7 +1272,7 @@ static void command_line_scan(mparm_T *parmp)
|
||||
break;
|
||||
|
||||
case 'q': // "-q {errorfile}" QuickFix mode
|
||||
parmp->use_ef = (char_u *)argv[0];
|
||||
parmp->use_ef = argv[0];
|
||||
break;
|
||||
|
||||
case 'i': // "-i {shada}" use for shada
|
||||
@ -1313,7 +1313,7 @@ scripterror:
|
||||
}
|
||||
|
||||
case 't': // "-t {tag}"
|
||||
parmp->tagname = (char_u *)argv[0];
|
||||
parmp->tagname = argv[0];
|
||||
break;
|
||||
case 'u': // "-u {vimrc}" vim inits file
|
||||
parmp->use_vimrc = argv[0];
|
||||
@ -1507,7 +1507,7 @@ static void handle_quickfix(mparm_T *paramp)
|
||||
{
|
||||
if (paramp->edit_type == EDIT_QF) {
|
||||
if (paramp->use_ef != NULL) {
|
||||
set_string_option_direct("ef", -1, paramp->use_ef, OPT_FREE, SID_CARG);
|
||||
set_string_option_direct("ef", -1, (char_u *)paramp->use_ef, OPT_FREE, SID_CARG);
|
||||
}
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "cfile %s", p_ef);
|
||||
if (qf_init(NULL, (char *)p_ef, p_efm, true, (char *)IObuff, (char *)p_menc) < 0) {
|
||||
|
@ -19,13 +19,13 @@ typedef struct {
|
||||
|
||||
int n_commands; // no. of commands from + or -c
|
||||
char *commands[MAX_ARG_CMDS]; // commands from + or -c arg
|
||||
char_u cmds_tofree[MAX_ARG_CMDS]; // commands that need free()
|
||||
char cmds_tofree[MAX_ARG_CMDS]; // commands that need free()
|
||||
int n_pre_commands; // no. of commands from --cmd
|
||||
char *pre_commands[MAX_ARG_CMDS]; // commands from --cmd argument
|
||||
|
||||
int edit_type; // type of editing to do
|
||||
char_u *tagname; // tag from -t argument
|
||||
char_u *use_ef; // 'errorfile' from -q argument
|
||||
char *tagname; // tag from -t argument
|
||||
char *use_ef; // 'errorfile' from -q argument
|
||||
|
||||
bool input_isatty; // stdin is a terminal
|
||||
bool output_isatty; // stdout is a terminal
|
||||
|
@ -651,7 +651,7 @@ static char_u *mark_line(pos_T *mp, int lead_len)
|
||||
*/
|
||||
void ex_marks(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
int i;
|
||||
char_u *name;
|
||||
pos_T *posp, *startp, *endp;
|
||||
@ -668,7 +668,7 @@ void ex_marks(exarg_T *eap)
|
||||
if (namedfm[i].fmark.fnum != 0) {
|
||||
name = fm_getname(&namedfm[i].fmark, 15);
|
||||
} else {
|
||||
name = namedfm[i].fname;
|
||||
name = (char_u *)namedfm[i].fname;
|
||||
}
|
||||
if (name != NULL) {
|
||||
show_one_mark(i >= NMARKS ? i - NMARKS + '0' : i + 'A',
|
||||
@ -767,7 +767,7 @@ void ex_delmarks(exarg_T *eap)
|
||||
emsg(_(e_argreq));
|
||||
} else {
|
||||
// clear specified marks only
|
||||
for (p = eap->arg; *p != NUL; ++p) {
|
||||
for (p = (char_u *)eap->arg; *p != NUL; p++) {
|
||||
lower = ASCII_ISLOWER(*p);
|
||||
digit = ascii_isdigit(*p);
|
||||
if (lower || digit || ASCII_ISUPPER(*p)) {
|
||||
@ -1311,7 +1311,7 @@ void copy_jumplist(win_T *from, win_T *to)
|
||||
for (i = 0; i < from->w_jumplistlen; ++i) {
|
||||
to->w_jumplist[i] = from->w_jumplist[i];
|
||||
if (from->w_jumplist[i].fname != NULL) {
|
||||
to->w_jumplist[i].fname = vim_strsave(from->w_jumplist[i].fname);
|
||||
to->w_jumplist[i].fname = xstrdup(from->w_jumplist[i].fname);
|
||||
}
|
||||
}
|
||||
to->w_jumplistlen = from->w_jumplistlen;
|
||||
@ -1665,7 +1665,7 @@ void get_global_marks(list_T *l)
|
||||
if (namedfm[i].fmark.fnum != 0) {
|
||||
name = (char *)buflist_nr2name(namedfm[i].fmark.fnum, true, true);
|
||||
} else {
|
||||
name = (char *)namedfm[i].fname;
|
||||
name = namedfm[i].fname;
|
||||
}
|
||||
if (name != NULL) {
|
||||
mname[1] = i >= NMARKS ? (char)(i - NMARKS + '0') : (char)(i + 'A');
|
||||
|
@ -42,7 +42,7 @@ typedef struct filemark {
|
||||
/// Structure defining extended mark (mark with file name attached)
|
||||
typedef struct xfilemark {
|
||||
fmark_T fmark; ///< Actual mark.
|
||||
char_u *fname; ///< File name, used when fnum == 0.
|
||||
char *fname; ///< File name, used when fnum == 0.
|
||||
} xfmark_T;
|
||||
|
||||
#endif // NVIM_MARK_DEFS_H
|
||||
|
@ -1176,14 +1176,14 @@ void ex_match(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (ends_excmd(*eap->arg)) {
|
||||
end = eap->arg;
|
||||
end = (char_u *)eap->arg;
|
||||
} else if ((STRNICMP(eap->arg, "none", 4) == 0
|
||||
&& (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4])))) {
|
||||
end = eap->arg + 4;
|
||||
end = (char_u *)eap->arg + 4;
|
||||
} else {
|
||||
p = skiptowhite(eap->arg);
|
||||
p = skiptowhite((char_u *)eap->arg);
|
||||
if (!eap->skip) {
|
||||
g = vim_strnsave(eap->arg, (size_t)(p - eap->arg));
|
||||
g = vim_strnsave((char_u *)eap->arg, (size_t)(p - (char_u *)eap->arg));
|
||||
}
|
||||
p = skipwhite(p);
|
||||
if (*p == NUL) {
|
||||
@ -1213,5 +1213,5 @@ void ex_match(exarg_T *eap)
|
||||
*end = (char_u)c;
|
||||
}
|
||||
}
|
||||
eap->nextcmd = find_nextcmd(end);
|
||||
eap->nextcmd = (char *)find_nextcmd(end);
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ void ex_menu(exarg_T *eap)
|
||||
// kFalse for "menu disable
|
||||
vimmenu_T menuarg;
|
||||
|
||||
modes = get_menu_cmd_modes((char *)eap->cmd, eap->forceit, &noremap, &unmenu);
|
||||
arg = (char *)eap->arg;
|
||||
modes = get_menu_cmd_modes(eap->cmd, eap->forceit, &noremap, &unmenu);
|
||||
arg = eap->arg;
|
||||
|
||||
for (;;) {
|
||||
if (STRNCMP(arg, "<script>", 8) == 0) {
|
||||
@ -1022,7 +1022,7 @@ char *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char *arg, bool for
|
||||
xfree(path_name);
|
||||
|
||||
xp->xp_context = expand_menus ? EXPAND_MENUNAMES : EXPAND_MENUS;
|
||||
xp->xp_pattern = (char_u *)after_dot;
|
||||
xp->xp_pattern = after_dot;
|
||||
expand_menu = menu;
|
||||
} else { // We're in the mapping part
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
@ -1470,7 +1470,7 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
|
||||
// execute it.
|
||||
void ex_emenu(exarg_T *eap)
|
||||
{
|
||||
char *saved_name = xstrdup((char *)eap->arg);
|
||||
char *saved_name = xstrdup(eap->arg);
|
||||
vimmenu_T *menu = *get_root_menu(saved_name);
|
||||
char *name = saved_name;
|
||||
while (*name) {
|
||||
@ -1531,7 +1531,7 @@ static garray_T menutrans_ga = GA_EMPTY_INIT_VALUE;
|
||||
*/
|
||||
void ex_menutranslate(exarg_T *eap)
|
||||
{
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
char *from, *from_noamp, *to;
|
||||
|
||||
if (menutrans_ga.ga_itemsize == 0) {
|
||||
|
@ -631,7 +631,7 @@ static bool emsg_multiline(const char *s, bool multiline)
|
||||
* when the message should be ignored completely (used for the
|
||||
* interrupt message).
|
||||
*/
|
||||
if (cause_errthrow((char_u *)s, severe, &ignore)) {
|
||||
if (cause_errthrow(s, severe, &ignore)) {
|
||||
if (!ignore) {
|
||||
did_emsg++;
|
||||
}
|
||||
|
@ -801,9 +801,9 @@ void curs_columns(win_T *wp, int may_scroll)
|
||||
// When cursor wraps to first char of next line in Insert
|
||||
// mode, the 'showbreak' string isn't shown, backup to first
|
||||
// column
|
||||
char_u *const sbr = get_showbreak_value(wp);
|
||||
char *const sbr = (char *)get_showbreak_value(wp);
|
||||
if (*sbr && *get_cursor_pos_ptr() == NUL
|
||||
&& wp->w_wcol == vim_strsize(sbr)) {
|
||||
&& wp->w_wcol == vim_strsize((char_u *)sbr)) {
|
||||
wp->w_wcol = 0;
|
||||
}
|
||||
}
|
||||
|
@ -3830,7 +3830,7 @@ void ex_display(exarg_T *eap)
|
||||
char_u *p;
|
||||
yankreg_T *yb;
|
||||
int name;
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
int clen;
|
||||
int type;
|
||||
|
||||
|
@ -948,7 +948,7 @@ void ex_set(exarg_T *eap)
|
||||
if (eap->forceit) {
|
||||
flags |= OPT_ONECOLUMN;
|
||||
}
|
||||
(void)do_set(eap->arg, flags);
|
||||
(void)do_set((char_u *)eap->arg, flags);
|
||||
}
|
||||
|
||||
/// Parse 'arg' for option settings.
|
||||
@ -6698,12 +6698,12 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
|
||||
xp->xp_context = EXPAND_SETTINGS;
|
||||
if (*arg == NUL) {
|
||||
xp->xp_pattern = arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
return;
|
||||
}
|
||||
p = arg + STRLEN(arg) - 1;
|
||||
if (*p == ' ' && *(p - 1) != '\\') {
|
||||
xp->xp_pattern = p + 1;
|
||||
xp->xp_pattern = (char *)p + 1;
|
||||
return;
|
||||
}
|
||||
while (p > arg) {
|
||||
@ -6729,7 +6729,8 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
xp->xp_context = EXPAND_BOOL_SETTINGS;
|
||||
p += 3;
|
||||
}
|
||||
xp->xp_pattern = arg = p;
|
||||
xp->xp_pattern = (char *)p;
|
||||
arg = p;
|
||||
if (*arg == '<') {
|
||||
while (*p != '>') {
|
||||
if (*p++ == NUL) { // expand terminal option name
|
||||
@ -6796,7 +6797,7 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
} else {
|
||||
expand_option_idx = opt_idx;
|
||||
}
|
||||
xp->xp_pattern = p + 1;
|
||||
xp->xp_pattern = (char *)p + 1;
|
||||
return;
|
||||
}
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
@ -6804,7 +6805,7 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
return;
|
||||
}
|
||||
|
||||
xp->xp_pattern = p + 1;
|
||||
xp->xp_pattern = (char *)p + 1;
|
||||
|
||||
if (flags & P_EXPAND) {
|
||||
p = options[opt_idx].var;
|
||||
@ -6837,16 +6838,16 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
|
||||
// For an option that is a list of file names, find the start of the
|
||||
// last file name.
|
||||
for (p = arg + STRLEN(arg) - 1; p > xp->xp_pattern; p--) {
|
||||
for (p = arg + STRLEN(arg) - 1; p > (char_u *)xp->xp_pattern; p--) {
|
||||
// count number of backslashes before ' ' or ','
|
||||
if (*p == ' ' || *p == ',') {
|
||||
s = p;
|
||||
while (s > xp->xp_pattern && *(s - 1) == '\\') {
|
||||
while (s > (char_u *)xp->xp_pattern && *(s - 1) == '\\') {
|
||||
s--;
|
||||
}
|
||||
if ((*p == ' ' && (xp->xp_backslash == XP_BS_THREE && (p - s) < 3))
|
||||
|| (*p == ',' && (flags & P_COMMA) && ((p - s) & 1) == 0)) {
|
||||
xp->xp_pattern = p + 1;
|
||||
xp->xp_pattern = (char *)p + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -6854,7 +6855,7 @@ void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags)
|
||||
// for 'spellsuggest' start at "file:"
|
||||
if (options[opt_idx].var == (char_u *)&p_sps
|
||||
&& STRNCMP(p, "file:", 5) == 0) {
|
||||
xp->xp_pattern = p + 5;
|
||||
xp->xp_pattern = (char *)p + 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ char *save_abs_path(const char *name)
|
||||
if (!path_is_absolute((char_u *)name)) {
|
||||
return FullName_save(name, true);
|
||||
}
|
||||
return (char *)vim_strsave((char_u *)name);
|
||||
return xstrdup(name);
|
||||
}
|
||||
|
||||
/// Checks if a path has a wildcard character including '~', unless at the end.
|
||||
|
@ -3174,7 +3174,7 @@ void qf_list(exarg_T *eap)
|
||||
int i;
|
||||
int idx1 = 1;
|
||||
int idx2 = -1;
|
||||
char *arg = (char *)eap->arg;
|
||||
char *arg = eap->arg;
|
||||
int all = eap->forceit; // if not :cl!, only show
|
||||
// recognised errors
|
||||
qf_info_T *qi;
|
||||
@ -4392,7 +4392,7 @@ void ex_make(exarg_T *eap)
|
||||
}
|
||||
os_remove(fname); // in case it's not unique
|
||||
|
||||
char *const cmd = make_get_fullcmd((char *)eap->arg, fname);
|
||||
char *const cmd = make_get_fullcmd(eap->arg, fname);
|
||||
|
||||
do_shell(cmd, 0);
|
||||
|
||||
@ -4401,7 +4401,7 @@ void ex_make(exarg_T *eap)
|
||||
res = qf_init(wp, fname, (eap->cmdidx != CMD_make
|
||||
&& eap->cmdidx != CMD_lmake) ? p_gefm : p_efm,
|
||||
(eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd),
|
||||
qf_cmdtitle((char *)(*eap->cmdlinep)), enc);
|
||||
qf_cmdtitle(*eap->cmdlinep), enc);
|
||||
if (wp != NULL) {
|
||||
qi = GET_LOC_LIST(wp);
|
||||
if (qi == NULL) {
|
||||
@ -5112,7 +5112,7 @@ void ex_cfile(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
if (*eap->arg != NUL) {
|
||||
set_string_option_direct("ef", -1, eap->arg, OPT_FREE, 0);
|
||||
set_string_option_direct("ef", -1, (char_u *)eap->arg, OPT_FREE, 0);
|
||||
}
|
||||
|
||||
char *enc = (*curbuf->b_p_menc != NUL) ? (char *)curbuf->b_p_menc : (char *)p_menc;
|
||||
@ -5133,7 +5133,7 @@ void ex_cfile(exarg_T *eap)
|
||||
// quickfix list then a new list is created.
|
||||
int res = qf_init(wp, (char *)p_ef, p_efm, (eap->cmdidx != CMD_caddfile
|
||||
&& eap->cmdidx != CMD_laddfile),
|
||||
qf_cmdtitle((char *)(*eap->cmdlinep)), enc);
|
||||
qf_cmdtitle(*eap->cmdlinep), enc);
|
||||
if (wp != NULL) {
|
||||
qi = GET_LOC_LIST(wp);
|
||||
if (qi == NULL) {
|
||||
@ -5385,7 +5385,7 @@ static void vgr_jump_to_match(qf_info_T *qi, int forceit, bool *redraw_for_dummy
|
||||
// Jump to the directory used after loading the buffer.
|
||||
if (curbuf == first_match_buf && target_dir != NULL) {
|
||||
exarg_T ea = {
|
||||
.arg = (char_u *)target_dir,
|
||||
.arg = target_dir,
|
||||
.cmdidx = CMD_lcd,
|
||||
};
|
||||
ex_cd(&ea);
|
||||
@ -5414,7 +5414,7 @@ static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
|
||||
memset(args, 0, sizeof(*args));
|
||||
|
||||
args->regmatch.regprog = NULL;
|
||||
args->qf_title = xstrdup(qf_cmdtitle((char *)(*eap->cmdlinep)));
|
||||
args->qf_title = xstrdup(qf_cmdtitle(*eap->cmdlinep));
|
||||
|
||||
if (eap->addr_count > 0) {
|
||||
args->tomatch = eap->line2;
|
||||
@ -5423,7 +5423,7 @@ static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
|
||||
}
|
||||
|
||||
// Get the search pattern: either white-separated or enclosed in //
|
||||
char *p = skip_vimgrep_pat((char *)eap->arg, &args->spat, &args->flags);
|
||||
char *p = skip_vimgrep_pat(eap->arg, &args->spat, &args->flags);
|
||||
if (p == NULL) {
|
||||
emsg(_(e_invalpat));
|
||||
return FAIL;
|
||||
@ -5682,7 +5682,7 @@ static void restore_start_dir(char *dirname_start)
|
||||
// If the directory has changed, change it back by building up an
|
||||
// appropriate ex command and executing it.
|
||||
exarg_T ea = {
|
||||
.arg = (char_u *)dirname_start,
|
||||
.arg = dirname_start,
|
||||
.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd,
|
||||
};
|
||||
ex_cd(&ea);
|
||||
@ -6887,8 +6887,8 @@ static int cbuffer_process_args(exarg_T *eap, buf_T **bufp, linenr_T *line1, lin
|
||||
|
||||
if (*eap->arg == NUL) {
|
||||
buf = curbuf;
|
||||
} else if (*skipwhite(skipdigits(eap->arg)) == NUL) {
|
||||
buf = buflist_findnr(atoi((char *)eap->arg));
|
||||
} else if (*skipwhite(skipdigits((char_u *)eap->arg)) == NUL) {
|
||||
buf = buflist_findnr(atoi(eap->arg));
|
||||
}
|
||||
|
||||
if (buf == NULL) {
|
||||
@ -6949,7 +6949,7 @@ void ex_cbuffer(exarg_T *eap)
|
||||
return;
|
||||
}
|
||||
|
||||
qf_title = qf_cmdtitle((char *)(*eap->cmdlinep));
|
||||
qf_title = qf_cmdtitle(*eap->cmdlinep);
|
||||
|
||||
if (buf->b_sfname) {
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "%s (%s)",
|
||||
@ -7035,7 +7035,7 @@ void ex_cexpr(exarg_T *eap)
|
||||
// Evaluate the expression. When the result is a string or a list we can
|
||||
// use it to fill the errorlist.
|
||||
typval_T tv;
|
||||
if (eval0((char *)eap->arg, &tv, (char **)&eap->nextcmd, true) != FAIL) {
|
||||
if (eval0(eap->arg, &tv, &eap->nextcmd, true) != FAIL) {
|
||||
if ((tv.v_type == VAR_STRING && tv.vval.v_string != NULL)
|
||||
|| tv.v_type == VAR_LIST) {
|
||||
incr_quickfix_busy();
|
||||
@ -7043,7 +7043,7 @@ void ex_cexpr(exarg_T *eap)
|
||||
(eap->cmdidx != CMD_caddexpr
|
||||
&& eap->cmdidx != CMD_laddexpr),
|
||||
(linenr_T)0, (linenr_T)0,
|
||||
qf_cmdtitle((char *)(*eap->cmdlinep)), NULL);
|
||||
qf_cmdtitle(*eap->cmdlinep), NULL);
|
||||
if (qf_stack_empty(qi)) {
|
||||
decr_quickfix_busy();
|
||||
goto cleanup;
|
||||
@ -7238,14 +7238,14 @@ void ex_helpgrep(exarg_T *eap)
|
||||
incr_quickfix_busy();
|
||||
|
||||
// Check for a specified language
|
||||
char *const lang = check_help_lang((char *)eap->arg);
|
||||
char *const lang = check_help_lang(eap->arg);
|
||||
regmatch_T regmatch = {
|
||||
.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING),
|
||||
.regprog = vim_regcomp((char_u *)eap->arg, RE_MAGIC + RE_STRING),
|
||||
.rm_ic = false,
|
||||
};
|
||||
if (regmatch.regprog != NULL) {
|
||||
// Create a new quickfix list.
|
||||
qf_new_list(qi, qf_cmdtitle((char *)(*eap->cmdlinep)));
|
||||
qf_new_list(qi, qf_cmdtitle(*eap->cmdlinep));
|
||||
qf_list_T *const qfl = qf_get_curlist(qi);
|
||||
|
||||
hgr_search_in_rtp(qfl, ®match, lang);
|
||||
|
@ -35,7 +35,7 @@ void runtime_init(void)
|
||||
/// ":runtime [what] {name}"
|
||||
void ex_runtime(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *p = skiptowhite(arg);
|
||||
ptrdiff_t len = p - arg;
|
||||
int flags = eap->forceit ? DIP_ALL : 0;
|
||||
|
@ -1289,9 +1289,7 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
XFREE_CLEAR(cur_entry.data.filemark.fname);
|
||||
}
|
||||
xfmark_T fm = (xfmark_T) {
|
||||
.fname = (char_u *)(buf == NULL
|
||||
? cur_entry.data.filemark.fname
|
||||
: NULL),
|
||||
.fname = buf == NULL ? cur_entry.data.filemark.fname : NULL,
|
||||
.fmark = {
|
||||
.mark = cur_entry.data.filemark.mark,
|
||||
.fnum = (buf == NULL ? 0 : buf->b_fnum),
|
||||
@ -4027,9 +4025,9 @@ static inline size_t shada_init_jumps(PossiblyFreedShadaEntry *jumps,
|
||||
: fm.fmark.fnum != 0) {
|
||||
continue;
|
||||
}
|
||||
const char *const fname = (char *)(fm.fmark.fnum == 0
|
||||
? (fm.fname == NULL ? NULL : fm.fname)
|
||||
: buf ? buf->b_ffname : NULL);
|
||||
const char *const fname =
|
||||
(char *)(fm.fmark.fnum ==
|
||||
0 ? (fm.fname == NULL ? NULL : (char_u *)fm.fname) : buf ? buf->b_ffname : NULL);
|
||||
if (fname == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1419,7 +1419,7 @@ static int parse_sign_cmd_args(int cmd, char_u *arg, char_u **sign_name, int *si
|
||||
/// ":sign" command
|
||||
void ex_sign(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *p;
|
||||
int idx;
|
||||
sign_T *sp;
|
||||
@ -1785,7 +1785,7 @@ void set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
||||
// Default: expand subcommands.
|
||||
xp->xp_context = EXPAND_SIGN;
|
||||
expand_what = EXP_SUBCMD;
|
||||
xp->xp_pattern = arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
|
||||
end_subcmd = skiptowhite(arg);
|
||||
if (*end_subcmd == NUL) {
|
||||
@ -1822,7 +1822,7 @@ void set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
||||
// last p
|
||||
if (p == NULL) {
|
||||
// Expand last argument name (before equal sign).
|
||||
xp->xp_pattern = last;
|
||||
xp->xp_pattern = (char *)last;
|
||||
switch (cmd_idx) {
|
||||
case SIGNCMD_DEFINE:
|
||||
expand_what = EXP_DEFINE;
|
||||
@ -1852,7 +1852,7 @@ void set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
||||
}
|
||||
} else {
|
||||
// Expand last argument value (after equal sign).
|
||||
xp->xp_pattern = p + 1;
|
||||
xp->xp_pattern = (char *)p + 1;
|
||||
switch (cmd_idx) {
|
||||
case SIGNCMD_DEFINE:
|
||||
if (STRNCMP(last, "texthl", 6) == 0
|
||||
|
@ -4874,7 +4874,7 @@ void ex_mkspell(exarg_T *eap)
|
||||
{
|
||||
int fcount;
|
||||
char_u **fnames;
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
bool ascii = false;
|
||||
|
||||
if (STRNCMP(arg, "-ascii", 6) == 0) {
|
||||
@ -5501,7 +5501,7 @@ static void spell_message(const spellinfo_T *spin, char_u *str)
|
||||
// ":[count]spellrare {word}"
|
||||
void ex_spell(exarg_T *eap)
|
||||
{
|
||||
spell_add_word(eap->arg, (int)STRLEN(eap->arg),
|
||||
spell_add_word((char_u *)eap->arg, (int)STRLEN(eap->arg),
|
||||
eap->cmdidx == CMD_spellwrong ? SPELL_ADD_BAD :
|
||||
eap->cmdidx == CMD_spellrare ? SPELL_ADD_RARE : SPELL_ADD_GOOD,
|
||||
eap->forceit ? 0 : (int)eap->line2,
|
||||
|
@ -3032,10 +3032,10 @@ static keyentry_T *match_keyword(char_u *keyword, hashtab_T *ht, stateitem_T *cu
|
||||
*/
|
||||
static void syn_cmd_conceal(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *next;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3061,10 +3061,10 @@ static void syn_cmd_conceal(exarg_T *eap, int syncing)
|
||||
*/
|
||||
static void syn_cmd_case(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *next;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3088,10 +3088,10 @@ static void syn_cmd_case(exarg_T *eap, int syncing)
|
||||
/// Handle ":syntax foldlevel" command.
|
||||
static void syn_cmd_foldlevel(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *arg_end;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3129,10 +3129,10 @@ static void syn_cmd_foldlevel(exarg_T *eap, int syncing)
|
||||
*/
|
||||
static void syn_cmd_spell(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *next;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3164,7 +3164,7 @@ static void syn_cmd_spell(exarg_T *eap, int syncing)
|
||||
/// Handle ":syntax iskeyword" command.
|
||||
static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u save_chartab[32];
|
||||
char_u *save_isk;
|
||||
|
||||
@ -3336,11 +3336,11 @@ static void syn_clear_cluster(synblock_T *block, int i)
|
||||
*/
|
||||
static void syn_cmd_clear(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *arg_end;
|
||||
int id;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3440,7 +3440,7 @@ static void syn_cmd_on(exarg_T *eap, int syncing)
|
||||
*/
|
||||
static void syn_cmd_reset(exarg_T *eap, int syncing)
|
||||
{
|
||||
eap->nextcmd = check_nextcmd(eap->arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)eap->arg);
|
||||
if (!eap->skip) {
|
||||
init_highlight(true, true);
|
||||
}
|
||||
@ -3465,7 +3465,7 @@ static void syn_cmd_off(exarg_T *eap, int syncing)
|
||||
static void syn_cmd_onoff(exarg_T *eap, char *name)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
eap->nextcmd = check_nextcmd(eap->arg);
|
||||
eap->nextcmd = (char *)check_nextcmd((char_u *)eap->arg);
|
||||
if (!eap->skip) {
|
||||
did_syntax_onoff = true;
|
||||
char buf[100];
|
||||
@ -3479,7 +3479,7 @@ void syn_maybe_enable(void)
|
||||
{
|
||||
if (!did_syntax_onoff) {
|
||||
exarg_T ea;
|
||||
ea.arg = (char_u *)"";
|
||||
ea.arg = "";
|
||||
ea.skip = false;
|
||||
syn_cmd_on(&ea, false);
|
||||
}
|
||||
@ -3490,10 +3490,10 @@ void syn_maybe_enable(void)
|
||||
/// @param syncing when TRUE: list syncing items
|
||||
static void syn_cmd_list(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *arg_end;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -3569,7 +3569,7 @@ static void syn_cmd_list(exarg_T *eap, int syncing)
|
||||
arg = skipwhite(arg_end);
|
||||
}
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(arg);
|
||||
eap->nextcmd = (char *)check_nextcmd(arg);
|
||||
}
|
||||
|
||||
static void syn_lines_msg(void)
|
||||
@ -4261,7 +4261,7 @@ static void syn_incl_toplevel(int id, int *flagsp)
|
||||
*/
|
||||
static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
int sgl_id = 1;
|
||||
char_u *group_name_end;
|
||||
char_u *rest;
|
||||
@ -4270,7 +4270,7 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
int prev_syn_inc_tag;
|
||||
bool source = false;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -4287,7 +4287,7 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
return;
|
||||
}
|
||||
// separate_nextcmd() and expand_filename() depend on this
|
||||
eap->arg = rest;
|
||||
eap->arg = (char *)rest;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4296,7 +4296,7 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
*/
|
||||
eap->argt |= (EX_XFILE | EX_NOSPC);
|
||||
separate_nextcmd(eap);
|
||||
if (*eap->arg == '<' || *eap->arg == '$' || path_is_absolute(eap->arg)) {
|
||||
if (*eap->arg == '<' || *eap->arg == '$' || path_is_absolute((char_u *)eap->arg)) {
|
||||
// For an absolute path, "$VIM/..." or "<sfile>.." we ":source" the
|
||||
// file. Need to expand the file name first. In other cases
|
||||
// ":runtime!" is used.
|
||||
@ -4322,8 +4322,8 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
prev_toplvl_grp = curwin->w_s->b_syn_topgrp;
|
||||
curwin->w_s->b_syn_topgrp = sgl_id;
|
||||
if (source
|
||||
? do_source((char *)eap->arg, false, DOSO_NONE) == FAIL
|
||||
: source_runtime((char *)eap->arg, DIP_ALL) == FAIL) {
|
||||
? do_source(eap->arg, false, DOSO_NONE) == FAIL
|
||||
: source_runtime(eap->arg, DIP_ALL) == FAIL) {
|
||||
semsg(_(e_notopen), eap->arg);
|
||||
}
|
||||
curwin->w_s->b_syn_topgrp = prev_toplvl_grp;
|
||||
@ -4335,7 +4335,7 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
|
||||
*/
|
||||
static void syn_cmd_keyword(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *group_name_end;
|
||||
int syn_id;
|
||||
char_u *rest;
|
||||
@ -4432,7 +4432,7 @@ error:
|
||||
}
|
||||
|
||||
if (rest != NULL) {
|
||||
eap->nextcmd = check_nextcmd(rest);
|
||||
eap->nextcmd = (char *)check_nextcmd(rest);
|
||||
} else {
|
||||
semsg(_(e_invarg2), arg);
|
||||
}
|
||||
@ -4448,7 +4448,7 @@ error:
|
||||
/// @param syncing TRUE for ":syntax sync match .. "
|
||||
static void syn_cmd_match(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *group_name_end;
|
||||
char_u *rest;
|
||||
synpat_T item; // the item found in the line
|
||||
@ -4485,7 +4485,7 @@ static void syn_cmd_match(exarg_T *eap, int syncing)
|
||||
/*
|
||||
* Check for trailing command and illegal trailing arguments.
|
||||
*/
|
||||
eap->nextcmd = check_nextcmd(rest);
|
||||
eap->nextcmd = (char *)check_nextcmd(rest);
|
||||
if (!ends_excmd(*rest) || eap->skip) {
|
||||
rest = NULL;
|
||||
} else {
|
||||
@ -4546,7 +4546,7 @@ static void syn_cmd_match(exarg_T *eap, int syncing)
|
||||
/// @param syncing TRUE for ":syntax sync region .."
|
||||
static void syn_cmd_region(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *group_name_end;
|
||||
char_u *rest; // next arg, NULL on error
|
||||
char_u *key_end;
|
||||
@ -4692,7 +4692,7 @@ static void syn_cmd_region(exarg_T *eap, int syncing)
|
||||
* Check for trailing garbage or command.
|
||||
* If OK, add the item.
|
||||
*/
|
||||
eap->nextcmd = check_nextcmd(rest);
|
||||
eap->nextcmd = (char *)check_nextcmd(rest);
|
||||
if (!ends_excmd(*rest) || eap->skip) {
|
||||
rest = NULL;
|
||||
} else {
|
||||
@ -4990,14 +4990,14 @@ static int syn_add_cluster(char_u *name)
|
||||
*/
|
||||
static void syn_cmd_cluster(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *group_name_end;
|
||||
char_u *rest;
|
||||
bool got_clstr = false;
|
||||
int opt_len;
|
||||
int list_op;
|
||||
|
||||
eap->nextcmd = find_nextcmd(arg);
|
||||
eap->nextcmd = (char *)find_nextcmd(arg);
|
||||
if (eap->skip) {
|
||||
return;
|
||||
}
|
||||
@ -5167,7 +5167,7 @@ static char_u *get_syn_pattern(char_u *arg, synpat_T *ci)
|
||||
*/
|
||||
static void syn_cmd_sync(exarg_T *eap, int syncing)
|
||||
{
|
||||
char_u *arg_start = eap->arg;
|
||||
char_u *arg_start = (char_u *)eap->arg;
|
||||
char_u *arg_end;
|
||||
char_u *key = NULL;
|
||||
char_u *next_arg;
|
||||
@ -5267,7 +5267,7 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
|
||||
}
|
||||
next_arg = skipwhite(arg_end + 1);
|
||||
} else {
|
||||
eap->arg = next_arg;
|
||||
eap->arg = (char *)next_arg;
|
||||
if (STRCMP(key, "MATCH") == 0) {
|
||||
syn_cmd_match(eap, TRUE);
|
||||
} else if (STRCMP(key, "REGION") == 0) {
|
||||
@ -5286,7 +5286,7 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
|
||||
if (illegal) {
|
||||
semsg(_("E404: Illegal arguments: %s"), arg_start);
|
||||
} else if (!finished) {
|
||||
eap->nextcmd = check_nextcmd(arg_start);
|
||||
eap->nextcmd = (char *)check_nextcmd(arg_start);
|
||||
redraw_curbuf_later(SOME_VALID);
|
||||
syn_stack_free_all(curwin->w_s); // Need to recompute all syntax.
|
||||
}
|
||||
@ -5614,10 +5614,10 @@ static struct subcommand subcommands[] =
|
||||
*/
|
||||
void ex_syntax(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *arg = (char_u *)eap->arg;
|
||||
char_u *subcmd_end;
|
||||
|
||||
syn_cmdlinep = eap->cmdlinep;
|
||||
syn_cmdlinep = (char_u **)eap->cmdlinep;
|
||||
|
||||
// isolate subcommand name
|
||||
for (subcmd_end = arg; ASCII_ISALPHA(*subcmd_end); subcmd_end++) {}
|
||||
@ -5631,8 +5631,8 @@ void ex_syntax(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
if (STRCMP(subcmd_name, (char_u *)subcommands[i].name) == 0) {
|
||||
eap->arg = skipwhite(subcmd_end);
|
||||
(subcommands[i].func)(eap, FALSE);
|
||||
eap->arg = (char *)skipwhite(subcmd_end);
|
||||
(subcommands[i].func)(eap, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -5669,7 +5669,7 @@ void ex_ownsyntax(exarg_T *eap)
|
||||
}
|
||||
|
||||
// Apply the "syntax" autocommand event, this finds and loads the syntax file.
|
||||
apply_autocmds(EVENT_SYNTAX, eap->arg, curbuf->b_fname, true, curbuf);
|
||||
apply_autocmds(EVENT_SYNTAX, (char_u *)eap->arg, curbuf->b_fname, true, curbuf);
|
||||
|
||||
// Move value of b:current_syntax to w:current_syntax.
|
||||
new_value = get_var_value("b:current_syntax");
|
||||
@ -5718,7 +5718,7 @@ void reset_expand_highlight(void)
|
||||
void set_context_in_echohl_cmd(expand_T *xp, const char *arg)
|
||||
{
|
||||
xp->xp_context = EXPAND_HIGHLIGHT;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
include_none = 1;
|
||||
}
|
||||
|
||||
@ -5730,7 +5730,7 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
||||
// Default: expand subcommands.
|
||||
xp->xp_context = EXPAND_SYNTAX;
|
||||
expand_what = EXP_SUBCMD;
|
||||
xp->xp_pattern = (char_u *)arg;
|
||||
xp->xp_pattern = (char *)arg;
|
||||
include_link = 0;
|
||||
include_default = 0;
|
||||
|
||||
@ -5738,8 +5738,8 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
||||
if (*arg != NUL) {
|
||||
const char *p = (const char *)skiptowhite((const char_u *)arg);
|
||||
if (*p != NUL) { // Past first word.
|
||||
xp->xp_pattern = skipwhite((const char_u *)p);
|
||||
if (*skiptowhite(xp->xp_pattern) != NUL) {
|
||||
xp->xp_pattern = (char *)skipwhite((const char_u *)p);
|
||||
if (*skiptowhite((char_u *)xp->xp_pattern) != NUL) {
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else if (STRNICMP(arg, "case", p - arg) == 0) {
|
||||
expand_what = EXP_CASE;
|
||||
|
Loading…
Reference in New Issue
Block a user