forked from aniani/vim
patch 7.4.1773
Problem: Compiler warnings. (Dominique Pelle) Solution: Add UNUSED. Add type cast. Avoid a buffer overflow.
This commit is contained in:
parent
54a38415ca
commit
380130f1e1
@ -9545,8 +9545,8 @@ highlight_gui_started(void)
|
|||||||
static void
|
static void
|
||||||
gui_do_one_color(
|
gui_do_one_color(
|
||||||
int idx,
|
int idx,
|
||||||
int do_menu, /* TRUE: might set the menu font */
|
int do_menu UNUSED, /* TRUE: might set the menu font */
|
||||||
int do_tooltip) /* TRUE: might set the tooltip font */
|
int do_tooltip UNUSED) /* TRUE: might set the tooltip font */
|
||||||
{
|
{
|
||||||
int didit = FALSE;
|
int didit = FALSE;
|
||||||
|
|
||||||
|
11
src/term.c
11
src/term.c
@ -1272,6 +1272,7 @@ struct rgbcolor_table_S {
|
|||||||
char_u *color_name;
|
char_u *color_name;
|
||||||
guicolor_T color;
|
guicolor_T color;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct rgbcolor_table_S rgb_table[] = {
|
static struct rgbcolor_table_S rgb_table[] = {
|
||||||
{(char_u *)"black", RGB(0x00, 0x00, 0x00)},
|
{(char_u *)"black", RGB(0x00, 0x00, 0x00)},
|
||||||
{(char_u *)"blue", RGB(0x00, 0x00, 0xD4)},
|
{(char_u *)"blue", RGB(0x00, 0x00, 0xD4)},
|
||||||
@ -1354,7 +1355,7 @@ termtrue_mch_get_color(char_u *name)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Check if the name is one of the colors we know */
|
/* Check if the name is one of the colors we know */
|
||||||
for (i = 0; i < sizeof(rgb_table) / sizeof(rgb_table[0]); i++)
|
for (i = 0; i < (int)(sizeof(rgb_table) / sizeof(rgb_table[0])); i++)
|
||||||
if (STRICMP(name, rgb_table[i].color_name) == 0)
|
if (STRICMP(name, rgb_table[i].color_name) == 0)
|
||||||
return rgb_table[i].color;
|
return rgb_table[i].color;
|
||||||
}
|
}
|
||||||
@ -1384,7 +1385,7 @@ termtrue_mch_get_color(char_u *name)
|
|||||||
int pos;
|
int pos;
|
||||||
char *color;
|
char *color;
|
||||||
|
|
||||||
fgets(line, LINE_LEN, fd);
|
ignored = fgets(line, LINE_LEN, fd);
|
||||||
len = strlen(line);
|
len = strlen(line);
|
||||||
|
|
||||||
if (len <= 1 || line[len-1] != '\n')
|
if (len <= 1 || line[len-1] != '\n')
|
||||||
@ -2803,9 +2804,11 @@ term_bg_rgb_color(long_u rgb)
|
|||||||
static void
|
static void
|
||||||
term_rgb_color(char_u *s, long_u rgb)
|
term_rgb_color(char_u *s, long_u rgb)
|
||||||
{
|
{
|
||||||
char buf[7+3*3+2+1+1];
|
#define MAX_COLOR_STR_LEN 100
|
||||||
|
char buf[MAX_COLOR_STR_LEN];
|
||||||
|
|
||||||
sprintf(buf, (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
|
vim_snprintf(buf, MAX_KEY_CODE_LEN,
|
||||||
|
(char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
|
||||||
OUT_STR(buf);
|
OUT_STR(buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
1773,
|
||||||
/**/
|
/**/
|
||||||
1772,
|
1772,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user