aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-02 12:58:11 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-01-02 21:06:37 +0100
commit7ede14d191b1220ac872a24433825997d62ff7ec (patch)
tree4eddf4a258b3217e5034367622ac54e61ab21622
parenta70fde1b45859bbe557261493bfff40aa90d469a (diff)
downloadrneovim-7ede14d191b1220ac872a24433825997d62ff7ec.tar.gz
rneovim-7ede14d191b1220ac872a24433825997d62ff7ec.tar.bz2
rneovim-7ede14d191b1220ac872a24433825997d62ff7ec.zip
UGRID_FOREACH_CELL: avoid shadowed variables
-rw-r--r--src/nvim/tui/tui.c4
-rw-r--r--src/nvim/ugrid.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index df8522bff2..64e368ffb3 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1174,7 +1174,7 @@ static void tui_flush(UI *ui)
}
UGRID_FOREACH_CELL(grid, row, r.left, clear_col, {
- cursor_goto(ui, row, col);
+ cursor_goto(ui, row, curcol);
print_cell(ui, cell);
});
if (clear_col < r.right) {
@@ -1283,7 +1283,7 @@ static void tui_raw_line(UI *ui, Integer g, Integer linerow, Integer startcol,
grid->cells[linerow][c].attr = attrs[c-startcol];
}
UGRID_FOREACH_CELL(grid, (int)linerow, (int)startcol, (int)endcol, {
- cursor_goto(ui, (int)linerow, col);
+ cursor_goto(ui, (int)linerow, curcol);
print_cell(ui, cell);
});
diff --git a/src/nvim/ugrid.h b/src/nvim/ugrid.h
index 33a706b8c0..19c2e99ebb 100644
--- a/src/nvim/ugrid.h
+++ b/src/nvim/ugrid.h
@@ -25,8 +25,8 @@ struct ugrid {
#define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \
do { \
UCell *row_cells = (grid)->cells[row]; \
- for (int col = startcol; col < endcol; col++) { \
- UCell *cell = row_cells + col; \
+ for (int curcol = startcol; curcol < endcol; curcol++) { \
+ UCell *cell = row_cells + curcol; \
(void)(cell); \
code; \
} \