diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-06-06 23:25:13 -0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-10 14:15:21 -0400 |
commit | f39fd5b4c424cc477a168fbf4eebfe315d23e614 (patch) | |
tree | af9fd539e39b83bbe47be55d5b76870ff3ffe630 /src/nvim/fileio.c | |
parent | a3214803429e05635cbfbe8b3050a73406da6bc6 (diff) | |
download | rneovim-f39fd5b4c424cc477a168fbf4eebfe315d23e614.tar.gz rneovim-f39fd5b4c424cc477a168fbf4eebfe315d23e614.tar.bz2 rneovim-f39fd5b4c424cc477a168fbf4eebfe315d23e614.zip |
Declare garray iterators in the for() scope where possible #819
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index b3b336073b..f86eae6a48 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5655,9 +5655,7 @@ void aubuflocal_remove(buf_T *buf) */ static int au_new_group(char_u *name) { - int i; - - i = au_find_group(name); + int i = au_find_group(name); if (i == AUGROUP_ERROR) { /* the group doesn't exist yet, add it */ /* First try using a free entry. */ for (i = 0; i < augroups.ga_len; ++i) @@ -5694,11 +5692,11 @@ static void au_del_group(char_u *name) */ static int au_find_group(char_u *name) { - int i; - - for (i = 0; i < augroups.ga_len; ++i) - if (AUGROUP_NAME(i) != NULL && STRCMP(AUGROUP_NAME(i), name) == 0) + for (int i = 0; i < augroups.ga_len; ++i) { + if (AUGROUP_NAME(i) != NULL && STRCMP(AUGROUP_NAME(i), name) == 0) { return i; + } + } return AUGROUP_ERROR; } @@ -5715,8 +5713,6 @@ int au_has_group(char_u *name) */ void do_augroup(char_u *arg, int del_group) { - int i; - if (del_group) { if (*arg == NUL) EMSG(_(e_argreq)); @@ -5725,12 +5721,12 @@ void do_augroup(char_u *arg, int del_group) } else if (STRICMP(arg, "end") == 0) /* ":aug end": back to group 0 */ current_augroup = AUGROUP_DEFAULT; else if (*arg) { /* ":aug xxx": switch to group xxx */ - i = au_new_group(arg); + int i = au_new_group(arg); if (i != AUGROUP_ERROR) current_augroup = i; } else { /* ":aug": list the group names */ msg_start(); - for (i = 0; i < augroups.ga_len; ++i) { + for (int i = 0; i < augroups.ga_len; ++i) { if (AUGROUP_NAME(i) != NULL) { msg_puts(AUGROUP_NAME(i)); msg_puts((char_u *)" "); |