Skip to content

Commit 902647d

Browse files
committed
patch 7.4.1774
Problem: Cterm true color feature has warnings. Solution: Add type casts.
1 parent 380130f commit 902647d

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

src/screen.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7842,7 +7842,7 @@ screen_start_highlight(int attr)
78427842
else if (aep != NULL && cterm_normal_fg_bold &&
78437843
#ifdef FEAT_TERMTRUECOLOR
78447844
(p_guicolors ?
7845-
(aep->ae_u.cterm.fg_rgb != INVALCOLOR):
7845+
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR):
78467846
#endif
78477847
(t_colors > 1 && aep->ae_u.cterm.fg_color)
78487848
#ifdef FEAT_TERMTRUECOLOR
@@ -7871,9 +7871,9 @@ screen_start_highlight(int attr)
78717871
#ifdef FEAT_TERMTRUECOLOR
78727872
if (p_guicolors)
78737873
{
7874-
if (aep->ae_u.cterm.fg_rgb != INVALCOLOR)
7874+
if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
78757875
term_fg_rgb_color(aep->ae_u.cterm.fg_rgb);
7876-
if (aep->ae_u.cterm.bg_rgb != INVALCOLOR)
7876+
if (aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
78777877
term_bg_rgb_color(aep->ae_u.cterm.bg_rgb);
78787878
}
78797879
else
@@ -7933,8 +7933,8 @@ screen_stop_highlight(void)
79337933
if (aep != NULL &&
79347934
#ifdef FEAT_TERMTRUECOLOR
79357935
(p_guicolors ?
7936-
(aep->ae_u.cterm.fg_rgb != INVALCOLOR ||
7937-
aep->ae_u.cterm.bg_rgb != INVALCOLOR):
7936+
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR ||
7937+
aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR):
79387938
#endif
79397939
(aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color)
79407940
#ifdef FEAT_TERMTRUECOLOR
@@ -7991,9 +7991,9 @@ screen_stop_highlight(void)
79917991
#ifdef FEAT_TERMTRUECOLOR
79927992
if (p_guicolors)
79937993
{
7994-
if (cterm_normal_fg_gui_color != INVALCOLOR)
7994+
if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
79957995
term_fg_rgb_color(cterm_normal_fg_gui_color);
7996-
if (cterm_normal_bg_gui_color != INVALCOLOR)
7996+
if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
79977997
term_bg_rgb_color(cterm_normal_bg_gui_color);
79987998
}
79997999
else
@@ -8027,8 +8027,8 @@ reset_cterm_colors(void)
80278027
/* set Normal cterm colors */
80288028
#ifdef FEAT_TERMTRUECOLOR
80298029
if (p_guicolors ?
8030-
(cterm_normal_fg_gui_color != INVALCOLOR
8031-
|| cterm_normal_bg_gui_color != INVALCOLOR):
8030+
(cterm_normal_fg_gui_color != (long_u)INVALCOLOR
8031+
|| cterm_normal_bg_gui_color != (long_u)INVALCOLOR):
80328032
(cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0))
80338033
#else
80348034
if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)
@@ -8960,7 +8960,7 @@ can_clear(char_u *p)
89608960
|| gui.in_use
89618961
#endif
89628962
#ifdef FEAT_TERMTRUECOLOR
8963-
|| (p_guicolors && cterm_normal_bg_gui_color != INVALCOLOR)
8963+
|| (p_guicolors && cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
89648964
#endif
89658965
|| cterm_normal_bg_color == 0 || *T_UT != NUL));
89668966
}

src/syntax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8788,9 +8788,9 @@ hl_combine_attr(int char_attr, int prim_attr)
87888788
if (spell_aep->ae_u.cterm.bg_color > 0)
87898789
new_en.ae_u.cterm.bg_color = spell_aep->ae_u.cterm.bg_color;
87908790
#ifdef FEAT_TERMTRUECOLOR
8791-
if (spell_aep->ae_u.cterm.fg_rgb != INVALCOLOR)
8791+
if (spell_aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
87928792
new_en.ae_u.cterm.fg_rgb = spell_aep->ae_u.cterm.fg_rgb;
8793-
if (spell_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
8793+
if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
87948794
new_en.ae_u.cterm.bg_rgb = spell_aep->ae_u.cterm.bg_rgb;
87958795
#endif
87968796
}

src/term.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,9 +1383,8 @@ termtrue_mch_get_color(char_u *name)
13831383
{
13841384
int len;
13851385
int pos;
1386-
char *color;
13871386

1388-
ignored = fgets(line, LINE_LEN, fd);
1387+
(void)fgets(line, LINE_LEN, fd);
13891388
len = strlen(line);
13901389

13911390
if (len <= 1 || line[len-1] != '\n')
@@ -1397,9 +1396,7 @@ termtrue_mch_get_color(char_u *name)
13971396
if (i != 3)
13981397
continue;
13991398

1400-
color = line + pos;
1401-
1402-
if (STRICMP(color, name) == 0)
1399+
if (STRICMP(line + pos, name) == 0)
14031400
{
14041401
fclose(fd);
14051402
return (guicolor_T) RGB(r, g, b);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1774,
756758
/**/
757759
1773,
758760
/**/

0 commit comments

Comments
 (0)