0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.1532: compiler warnings without termguicolors feature

Problem:    Compiler warnings without termguicolors feature.
Solution:   Add #ifdef. (John Marriott)  Cleanup the code a bit.
This commit is contained in:
Bram Moolenaar
2018-02-23 18:23:30 +01:00
parent cafafb381a
commit cc0f2be880
2 changed files with 30 additions and 27 deletions

View File

@@ -6624,6 +6624,7 @@ update_tcap(int attr)
}
}
# ifdef FEAT_TERMGUICOLORS
struct ks_tbl_s
{
int code; /* value of KS_ */
@@ -6653,15 +6654,12 @@ find_first_tcap(
{
struct builtin_term *p;
p = find_builtin_term(name);
while (p->bt_string != NULL)
{
for (p = find_builtin_term(name); p->bt_string != NULL; ++p)
if (p->bt_entry == code)
return p;
p++;
}
return NULL;
}
# endif
/*
* For Win32 console: replace the sequence immediately after termguicolors.
@@ -6670,23 +6668,24 @@ find_first_tcap(
swap_tcap(void)
{
# ifdef FEAT_TERMGUICOLORS
static int init = 0;
static int init_done = FALSE;
static int last_tgc;
struct ks_tbl_s *ks;
struct builtin_term *bt;
/* buffer initialization */
if (init == 0)
if (!init_done)
{
ks = ks_tbl;
while (ks->vtp != NULL)
for (ks = ks_tbl; ks->vtp != NULL; ks++)
{
bt = find_first_tcap(DEFAULT_TERM, ks->code);
if (bt != NULL)
{
ks->buf = bt->bt_string;
ks->vbuf = ks->vtp;
ks++;
}
init++;
}
init_done = TRUE;
last_tgc = p_tgc;
return;
}
@@ -6696,25 +6695,27 @@ swap_tcap(void)
if (p_tgc)
{
/* switch to special character sequence */
ks = ks_tbl;
while (ks->vtp != NULL)
for (ks = ks_tbl; ks->vtp != NULL; ks++)
{
bt = find_first_tcap(DEFAULT_TERM, ks->code);
if (bt != NULL)
{
ks->buf = bt->bt_string;
bt->bt_string = ks->vbuf;
ks++;
}
}
}
else
{
/* switch to index color */
ks = ks_tbl;
while (ks->vtp != NULL)
for (ks = ks_tbl; ks->vtp != NULL; ks++)
{
bt = find_first_tcap(DEFAULT_TERM, ks->code);
if (bt != NULL)
{
ks->vbuf = bt->bt_string;
bt->bt_string = ks->buf;
ks++;
}
}
}

View File

@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1532,
/**/
1531,
/**/