mirror of
https://github.com/zoriya/vim.git
synced 2025-12-19 21:55:18 +00:00
updated for version 7.2-169
This commit is contained in:
@@ -1,27 +1,32 @@
|
|||||||
" Vim tool: Filter output of splint
|
" Vim tool: Filter output of splint
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2009 May 05
|
" Last Change: 2009 May 13
|
||||||
|
|
||||||
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
|
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
|
||||||
" :call CleanLint()
|
" :call CleanLint()
|
||||||
" This deletes irrelevant messages. What remains might be valid warnings.
|
" This deletes irrelevant messages. What remains might be valid warnings.
|
||||||
|
|
||||||
fun! CleanLint()
|
fun! CleanLint()
|
||||||
g/^ Types are incompatible/lockmarks d
|
|
||||||
g/Assignment of dev_t to __dev_t:/lockmarks d
|
g/Assignment of dev_t to __dev_t:/lockmarks d
|
||||||
g/Assignment of __dev_t to dev_t:/lockmarks d
|
g/Assignment of __dev_t to dev_t:/lockmarks d
|
||||||
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
|
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
|
||||||
g/Operands of == have incompatible types (unsigned int, int): /lockmarks d
|
g/Operands of == have incompatible types (char_u, int): /lockmarks d
|
||||||
g/Assignment of char to char_u: /lockmarks d
|
g/Assignment of char to char_u: /lockmarks d
|
||||||
g/Assignment of unsigned int to int: /lockmarks d
|
g/Assignment of unsigned int to int: /lockmarks d
|
||||||
g/Assignment of colnr_T to int: /lockmarks d
|
g/Assignment of int to unsigned int: /lockmarks d
|
||||||
|
g/Assignment of unsigned int to long int: /lockmarks d
|
||||||
g/Assignment of int to char_u: /lockmarks d
|
g/Assignment of int to char_u: /lockmarks d
|
||||||
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
|
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
|
||||||
g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d
|
g/Function .* expects arg . to be size_t gets int: /lockmarks d
|
||||||
|
g/Initial value of .* is type char, expects char_u: /lockmarks d
|
||||||
|
g/^ex_cmds.h:.* Function types are inconsistent. Parameter 1 is implicitly temp, but unqualified in assigned function:/lockmarks d
|
||||||
|
g/^ex_docmd.c:.* nospec_str/lockmarks d
|
||||||
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
|
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
|
||||||
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
|
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
|
||||||
|
g/^ Types are incompatible/lockmarks d
|
||||||
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
|
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
|
||||||
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
|
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
|
||||||
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
|
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
|
||||||
|
g+ A variable is declared but never used. Use /.@unused@./ in front of declaration to suppress message.+lockmarks d
|
||||||
endfun
|
endfun
|
||||||
|
|||||||
19
src/diff.c
19
src/diff.c
@@ -827,6 +827,7 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
|||||||
char_u *tmp_diff;
|
char_u *tmp_diff;
|
||||||
{
|
{
|
||||||
char_u *cmd;
|
char_u *cmd;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
if (*p_dex != NUL)
|
if (*p_dex != NUL)
|
||||||
@@ -835,8 +836,9 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
cmd = alloc((unsigned)(STRLEN(tmp_orig) + STRLEN(tmp_new)
|
len = STRLEN(tmp_orig) + STRLEN(tmp_new)
|
||||||
+ STRLEN(tmp_diff) + STRLEN(p_srr) + 27));
|
+ STRLEN(tmp_diff) + STRLEN(p_srr) + 27;
|
||||||
|
cmd = alloc((unsigned)len);
|
||||||
if (cmd != NULL)
|
if (cmd != NULL)
|
||||||
{
|
{
|
||||||
/* We don't want $DIFF_OPTIONS to get in the way. */
|
/* We don't want $DIFF_OPTIONS to get in the way. */
|
||||||
@@ -846,7 +848,7 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
|||||||
/* Build the diff command and execute it. Always use -a, binary
|
/* Build the diff command and execute it. Always use -a, binary
|
||||||
* differences are of no use. Ignore errors, diff returns
|
* differences are of no use. Ignore errors, diff returns
|
||||||
* non-zero when differences have been found. */
|
* non-zero when differences have been found. */
|
||||||
sprintf((char *)cmd, "diff %s%s%s%s%s %s",
|
vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
|
||||||
diff_a_works == FALSE ? "" : "-a ",
|
diff_a_works == FALSE ? "" : "-a ",
|
||||||
#if defined(MSWIN) || defined(MSDOS)
|
#if defined(MSWIN) || defined(MSDOS)
|
||||||
diff_bin_works == TRUE ? "--binary " : "",
|
diff_bin_works == TRUE ? "--binary " : "",
|
||||||
@@ -856,7 +858,7 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
|||||||
(diff_flags & DIFF_IWHITE) ? "-b " : "",
|
(diff_flags & DIFF_IWHITE) ? "-b " : "",
|
||||||
(diff_flags & DIFF_ICASE) ? "-i " : "",
|
(diff_flags & DIFF_ICASE) ? "-i " : "",
|
||||||
tmp_orig, tmp_new);
|
tmp_orig, tmp_new);
|
||||||
append_redir(cmd, p_srr, tmp_diff);
|
append_redir(cmd, (int)len, p_srr, tmp_diff);
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
block_autocmds(); /* Avoid ShellCmdPost stuff */
|
block_autocmds(); /* Avoid ShellCmdPost stuff */
|
||||||
#endif
|
#endif
|
||||||
@@ -881,6 +883,7 @@ ex_diffpatch(eap)
|
|||||||
char_u *tmp_orig; /* name of original temp file */
|
char_u *tmp_orig; /* name of original temp file */
|
||||||
char_u *tmp_new; /* name of patched temp file */
|
char_u *tmp_new; /* name of patched temp file */
|
||||||
char_u *buf = NULL;
|
char_u *buf = NULL;
|
||||||
|
size_t buflen;
|
||||||
win_T *old_curwin = curwin;
|
win_T *old_curwin = curwin;
|
||||||
char_u *newname = NULL; /* name of patched file buffer */
|
char_u *newname = NULL; /* name of patched file buffer */
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
@@ -920,11 +923,12 @@ ex_diffpatch(eap)
|
|||||||
/* Get the absolute path of the patchfile, changing directory below. */
|
/* Get the absolute path of the patchfile, changing directory below. */
|
||||||
fullname = FullName_save(eap->arg, FALSE);
|
fullname = FullName_save(eap->arg, FALSE);
|
||||||
#endif
|
#endif
|
||||||
buf = alloc((unsigned)(STRLEN(tmp_orig) + (
|
buflen = STRLEN(tmp_orig) + (
|
||||||
# ifdef UNIX
|
# ifdef UNIX
|
||||||
fullname != NULL ? STRLEN(fullname) :
|
fullname != NULL ? STRLEN(fullname) :
|
||||||
# endif
|
# endif
|
||||||
STRLEN(eap->arg)) + STRLEN(tmp_new) + 16));
|
STRLEN(eap->arg)) + STRLEN(tmp_new) + 16;
|
||||||
|
buf = alloc((unsigned)buflen);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
|
||||||
@@ -961,7 +965,8 @@ ex_diffpatch(eap)
|
|||||||
{
|
{
|
||||||
/* Build the patch command and execute it. Ignore errors. Switch to
|
/* Build the patch command and execute it. Ignore errors. Switch to
|
||||||
* cooked mode to allow the user to respond to prompts. */
|
* cooked mode to allow the user to respond to prompts. */
|
||||||
sprintf((char *)buf, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig,
|
vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
|
||||||
|
tmp_new, tmp_orig,
|
||||||
# ifdef UNIX
|
# ifdef UNIX
|
||||||
fullname != NULL ? fullname :
|
fullname != NULL ? fullname :
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
47
src/edit.c
47
src/edit.c
@@ -169,7 +169,7 @@ static int ins_compl_pum_key __ARGS((int c));
|
|||||||
static int ins_compl_key2count __ARGS((int c));
|
static int ins_compl_key2count __ARGS((int c));
|
||||||
static int ins_compl_use_match __ARGS((int c));
|
static int ins_compl_use_match __ARGS((int c));
|
||||||
static int ins_complete __ARGS((int c));
|
static int ins_complete __ARGS((int c));
|
||||||
static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
|
static unsigned quote_meta __ARGS((char_u *dest, char_u *str, int len));
|
||||||
#endif /* FEAT_INS_EXPAND */
|
#endif /* FEAT_INS_EXPAND */
|
||||||
|
|
||||||
#define BACKSPACE_CHAR 1
|
#define BACKSPACE_CHAR 1
|
||||||
@@ -757,7 +757,7 @@ edit(cmdchar, startln, count)
|
|||||||
* there is nothing to add, CTRL-L works like CTRL-P then. */
|
* there is nothing to add, CTRL-L works like CTRL-P then. */
|
||||||
if (c == Ctrl_L
|
if (c == Ctrl_L
|
||||||
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
|
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
|
||||||
|| STRLEN(compl_shown_match->cp_str)
|
|| (int)STRLEN(compl_shown_match->cp_str)
|
||||||
> curwin->w_cursor.col - compl_col))
|
> curwin->w_cursor.col - compl_col))
|
||||||
{
|
{
|
||||||
ins_compl_addfrommatch();
|
ins_compl_addfrommatch();
|
||||||
@@ -3837,7 +3837,11 @@ ins_compl_add_tv(tv, dir)
|
|||||||
char_u *word;
|
char_u *word;
|
||||||
int icase = FALSE;
|
int icase = FALSE;
|
||||||
int adup = FALSE;
|
int adup = FALSE;
|
||||||
|
#ifdef S_SPLINT_S /* splint doesn't parse array of pointers correctly */
|
||||||
|
char_u **cptext;
|
||||||
|
#else
|
||||||
char_u *(cptext[CPT_COUNT]);
|
char_u *(cptext[CPT_COUNT]);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
|
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
|
||||||
{
|
{
|
||||||
@@ -3994,7 +3998,7 @@ ins_compl_get_exp(ini)
|
|||||||
else if (*e_cpt == ']' || *e_cpt == 't')
|
else if (*e_cpt == ']' || *e_cpt == 't')
|
||||||
{
|
{
|
||||||
type = CTRL_X_TAGS;
|
type = CTRL_X_TAGS;
|
||||||
sprintf((char*)IObuff, _("Scanning tags."));
|
vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
|
||||||
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
|
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -4093,7 +4097,7 @@ ins_compl_get_exp(ini)
|
|||||||
case CTRL_X_SPELL:
|
case CTRL_X_SPELL:
|
||||||
#ifdef FEAT_SPELL
|
#ifdef FEAT_SPELL
|
||||||
num_matches = expand_spelling(first_match_pos.lnum,
|
num_matches = expand_spelling(first_match_pos.lnum,
|
||||||
first_match_pos.col, compl_pattern, &matches);
|
compl_pattern, &matches);
|
||||||
if (num_matches > 0)
|
if (num_matches > 0)
|
||||||
ins_compl_add_matches(num_matches, matches, p_ic);
|
ins_compl_add_matches(num_matches, matches, p_ic);
|
||||||
#endif
|
#endif
|
||||||
@@ -4803,10 +4807,9 @@ ins_complete(c)
|
|||||||
{
|
{
|
||||||
char_u *prefix = (char_u *)"\\<";
|
char_u *prefix = (char_u *)"\\<";
|
||||||
|
|
||||||
/* we need 3 extra chars, 1 for the NUL and
|
/* we need up to 2 extra chars for the prefix */
|
||||||
* 2 >= strlen(prefix) -- Acevedo */
|
|
||||||
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
||||||
compl_length) + 3);
|
compl_length) + 2);
|
||||||
if (compl_pattern == NULL)
|
if (compl_pattern == NULL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
if (!vim_iswordp(line + compl_col)
|
if (!vim_iswordp(line + compl_col)
|
||||||
@@ -4881,7 +4884,7 @@ ins_complete(c)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
||||||
compl_length) + 3);
|
compl_length) + 2);
|
||||||
if (compl_pattern == NULL)
|
if (compl_pattern == NULL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
STRCPY((char *)compl_pattern, "\\<");
|
STRCPY((char *)compl_pattern, "\\<");
|
||||||
@@ -4963,7 +4966,7 @@ ins_complete(c)
|
|||||||
if (col < 0)
|
if (col < 0)
|
||||||
col = curs_col;
|
col = curs_col;
|
||||||
compl_col = col;
|
compl_col = col;
|
||||||
if ((colnr_T)compl_col > curs_col)
|
if (compl_col > curs_col)
|
||||||
compl_col = curs_col;
|
compl_col = curs_col;
|
||||||
|
|
||||||
/* Setup variables for completion. Need to obtain "line" again,
|
/* Setup variables for completion. Need to obtain "line" again,
|
||||||
@@ -5236,15 +5239,15 @@ ins_complete(c)
|
|||||||
* a backslash) the metachars, and dest would be NUL terminated.
|
* a backslash) the metachars, and dest would be NUL terminated.
|
||||||
* Returns the length (needed) of dest
|
* Returns the length (needed) of dest
|
||||||
*/
|
*/
|
||||||
static int
|
static unsigned
|
||||||
quote_meta(dest, src, len)
|
quote_meta(dest, src, len)
|
||||||
char_u *dest;
|
char_u *dest;
|
||||||
char_u *src;
|
char_u *src;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
int m;
|
unsigned m = (unsigned)len + 1; /* one extra for the NUL */
|
||||||
|
|
||||||
for (m = len; --len >= 0; src++)
|
for ( ; --len >= 0; src++)
|
||||||
{
|
{
|
||||||
switch (*src)
|
switch (*src)
|
||||||
{
|
{
|
||||||
@@ -6073,7 +6076,7 @@ auto_format(trailblank, prev_line)
|
|||||||
* in 'formatoptions' and there is a single character before the cursor.
|
* in 'formatoptions' and there is a single character before the cursor.
|
||||||
* Otherwise the line would be broken and when typing another non-white
|
* Otherwise the line would be broken and when typing another non-white
|
||||||
* next they are not joined back together. */
|
* next they are not joined back together. */
|
||||||
wasatend = (pos.col == STRLEN(old));
|
wasatend = (pos.col == (colnr_T)STRLEN(old));
|
||||||
if (*old != NUL && !trailblank && wasatend)
|
if (*old != NUL && !trailblank && wasatend)
|
||||||
{
|
{
|
||||||
dec_cursor();
|
dec_cursor();
|
||||||
@@ -6250,7 +6253,7 @@ redo_literal(c)
|
|||||||
* three digits. */
|
* three digits. */
|
||||||
if (VIM_ISDIGIT(c))
|
if (VIM_ISDIGIT(c))
|
||||||
{
|
{
|
||||||
sprintf((char *)buf, "%03d", c);
|
vim_snprintf((char *)buf, sizeof(buf), "%03d", c);
|
||||||
AppendToRedobuff(buf);
|
AppendToRedobuff(buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -6453,10 +6456,11 @@ stop_insert(end_insert_pos, esc)
|
|||||||
* deleted characters. */
|
* deleted characters. */
|
||||||
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
|
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
|
||||||
{
|
{
|
||||||
cc = (int)STRLEN(ml_get_curline());
|
int len = (int)STRLEN(ml_get_curline());
|
||||||
if (VIsual.col > (colnr_T)cc)
|
|
||||||
|
if (VIsual.col > len)
|
||||||
{
|
{
|
||||||
VIsual.col = cc;
|
VIsual.col = len;
|
||||||
# ifdef FEAT_VIRTUALEDIT
|
# ifdef FEAT_VIRTUALEDIT
|
||||||
VIsual.coladd = 0;
|
VIsual.coladd = 0;
|
||||||
# endif
|
# endif
|
||||||
@@ -8315,6 +8319,7 @@ ins_bs(c, mode, inserted_space_p)
|
|||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int cc;
|
int cc;
|
||||||
int temp = 0; /* init for GCC */
|
int temp = 0; /* init for GCC */
|
||||||
|
colnr_T save_col;
|
||||||
colnr_T mincol;
|
colnr_T mincol;
|
||||||
int did_backspace = FALSE;
|
int did_backspace = FALSE;
|
||||||
int in_indent;
|
int in_indent;
|
||||||
@@ -8472,13 +8477,13 @@ ins_bs(c, mode, inserted_space_p)
|
|||||||
*/
|
*/
|
||||||
while (cc > 0)
|
while (cc > 0)
|
||||||
{
|
{
|
||||||
temp = curwin->w_cursor.col;
|
save_col = curwin->w_cursor.col;
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
mb_replace_pop_ins(cc);
|
mb_replace_pop_ins(cc);
|
||||||
#else
|
#else
|
||||||
ins_char(cc);
|
ins_char(cc);
|
||||||
#endif
|
#endif
|
||||||
curwin->w_cursor.col = temp;
|
curwin->w_cursor.col = save_col;
|
||||||
cc = replace_pop();
|
cc = replace_pop();
|
||||||
}
|
}
|
||||||
/* restore the characters that NL replaced */
|
/* restore the characters that NL replaced */
|
||||||
@@ -8510,11 +8515,11 @@ ins_bs(c, mode, inserted_space_p)
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
temp = curwin->w_cursor.col;
|
save_col = curwin->w_cursor.col;
|
||||||
beginline(BL_WHITE);
|
beginline(BL_WHITE);
|
||||||
if (curwin->w_cursor.col < (colnr_T)temp)
|
if (curwin->w_cursor.col < (colnr_T)temp)
|
||||||
mincol = curwin->w_cursor.col;
|
mincol = curwin->w_cursor.col;
|
||||||
curwin->w_cursor.col = temp;
|
curwin->w_cursor.col = save_col;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -87,13 +87,14 @@ do_ascii(eap)
|
|||||||
))
|
))
|
||||||
{
|
{
|
||||||
transchar_nonprint(buf3, c);
|
transchar_nonprint(buf3, c);
|
||||||
sprintf(buf1, " <%s>", (char *)buf3);
|
vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
buf1[0] = NUL;
|
buf1[0] = NUL;
|
||||||
#ifndef EBCDIC
|
#ifndef EBCDIC
|
||||||
if (c >= 0x80)
|
if (c >= 0x80)
|
||||||
sprintf(buf2, " <M-%s>", transchar(c & 0x7f));
|
vim_snprintf(buf2, sizeof(buf2), " <M-%s>",
|
||||||
|
(char *)transchar(c & 0x7f));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
buf2[0] = NUL;
|
buf2[0] = NUL;
|
||||||
@@ -358,7 +359,7 @@ ex_sort(eap)
|
|||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
long maxlen = 0;
|
long maxlen = 0;
|
||||||
sorti_T *nrs;
|
sorti_T *nrs;
|
||||||
size_t count = eap->line2 - eap->line1 + 1;
|
size_t count = (size_t)(eap->line2 - eap->line1 + 1);
|
||||||
size_t i;
|
size_t i;
|
||||||
char_u *p;
|
char_u *p;
|
||||||
char_u *s;
|
char_u *s;
|
||||||
@@ -957,7 +958,7 @@ do_bang(addr_count, eap, forceit, do_in, do_out)
|
|||||||
}
|
}
|
||||||
len += (int)STRLEN(prevcmd);
|
len += (int)STRLEN(prevcmd);
|
||||||
}
|
}
|
||||||
if ((t = alloc(len)) == NULL)
|
if ((t = alloc((unsigned)len)) == NULL)
|
||||||
{
|
{
|
||||||
vim_free(newcmd);
|
vim_free(newcmd);
|
||||||
return;
|
return;
|
||||||
@@ -1548,7 +1549,7 @@ make_filter_cmd(cmd, itmp, otmp)
|
|||||||
* redirecting input and/or output.
|
* redirecting input and/or output.
|
||||||
*/
|
*/
|
||||||
if (itmp != NULL || otmp != NULL)
|
if (itmp != NULL || otmp != NULL)
|
||||||
sprintf((char *)buf, "(%s)", (char *)cmd);
|
vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
|
||||||
else
|
else
|
||||||
STRCPY(buf, cmd);
|
STRCPY(buf, cmd);
|
||||||
if (itmp != NULL)
|
if (itmp != NULL)
|
||||||
@@ -1597,37 +1598,41 @@ make_filter_cmd(cmd, itmp, otmp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (otmp != NULL)
|
if (otmp != NULL)
|
||||||
append_redir(buf, p_srr, otmp);
|
append_redir(buf, (int)len, p_srr, otmp);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Append output redirection for file "fname" to the end of string buffer "buf"
|
* Append output redirection for file "fname" to the end of string buffer
|
||||||
|
* "buf[buflen]"
|
||||||
* Works with the 'shellredir' and 'shellpipe' options.
|
* Works with the 'shellredir' and 'shellpipe' options.
|
||||||
* The caller should make sure that there is enough room:
|
* The caller should make sure that there is enough room:
|
||||||
* STRLEN(opt) + STRLEN(fname) + 3
|
* STRLEN(opt) + STRLEN(fname) + 3
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
append_redir(buf, opt, fname)
|
append_redir(buf, buflen, opt, fname)
|
||||||
char_u *buf;
|
char_u *buf;
|
||||||
|
int buflen;
|
||||||
char_u *opt;
|
char_u *opt;
|
||||||
char_u *fname;
|
char_u *fname;
|
||||||
{
|
{
|
||||||
char_u *p;
|
char_u *p;
|
||||||
|
char_u *end;
|
||||||
|
|
||||||
buf += STRLEN(buf);
|
end = buf + STRLEN(buf);
|
||||||
/* find "%s", skipping "%%" */
|
/* find "%s", skipping "%%" */
|
||||||
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
|
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
|
||||||
if (p[1] == 's')
|
if (p[1] == 's')
|
||||||
break;
|
break;
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
*buf = ' '; /* not really needed? Not with sh, ksh or bash */
|
*end = ' '; /* not really needed? Not with sh, ksh or bash */
|
||||||
sprintf((char *)buf + 1, (char *)opt, (char *)fname);
|
vim_snprintf((char *)end + 1, (size_t)(buflen - (end + 1 - buf)),
|
||||||
|
(char *)opt, (char *)fname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf((char *)buf,
|
vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
# ifndef RISCOS
|
# ifndef RISCOS
|
||||||
opt != p_sp ? " %s%s" :
|
opt != p_sp ? " %s%s" :
|
||||||
@@ -2390,7 +2395,8 @@ print_line_no_prefix(lnum, use_number, list)
|
|||||||
|
|
||||||
if (curwin->w_p_nu || use_number)
|
if (curwin->w_p_nu || use_number)
|
||||||
{
|
{
|
||||||
sprintf((char *)numbuf, "%*ld ", number_width(curwin), (long)lnum);
|
vim_snprintf((char *)numbuf, sizeof(numbuf),
|
||||||
|
"%*ld ", number_width(curwin), (long)lnum);
|
||||||
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
|
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
|
||||||
}
|
}
|
||||||
msg_prt_line(ml_get(lnum), list);
|
msg_prt_line(ml_get(lnum), list);
|
||||||
@@ -4486,7 +4492,7 @@ do_sub(eap)
|
|||||||
char_u *p1;
|
char_u *p1;
|
||||||
int did_sub = FALSE;
|
int did_sub = FALSE;
|
||||||
int lastone;
|
int lastone;
|
||||||
unsigned len, needed_len;
|
int len, copy_len, needed_len;
|
||||||
long nmatch_tl = 0; /* nr of lines matched below lnum */
|
long nmatch_tl = 0; /* nr of lines matched below lnum */
|
||||||
int do_again; /* do it again after joining lines */
|
int do_again; /* do it again after joining lines */
|
||||||
int skip_match = FALSE;
|
int skip_match = FALSE;
|
||||||
@@ -4631,6 +4637,8 @@ do_sub(eap)
|
|||||||
|
|
||||||
if (do_ask)
|
if (do_ask)
|
||||||
{
|
{
|
||||||
|
int typed;
|
||||||
|
|
||||||
/* change State to CONFIRM, so that the mouse works
|
/* change State to CONFIRM, so that the mouse works
|
||||||
* properly */
|
* properly */
|
||||||
save_State = State;
|
save_State = State;
|
||||||
@@ -4669,7 +4677,7 @@ do_sub(eap)
|
|||||||
resp = getexmodeline('?', NULL, 0);
|
resp = getexmodeline('?', NULL, 0);
|
||||||
if (resp != NULL)
|
if (resp != NULL)
|
||||||
{
|
{
|
||||||
i = *resp;
|
typed = *resp;
|
||||||
vim_free(resp);
|
vim_free(resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4721,7 +4729,7 @@ do_sub(eap)
|
|||||||
#endif
|
#endif
|
||||||
++no_mapping; /* don't map this key */
|
++no_mapping; /* don't map this key */
|
||||||
++allow_keys; /* allow special keys */
|
++allow_keys; /* allow special keys */
|
||||||
i = plain_vgetc();
|
typed = plain_vgetc();
|
||||||
--allow_keys;
|
--allow_keys;
|
||||||
--no_mapping;
|
--no_mapping;
|
||||||
|
|
||||||
@@ -4732,35 +4740,35 @@ do_sub(eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
need_wait_return = FALSE; /* no hit-return prompt */
|
need_wait_return = FALSE; /* no hit-return prompt */
|
||||||
if (i == 'q' || i == ESC || i == Ctrl_C
|
if (typed == 'q' || typed == ESC || typed == Ctrl_C
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
|| i == intr_char
|
|| typed == intr_char
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
got_quit = TRUE;
|
got_quit = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == 'n')
|
if (typed == 'n')
|
||||||
break;
|
break;
|
||||||
if (i == 'y')
|
if (typed == 'y')
|
||||||
break;
|
break;
|
||||||
if (i == 'l')
|
if (typed == 'l')
|
||||||
{
|
{
|
||||||
/* last: replace and then stop */
|
/* last: replace and then stop */
|
||||||
do_all = FALSE;
|
do_all = FALSE;
|
||||||
line2 = lnum;
|
line2 = lnum;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == 'a')
|
if (typed == 'a')
|
||||||
{
|
{
|
||||||
do_ask = FALSE;
|
do_ask = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_INS_EXPAND
|
#ifdef FEAT_INS_EXPAND
|
||||||
if (i == Ctrl_E)
|
if (typed == Ctrl_E)
|
||||||
scrollup_clamp();
|
scrollup_clamp();
|
||||||
else if (i == Ctrl_Y)
|
else if (typed == Ctrl_Y)
|
||||||
scrolldown_clamp();
|
scrolldown_clamp();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -4771,7 +4779,7 @@ do_sub(eap)
|
|||||||
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
|
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
|
||||||
--no_u_sync;
|
--no_u_sync;
|
||||||
|
|
||||||
if (i == 'n')
|
if (typed == 'n')
|
||||||
{
|
{
|
||||||
/* For a multi-line match, put matchcol at the NUL at
|
/* For a multi-line match, put matchcol at the NUL at
|
||||||
* the end of the line and set nmatch to one, so that
|
* the end of the line and set nmatch to one, so that
|
||||||
@@ -4822,9 +4830,9 @@ do_sub(eap)
|
|||||||
p1 = ml_get(sub_firstlnum + nmatch - 1);
|
p1 = ml_get(sub_firstlnum + nmatch - 1);
|
||||||
nmatch_tl += nmatch - 1;
|
nmatch_tl += nmatch - 1;
|
||||||
}
|
}
|
||||||
i = regmatch.startpos[0].col - copycol;
|
copy_len = regmatch.startpos[0].col - copycol;
|
||||||
needed_len = i + ((unsigned)STRLEN(p1) - regmatch.endpos[0].col)
|
needed_len = copy_len + ((unsigned)STRLEN(p1)
|
||||||
+ sublen + 1;
|
- regmatch.endpos[0].col) + sublen + 1;
|
||||||
if (new_start == NULL)
|
if (new_start == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -4847,7 +4855,7 @@ do_sub(eap)
|
|||||||
*/
|
*/
|
||||||
len = (unsigned)STRLEN(new_start);
|
len = (unsigned)STRLEN(new_start);
|
||||||
needed_len += len;
|
needed_len += len;
|
||||||
if (needed_len > new_start_len)
|
if (needed_len > (int)new_start_len)
|
||||||
{
|
{
|
||||||
new_start_len = needed_len + 50;
|
new_start_len = needed_len + 50;
|
||||||
if ((p1 = alloc_check(new_start_len)) == NULL)
|
if ((p1 = alloc_check(new_start_len)) == NULL)
|
||||||
@@ -4865,8 +4873,8 @@ do_sub(eap)
|
|||||||
/*
|
/*
|
||||||
* copy the text up to the part that matched
|
* copy the text up to the part that matched
|
||||||
*/
|
*/
|
||||||
mch_memmove(new_end, sub_firstline + copycol, (size_t)i);
|
mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
|
||||||
new_end += i;
|
new_end += copy_len;
|
||||||
|
|
||||||
(void)vim_regsub_multi(®match,
|
(void)vim_regsub_multi(®match,
|
||||||
sub_firstlnum - regmatch.startpos[0].lnum,
|
sub_firstlnum - regmatch.startpos[0].lnum,
|
||||||
@@ -5768,6 +5776,10 @@ find_help_tags(arg, num_matches, matches, keep_lang)
|
|||||||
{
|
{
|
||||||
char_u *s, *d;
|
char_u *s, *d;
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
|
||||||
|
static char **mtable;
|
||||||
|
static char **rtable;
|
||||||
|
#else
|
||||||
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
|
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
|
||||||
"/*", "/\\*", "\"*", "**",
|
"/*", "/\\*", "\"*", "**",
|
||||||
"/\\(\\)",
|
"/\\(\\)",
|
||||||
@@ -5782,6 +5794,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
|
|||||||
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
|
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
|
||||||
"\\[count]", "\\[quotex]", "\\[range]",
|
"\\[count]", "\\[quotex]", "\\[range]",
|
||||||
"\\[pattern]", "\\\\bar", "/\\\\%\\$"};
|
"\\[pattern]", "\\\\bar", "/\\\\%\\$"};
|
||||||
|
#endif
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
d = IObuff; /* assume IObuff is long enough! */
|
d = IObuff; /* assume IObuff is long enough! */
|
||||||
@@ -5790,7 +5803,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
|
|||||||
* Recognize a few exceptions to the rule. Some strings that contain '*'
|
* Recognize a few exceptions to the rule. Some strings that contain '*'
|
||||||
* with "star". Otherwise '*' is recognized as a wildcard.
|
* with "star". Otherwise '*' is recognized as a wildcard.
|
||||||
*/
|
*/
|
||||||
for (i = sizeof(mtable) / sizeof(char *); --i >= 0; )
|
for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
|
||||||
if (STRCMP(arg, mtable[i]) == 0)
|
if (STRCMP(arg, mtable[i]) == 0)
|
||||||
{
|
{
|
||||||
STRCPY(d, rtable[i]);
|
STRCPY(d, rtable[i]);
|
||||||
|
|||||||
@@ -3373,7 +3373,7 @@ getsourceline(c, cookie, indent)
|
|||||||
p = skipwhite(sp->nextline);
|
p = skipwhite(sp->nextline);
|
||||||
if (*p != '\\')
|
if (*p != '\\')
|
||||||
break;
|
break;
|
||||||
s = alloc((int)(STRLEN(line) + STRLEN(p)));
|
s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
|
||||||
if (s == NULL) /* out of memory */
|
if (s == NULL) /* out of memory */
|
||||||
break;
|
break;
|
||||||
STRCPY(s, line);
|
STRCPY(s, line);
|
||||||
|
|||||||
@@ -2737,7 +2737,7 @@ checkforcmd(pp, cmd, len)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; cmd[i] != NUL; ++i)
|
for (i = 0; cmd[i] != NUL; ++i)
|
||||||
if (cmd[i] != (*pp)[i])
|
if (((char_u *)cmd)[i] != (*pp)[i])
|
||||||
break;
|
break;
|
||||||
if (i >= len && !isalpha((*pp)[i]))
|
if (i >= len && !isalpha((*pp)[i]))
|
||||||
{
|
{
|
||||||
@@ -2803,7 +2803,7 @@ find_command(eap, full)
|
|||||||
/* Check for ":dl", ":dell", etc. to ":deletel": that's
|
/* Check for ":dl", ":dell", etc. to ":deletel": that's
|
||||||
* :delete with the 'l' flag. Same for 'p'. */
|
* :delete with the 'l' flag. Same for 'p'. */
|
||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
if (eap->cmd[i] != "delete"[i])
|
if (eap->cmd[i] != ((char_u *)"delete")[i])
|
||||||
break;
|
break;
|
||||||
if (i == len - 1)
|
if (i == len - 1)
|
||||||
{
|
{
|
||||||
@@ -3823,7 +3823,7 @@ skip_range(cmd, ctx)
|
|||||||
char_u *cmd;
|
char_u *cmd;
|
||||||
int *ctx; /* pointer to xp_context or NULL */
|
int *ctx; /* pointer to xp_context or NULL */
|
||||||
{
|
{
|
||||||
int delim;
|
unsigned delim;
|
||||||
|
|
||||||
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
|
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
|
||||||
{
|
{
|
||||||
@@ -9417,7 +9417,13 @@ find_cmdline_var(src, usedlen)
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
static char *(spec_str[]) = {
|
#ifdef S_SPLINT_S /* splint can't handle array of pointers */
|
||||||
|
static char **spec_str;
|
||||||
|
static char *(nospec_str[])
|
||||||
|
#else
|
||||||
|
static char *(spec_str[])
|
||||||
|
#endif
|
||||||
|
= {
|
||||||
"%",
|
"%",
|
||||||
#define SPEC_PERC 0
|
#define SPEC_PERC 0
|
||||||
"#",
|
"#",
|
||||||
@@ -9443,9 +9449,8 @@ find_cmdline_var(src, usedlen)
|
|||||||
# define SPEC_CLIENT 9
|
# define SPEC_CLIENT 9
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
|
|
||||||
|
|
||||||
for (i = 0; i < SPEC_COUNT; ++i)
|
for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i)
|
||||||
{
|
{
|
||||||
len = (int)STRLEN(spec_str[i]);
|
len = (int)STRLEN(spec_str[i]);
|
||||||
if (STRNCMP(src, spec_str[i], len) == 0)
|
if (STRNCMP(src, spec_str[i], len) == 0)
|
||||||
@@ -9796,7 +9801,7 @@ arg_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* allocate memory */
|
/* allocate memory */
|
||||||
retval = alloc(len + 1);
|
retval = alloc((unsigned)len + 1);
|
||||||
if (retval == NULL)
|
if (retval == NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ void free_prev_shellcmd __ARGS((void));
|
|||||||
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
|
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
|
||||||
void do_shell __ARGS((char_u *cmd, int flags));
|
void do_shell __ARGS((char_u *cmd, int flags));
|
||||||
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
|
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
|
||||||
void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
|
void append_redir __ARGS((char_u *buf, int buflen, char_u *opt, char_u *fname));
|
||||||
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
|
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
|
||||||
int read_viminfo __ARGS((char_u *file, int flags));
|
int read_viminfo __ARGS((char_u *file, int flags));
|
||||||
void write_viminfo __ARGS((char_u *file, int forceit));
|
void write_viminfo __ARGS((char_u *file, int forceit));
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ void spell_dump_compl __ARGS((buf_T *buf, char_u *pat, int ic, int *dir, int dum
|
|||||||
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
|
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
|
||||||
int spell_word_start __ARGS((int startcol));
|
int spell_word_start __ARGS((int startcol));
|
||||||
void spell_expand_check_cap __ARGS((colnr_T col));
|
void spell_expand_check_cap __ARGS((colnr_T col));
|
||||||
int expand_spelling __ARGS((linenr_T lnum, int col, char_u *pat, char_u ***matchp));
|
int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp));
|
||||||
/* vim: set ft=c : */
|
/* vim: set ft=c : */
|
||||||
|
|||||||
@@ -2774,7 +2774,7 @@ ex_make(eap)
|
|||||||
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
|
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
|
||||||
(char *)p_shq);
|
(char *)p_shq);
|
||||||
if (*p_sp != NUL)
|
if (*p_sp != NUL)
|
||||||
append_redir(cmd, p_sp, fname);
|
append_redir(cmd, len, p_sp, fname);
|
||||||
/*
|
/*
|
||||||
* Output a newline if there's something else than the :make command that
|
* Output a newline if there's something else than the :make command that
|
||||||
* was typed (in which case the cursor is in column 0).
|
* was typed (in which case the cursor is in column 0).
|
||||||
|
|||||||
@@ -16151,11 +16151,9 @@ spell_expand_check_cap(col)
|
|||||||
* Returns the number of matches. The matches are in "matchp[]", array of
|
* Returns the number of matches. The matches are in "matchp[]", array of
|
||||||
* allocated strings.
|
* allocated strings.
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
expand_spelling(lnum, col, pat, matchp)
|
expand_spelling(lnum, pat, matchp)
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int col;
|
|
||||||
char_u *pat;
|
char_u *pat;
|
||||||
char_u ***matchp;
|
char_u ***matchp;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
#if defined(SASC) && SASC < 658
|
#if defined(SASC) && SASC < 658
|
||||||
typedef long linenr_T;
|
typedef long linenr_T;
|
||||||
typedef unsigned colnr_T;
|
typedef int colnr_T;
|
||||||
typedef unsigned short short_u;
|
typedef unsigned short short_u;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ enum SpecialKey
|
|||||||
* - there should be code in term.c to obtain the value from the termcap
|
* - there should be code in term.c to obtain the value from the termcap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
|
||||||
|
extern char_u **term_strings; /* current terminal strings */
|
||||||
|
#else
|
||||||
extern char_u *(term_strings[]); /* current terminal strings */
|
extern char_u *(term_strings[]); /* current terminal strings */
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* strings used for terminal
|
* strings used for terminal
|
||||||
|
|||||||
@@ -676,6 +676,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
169,
|
||||||
/**/
|
/**/
|
||||||
168,
|
168,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
@@ -1461,7 +1461,7 @@ typedef enum
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef long linenr_T; /* line number type */
|
typedef long linenr_T; /* line number type */
|
||||||
typedef unsigned colnr_T; /* column number type */
|
typedef int colnr_T; /* column number type */
|
||||||
typedef unsigned short disptick_T; /* display tick type */
|
typedef unsigned short disptick_T; /* display tick type */
|
||||||
|
|
||||||
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
||||||
|
|||||||
Reference in New Issue
Block a user