[vim] 91/139: patch 7.4.1774 Problem: Cterm true color feature has warnings. Solution: Add type casts.

James McCoy jamessan at debian.org
Fri May 6 04:00:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit 902647d2dfb42dce8449dfbbc22dab27a528744d
Author: Bram Moolenaar <Bram at vim.org>
Date:   Fri Apr 22 11:49:06 2016 +0200

    patch 7.4.1774
    Problem:    Cterm true color feature has warnings.
    Solution:   Add type casts.
---
 src/screen.c  | 20 ++++++++++----------
 src/syntax.c  |  4 ++--
 src/term.c    |  7 ++-----
 src/version.c |  2 ++
 4 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 5dc8ffe..ee348e9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -7842,7 +7842,7 @@ screen_start_highlight(int attr)
 	    else if (aep != NULL && cterm_normal_fg_bold &&
 #ifdef FEAT_TERMTRUECOLOR
 			(p_guicolors ?
-			    (aep->ae_u.cterm.fg_rgb != INVALCOLOR):
+			    (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR):
 #endif
 			    (t_colors > 1 && aep->ae_u.cterm.fg_color)
 #ifdef FEAT_TERMTRUECOLOR
@@ -7871,9 +7871,9 @@ screen_start_highlight(int attr)
 #ifdef FEAT_TERMTRUECOLOR
 		if (p_guicolors)
 		{
-		    if (aep->ae_u.cterm.fg_rgb != INVALCOLOR)
+		    if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
 			term_fg_rgb_color(aep->ae_u.cterm.fg_rgb);
-		    if (aep->ae_u.cterm.bg_rgb != INVALCOLOR)
+		    if (aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
 			term_bg_rgb_color(aep->ae_u.cterm.bg_rgb);
 		}
 		else
@@ -7933,8 +7933,8 @@ screen_stop_highlight(void)
 		    if (aep != NULL &&
 #ifdef FEAT_TERMTRUECOLOR
 			    (p_guicolors ?
-				(aep->ae_u.cterm.fg_rgb != INVALCOLOR ||
-				 aep->ae_u.cterm.bg_rgb != INVALCOLOR):
+				(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR ||
+				 aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR):
 #endif
 				(aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color)
 #ifdef FEAT_TERMTRUECOLOR
@@ -7991,9 +7991,9 @@ screen_stop_highlight(void)
 #ifdef FEAT_TERMTRUECOLOR
 	    if (p_guicolors)
 	    {
-		if (cterm_normal_fg_gui_color != INVALCOLOR)
+		if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
 		    term_fg_rgb_color(cterm_normal_fg_gui_color);
-		if (cterm_normal_bg_gui_color != INVALCOLOR)
+		if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
 		    term_bg_rgb_color(cterm_normal_bg_gui_color);
 	    }
 	    else
@@ -8027,8 +8027,8 @@ reset_cterm_colors(void)
 	/* set Normal cterm colors */
 #ifdef FEAT_TERMTRUECOLOR
 	if (p_guicolors ?
-		(cterm_normal_fg_gui_color != INVALCOLOR
-		 || cterm_normal_bg_gui_color != INVALCOLOR):
+		(cterm_normal_fg_gui_color != (long_u)INVALCOLOR
+		 || cterm_normal_bg_gui_color != (long_u)INVALCOLOR):
 		(cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0))
 #else
 	if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)
@@ -8960,7 +8960,7 @@ can_clear(char_u *p)
 		|| gui.in_use
 #endif
 #ifdef FEAT_TERMTRUECOLOR
-		|| (p_guicolors && cterm_normal_bg_gui_color != INVALCOLOR)
+		|| (p_guicolors && cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
 #endif
 		|| cterm_normal_bg_color == 0 || *T_UT != NUL));
 }
diff --git a/src/syntax.c b/src/syntax.c
index 9e2971e..ea4e74c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8788,9 +8788,9 @@ hl_combine_attr(int char_attr, int prim_attr)
 		if (spell_aep->ae_u.cterm.bg_color > 0)
 		    new_en.ae_u.cterm.bg_color = spell_aep->ae_u.cterm.bg_color;
 #ifdef FEAT_TERMTRUECOLOR
-		if (spell_aep->ae_u.cterm.fg_rgb != INVALCOLOR)
+		if (spell_aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
 		    new_en.ae_u.cterm.fg_rgb = spell_aep->ae_u.cterm.fg_rgb;
-		if (spell_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
+		if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
 		    new_en.ae_u.cterm.bg_rgb = spell_aep->ae_u.cterm.bg_rgb;
 #endif
 	    }
diff --git a/src/term.c b/src/term.c
index d85cd53..29b48e9 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1383,9 +1383,8 @@ termtrue_mch_get_color(char_u *name)
 	{
 	    int		len;
 	    int		pos;
-	    char	*color;
 
-	    ignored = fgets(line, LINE_LEN, fd);
+	    (void)fgets(line, LINE_LEN, fd);
 	    len = strlen(line);
 
 	    if (len <= 1 || line[len-1] != '\n')
@@ -1397,9 +1396,7 @@ termtrue_mch_get_color(char_u *name)
 	    if (i != 3)
 		continue;
 
-	    color = line + pos;
-
-	    if (STRICMP(color, name) == 0)
+	    if (STRICMP(line + pos, name) == 0)
 	    {
 		fclose(fd);
 		return (guicolor_T) RGB(r, g, b);
diff --git a/src/version.c b/src/version.c
index 51b45c2..3c5f94e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1774,
+/**/
     1773,
 /**/
     1772,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list