aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-03-09 09:52:07 -0500
committerJustin M. Keyes <justinkz@gmail.com>2019-01-02 21:06:37 +0100
commita70fde1b45859bbe557261493bfff40aa90d469a (patch)
tree50589bf680a676fe7e0ba7b3d8bd527971d1ca22 /src/nvim/screen.c
parent5fba8159213e7821d16cdbea379cb49ac8a6ee74 (diff)
downloadrneovim-a70fde1b45859bbe557261493bfff40aa90d469a.tar.gz
rneovim-a70fde1b45859bbe557261493bfff40aa90d469a.tar.bz2
rneovim-a70fde1b45859bbe557261493bfff40aa90d469a.zip
build: enable -Wshadow
Note about shada.c: - shada_read_next_item_start was intentionally shadowing `unpacked` and `i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly depended on those variable names. - Macros were changed to parameterize `unpacked` (but not `i`). Macros like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other approach is messy.
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index c05ee5117a..1e07bbb5e3 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -4006,23 +4006,23 @@ win_line (
draw_color_col = advance_color_col(VCOL_HLC, &color_cols);
}
- int attr = base_attr;
+ int col_attr = base_attr;
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol) {
- attr = cuc_attr;
+ col_attr = cuc_attr;
} else if (draw_color_col && VCOL_HLC == *color_cols) {
- attr = mc_attr;
+ col_attr = mc_attr;
}
if (do_virttext) {
- attr = hl_combine_attr(attr, virt_attr);
+ col_attr = hl_combine_attr(col_attr, virt_attr);
}
- attr = hl_combine_attr(attr, line_attr);
+ col_attr = hl_combine_attr(col_attr, line_attr);
- linebuf_attr[off] = attr;
+ linebuf_attr[off] = col_attr;
if (cells == 2) {
- linebuf_attr[off+1] = attr;
+ linebuf_attr[off+1] = col_attr;
}
off += cells * col_stride;
@@ -5200,9 +5200,9 @@ win_redr_custom (
curattr = attr;
p = buf;
for (n = 0; hltab[n].start != NULL; n++) {
- int len = (int)(hltab[n].start - p);
- grid_puts_len(&default_grid, p, len, row, col, curattr);
- col += vim_strnsize(p, len);
+ int textlen = (int)(hltab[n].start - p);
+ grid_puts_len(&default_grid, p, textlen, row, col, curattr);
+ col += vim_strnsize(p, textlen);
p = hltab[n].start;
if (hltab[n].userhl == 0)