Mercurial > vim
comparison src/screen.c @ 9939:ccb6461b82df v7.4.2243
commit https://github.com/vim/vim/commit/1b58cdd160c2e0ada0f638679a2aa27e4665fc48
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 22 23:04:33 2016 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 22 Aug 2016 23:15:07 +0200 |
parents | 4e8b05fa12c6 |
children | 3e3b0ce24b61 |
comparison
equal
deleted
inserted
replaced
9938:5eb7fba8ec4e | 9939:ccb6461b82df |
---|---|
7863 if ((attr & HL_BOLD) && T_MD != NULL) /* bold */ | 7863 if ((attr & HL_BOLD) && T_MD != NULL) /* bold */ |
7864 out_str(T_MD); | 7864 out_str(T_MD); |
7865 else if (aep != NULL && cterm_normal_fg_bold && | 7865 else if (aep != NULL && cterm_normal_fg_bold && |
7866 #ifdef FEAT_TERMGUICOLORS | 7866 #ifdef FEAT_TERMGUICOLORS |
7867 (p_tgc ? | 7867 (p_tgc ? |
7868 (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR): | 7868 (aep->ae_u.cterm.fg_rgb != INVALCOLOR): |
7869 #endif | 7869 #endif |
7870 (t_colors > 1 && aep->ae_u.cterm.fg_color) | 7870 (t_colors > 1 && aep->ae_u.cterm.fg_color) |
7871 #ifdef FEAT_TERMGUICOLORS | 7871 #ifdef FEAT_TERMGUICOLORS |
7872 ) | 7872 ) |
7873 #endif | 7873 #endif |
7892 if (aep != NULL) | 7892 if (aep != NULL) |
7893 { | 7893 { |
7894 #ifdef FEAT_TERMGUICOLORS | 7894 #ifdef FEAT_TERMGUICOLORS |
7895 if (p_tgc) | 7895 if (p_tgc) |
7896 { | 7896 { |
7897 if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR) | 7897 if (aep->ae_u.cterm.fg_rgb != INVALCOLOR) |
7898 term_fg_rgb_color(aep->ae_u.cterm.fg_rgb); | 7898 term_fg_rgb_color(aep->ae_u.cterm.fg_rgb); |
7899 if (aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR) | 7899 if (aep->ae_u.cterm.bg_rgb != INVALCOLOR) |
7900 term_bg_rgb_color(aep->ae_u.cterm.bg_rgb); | 7900 term_bg_rgb_color(aep->ae_u.cterm.bg_rgb); |
7901 } | 7901 } |
7902 else | 7902 else |
7903 #endif | 7903 #endif |
7904 { | 7904 { |
7954 */ | 7954 */ |
7955 aep = syn_cterm_attr2entry(screen_attr); | 7955 aep = syn_cterm_attr2entry(screen_attr); |
7956 if (aep != NULL && | 7956 if (aep != NULL && |
7957 #ifdef FEAT_TERMGUICOLORS | 7957 #ifdef FEAT_TERMGUICOLORS |
7958 (p_tgc ? | 7958 (p_tgc ? |
7959 (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR || | 7959 (aep->ae_u.cterm.fg_rgb != INVALCOLOR |
7960 aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR): | 7960 || aep->ae_u.cterm.bg_rgb != INVALCOLOR): |
7961 #endif | 7961 #endif |
7962 (aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color) | 7962 (aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color) |
7963 #ifdef FEAT_TERMGUICOLORS | 7963 #ifdef FEAT_TERMGUICOLORS |
7964 ) | 7964 ) |
7965 #endif | 7965 #endif |
8012 out_str(T_ME); | 8012 out_str(T_ME); |
8013 | 8013 |
8014 #ifdef FEAT_TERMGUICOLORS | 8014 #ifdef FEAT_TERMGUICOLORS |
8015 if (p_tgc) | 8015 if (p_tgc) |
8016 { | 8016 { |
8017 if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR) | 8017 if (cterm_normal_fg_gui_color != INVALCOLOR) |
8018 term_fg_rgb_color(cterm_normal_fg_gui_color); | 8018 term_fg_rgb_color(cterm_normal_fg_gui_color); |
8019 if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR) | 8019 if (cterm_normal_bg_gui_color != INVALCOLOR) |
8020 term_bg_rgb_color(cterm_normal_bg_gui_color); | 8020 term_bg_rgb_color(cterm_normal_bg_gui_color); |
8021 } | 8021 } |
8022 else | 8022 else |
8023 #endif | 8023 #endif |
8024 { | 8024 { |
8047 { | 8047 { |
8048 if (IS_CTERM) | 8048 if (IS_CTERM) |
8049 { | 8049 { |
8050 /* set Normal cterm colors */ | 8050 /* set Normal cterm colors */ |
8051 #ifdef FEAT_TERMGUICOLORS | 8051 #ifdef FEAT_TERMGUICOLORS |
8052 if (p_tgc ? | 8052 if (p_tgc ? (cterm_normal_fg_gui_color != INVALCOLOR |
8053 (cterm_normal_fg_gui_color != (long_u)INVALCOLOR | 8053 || cterm_normal_bg_gui_color != INVALCOLOR) |
8054 || cterm_normal_bg_gui_color != (long_u)INVALCOLOR): | 8054 : (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)) |
8055 (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)) | |
8056 #else | 8055 #else |
8057 if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0) | 8056 if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0) |
8058 #endif | 8057 #endif |
8059 { | 8058 { |
8060 out_str(T_OP); | 8059 out_str(T_OP); |
8981 return (*p != NUL && (t_colors <= 1 | 8980 return (*p != NUL && (t_colors <= 1 |
8982 #ifdef FEAT_GUI | 8981 #ifdef FEAT_GUI |
8983 || gui.in_use | 8982 || gui.in_use |
8984 #endif | 8983 #endif |
8985 #ifdef FEAT_TERMGUICOLORS | 8984 #ifdef FEAT_TERMGUICOLORS |
8986 || (p_tgc && cterm_normal_bg_gui_color == (long_u)INVALCOLOR) | 8985 || (p_tgc && cterm_normal_bg_gui_color == INVALCOLOR) |
8987 || (!p_tgc && cterm_normal_bg_color == 0) | 8986 || (!p_tgc && cterm_normal_bg_color == 0) |
8988 #else | 8987 #else |
8989 || cterm_normal_bg_color == 0 | 8988 || cterm_normal_bg_color == 0 |
8990 #endif | 8989 #endif |
8991 || *T_UT != NUL)); | 8990 || *T_UT != NUL)); |