From a70fde1b45859bbe557261493bfff40aa90d469a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 9 Mar 2016 09:52:07 -0500 Subject: 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. --- src/nvim/syntax.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/syntax.c') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 973d09d065..81c78ca6a9 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -6463,7 +6463,7 @@ void do_highlight(const char *line, const bool forceit, const bool init) // If no argument, list current highlighting. if (ends_excmd((uint8_t)(*line))) { - for (int i = 1; i <= highlight_ga.ga_len && !got_int; i++) { + for (i = 1; i <= highlight_ga.ga_len && !got_int; i++) { // TODO(brammool): only call when the group has attributes set highlight_list_one(i); } @@ -6569,8 +6569,8 @@ void do_highlight(const char *line, const bool forceit, const bool init) restore_cterm_colors(); // Clear all default highlight groups and load the defaults. - for (int idx = 0; idx < highlight_ga.ga_len; idx++) { - highlight_clear(idx); + for (int j = 0; j < highlight_ga.ga_len; j++) { + highlight_clear(j); } init_highlight(true, true); highlight_changed(); -- cgit