1
0
forked from aniani/vim

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

@@ -77,9 +77,6 @@ struct builtin_term
static struct builtin_term *find_builtin_term(char_u *name);
static void parse_builtin_tcap(char_u *s);
static void term_color(char_u *s, int n);
#ifdef FEAT_TERMGUICOLORS
static void term_rgb_color(char_u *s, long_u rgb);
#endif
static void gather_termleader(void);
#ifdef FEAT_TERMRESPONSE
static void req_codes_from_term(void);
@@ -1282,10 +1279,10 @@ termgui_get_color(char_u *name)
return t;
}
long_u
guicolor_T
termgui_mch_get_rgb(guicolor_T color)
{
return (long_u)color;
return color;
}
#endif
@@ -2634,24 +2631,13 @@ term_color(char_u *s, int n)
}
#if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
void
term_fg_rgb_color(long_u rgb)
{
term_rgb_color(T_8F, rgb);
}
void
term_bg_rgb_color(long_u rgb)
{
term_rgb_color(T_8B, rgb);
}
#define RED(rgb) ((rgb>>16)&0xFF)
#define GREEN(rgb) ((rgb>> 8)&0xFF)
#define BLUE(rgb) ((rgb )&0xFF)
#define RED(rgb) (((long_u)(rgb) >> 16) & 0xFF)
#define GREEN(rgb) (((long_u)(rgb) >> 8) & 0xFF)
#define BLUE(rgb) (((long_u)(rgb) ) & 0xFF)
static void
term_rgb_color(char_u *s, long_u rgb)
term_rgb_color(char_u *s, guicolor_T rgb)
{
#define MAX_COLOR_STR_LEN 100
char buf[MAX_COLOR_STR_LEN];
@@ -2660,6 +2646,18 @@ term_rgb_color(char_u *s, long_u rgb)
(char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
OUT_STR(buf);
}
void
term_fg_rgb_color(guicolor_T rgb)
{
term_rgb_color(T_8F, rgb);
}
void
term_bg_rgb_color(guicolor_T rgb)
{
term_rgb_color(T_8B, rgb);
}
#endif
#if (defined(FEAT_TITLE) && (defined(UNIX) || defined(VMS) \