0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.2243

Problem:    Warning for assigning negative value to unsigned. (Danek Duvall)
Solution:   Make cterm_normal_fg_gui_color and _bg_ guicolor_T, cast to long_u
            only when an unsigned is needed.
This commit is contained in:
Bram Moolenaar
2016-08-22 23:04:33 +02:00
parent 17f1347b86
commit 1b58cdd160
18 changed files with 66 additions and 66 deletions

View File

@@ -8488,7 +8488,7 @@ color_name2handle(char_u *name)
return gui.norm_pixel;
#endif
#ifdef FEAT_TERMGUICOLORS
if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
if (cterm_normal_fg_gui_color != INVALCOLOR)
return cterm_normal_fg_gui_color;
/* Guess that the foreground is black or white. */
return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "black" : "white"));
@@ -8503,7 +8503,7 @@ color_name2handle(char_u *name)
return gui.back_pixel;
#endif
#ifdef FEAT_TERMGUICOLORS
if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
if (cterm_normal_bg_gui_color != INVALCOLOR)
return cterm_normal_bg_gui_color;
/* Guess that the background is white or black. */
return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "white" : "black"));
@@ -8782,9 +8782,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_TERMGUICOLORS
if (spell_aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
if (spell_aep->ae_u.cterm.fg_rgb != INVALCOLOR)
new_en.ae_u.cterm.fg_rgb = spell_aep->ae_u.cterm.fg_rgb;
if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
if (spell_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
new_en.ae_u.cterm.bg_rgb = spell_aep->ae_u.cterm.bg_rgb;
#endif
}
@@ -9076,7 +9076,7 @@ highlight_color(
color = HL_TABLE()[id - 1].sg_gui_bg;
if (color == INVALCOLOR)
return NULL;
rgb = GUI_MCH_GET_RGB(color);
rgb = (long_u)GUI_MCH_GET_RGB(color);
sprintf((char *)buf, "#%02x%02x%02x",
(unsigned)(rgb >> 16),
(unsigned)(rgb >> 8) & 255,