mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 7.4.1819
Problem: Compiler warnings when sprintf() is a macro. Solution: Don't interrupt sprintf() with an #ifdef. (Michael Jarvis, closes #788)
This commit is contained in:
16
src/fileio.c
16
src/fileio.c
@@ -5230,14 +5230,14 @@ msg_add_lines(
|
|||||||
if (insert_space)
|
if (insert_space)
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
if (shortmess(SHM_LINES))
|
if (shortmess(SHM_LINES))
|
||||||
sprintf((char *)p,
|
|
||||||
#ifdef LONG_LONG_OFF_T
|
#ifdef LONG_LONG_OFF_T
|
||||||
"%ldL, %lldC", lnum, (long long)nchars
|
sprintf((char *)p,
|
||||||
|
"%ldL, %lldC", lnum, (long long)nchars);
|
||||||
#else
|
#else
|
||||||
|
sprintf((char *)p,
|
||||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||||
"%ldL, %ldC", lnum, (long)nchars
|
"%ldL, %ldC", lnum, (long)nchars);
|
||||||
#endif
|
#endif
|
||||||
);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lnum == 1)
|
if (lnum == 1)
|
||||||
@@ -5248,14 +5248,14 @@ msg_add_lines(
|
|||||||
if (nchars == 1)
|
if (nchars == 1)
|
||||||
STRCPY(p, _("1 character"));
|
STRCPY(p, _("1 character"));
|
||||||
else
|
else
|
||||||
sprintf((char *)p,
|
|
||||||
#ifdef LONG_LONG_OFF_T
|
#ifdef LONG_LONG_OFF_T
|
||||||
_("%lld characters"), (long long)nchars
|
sprintf((char *)p,
|
||||||
|
_("%lld characters"), (long long)nchars);
|
||||||
#else
|
#else
|
||||||
|
sprintf((char *)p,
|
||||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||||
_("%ld characters"), (long)nchars
|
_("%ld characters"), (long)nchars);
|
||||||
#endif
|
#endif
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
src/tag.c
12
src/tag.c
@@ -2264,6 +2264,7 @@ parse_line:
|
|||||||
if (ga_grow(&ga_match[mtt], 1) == OK)
|
if (ga_grow(&ga_match[mtt], 1) == OK)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
int heuristic;
|
||||||
|
|
||||||
if (help_only)
|
if (help_only)
|
||||||
{
|
{
|
||||||
@@ -2293,13 +2294,14 @@ parse_line:
|
|||||||
p[len] = '@';
|
p[len] = '@';
|
||||||
STRCPY(p + len + 1, help_lang);
|
STRCPY(p + len + 1, help_lang);
|
||||||
#endif
|
#endif
|
||||||
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
|
||||||
help_heuristic(tagp.tagname,
|
heuristic = help_heuristic(tagp.tagname,
|
||||||
match_re ? matchoff : 0, !match_no_ic)
|
match_re ? matchoff : 0, !match_no_ic);
|
||||||
#ifdef FEAT_MULTI_LANG
|
#ifdef FEAT_MULTI_LANG
|
||||||
+ help_pri
|
heuristic += help_pri;
|
||||||
#endif
|
#endif
|
||||||
);
|
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
||||||
|
heuristic);
|
||||||
}
|
}
|
||||||
*tagp.tagname_end = TAB;
|
*tagp.tagname_end = TAB;
|
||||||
}
|
}
|
||||||
|
@@ -2630,12 +2630,12 @@ term_color(char_u *s, int n)
|
|||||||
|| STRCMP(s + i + 1, "%dm") == 0)
|
|| STRCMP(s + i + 1, "%dm") == 0)
|
||||||
&& (s[i] == '3' || s[i] == '4'))
|
&& (s[i] == '3' || s[i] == '4'))
|
||||||
{
|
{
|
||||||
sprintf(buf,
|
|
||||||
#ifdef TERMINFO
|
#ifdef TERMINFO
|
||||||
"%s%s%%p1%%dm",
|
char *format = "%s%s%%p1%%dm";
|
||||||
#else
|
#else
|
||||||
"%s%s%%dm",
|
char *format = "%s%s%%dm";
|
||||||
#endif
|
#endif
|
||||||
|
sprintf(buf, format,
|
||||||
i == 2 ? IF_EB("\033[", ESC_STR "[") : "\233",
|
i == 2 ? IF_EB("\033[", ESC_STR "[") : "\233",
|
||||||
s[i] == '3' ? (n >= 16 ? "38;5;" : "9")
|
s[i] == '3' ? (n >= 16 ? "38;5;" : "9")
|
||||||
: (n >= 16 ? "48;5;" : "10"));
|
: (n >= 16 ? "48;5;" : "10"));
|
||||||
|
@@ -753,6 +753,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 */
|
||||||
|
/**/
|
||||||
|
1819,
|
||||||
/**/
|
/**/
|
||||||
1818,
|
1818,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user