diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-01-06 09:25:15 +0800 |
---|---|---|
committer | lonerover <pathfinder1644@yahoo.com> | 2017-01-06 09:25:15 +0800 |
commit | 6c69bc978848df8bb268b74b0e5a01eeb87a32dd (patch) | |
tree | 264369f8702d5f77cd6ae9a7cfd5180e56ce8212 | |
parent | bef645e5e44068f5f225cdeca5667be9f691e1e1 (diff) | |
download | rneovim-6c69bc978848df8bb268b74b0e5a01eeb87a32dd.tar.gz rneovim-6c69bc978848df8bb268b74b0e5a01eeb87a32dd.tar.bz2 rneovim-6c69bc978848df8bb268b74b0e5a01eeb87a32dd.zip |
fix lint error
-rw-r--r-- | src/nvim/fileio.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 7413ff45b0..bbfa56dfbf 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5653,13 +5653,13 @@ static event_T event_name2nr(char_u *start, char_u **end) int len; // the event name ends with end of line, '|', a blank or a comma */ - for (p = start; *p && !ascii_iswhite(*p) && *p != ',' && *p != '|'; ++p) { - ; + for (p = start; *p && !ascii_iswhite(*p) && *p != ',' && *p != '|'; p++) { } - for (i = 0; event_names[i].name != NULL; ++i) { - len = (int) event_names[i].len; - if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) + for (i = 0; event_names[i].name != NULL; i++) { + len = (int)event_names[i].len; + if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) { break; + } } if (*p == ',') ++p; @@ -5829,7 +5829,7 @@ void do_autocmd(char_u *arg_in, int forceit) if (*arg == '|') { arg = (char_u *)""; - group = AUGROUP_ALL; // no argument, use all groups + group = AUGROUP_ALL; // no argument, use all groups } else { // Check for a legal group name. If not, use AUGROUP_ALL. group = au_get_grouparg(&arg); @@ -5876,7 +5876,8 @@ void do_autocmd(char_u *arg_in, int forceit) // Check for "nested" flag. cmd = skipwhite(cmd); - if (*cmd != NUL && STRNCMP(cmd, "nested", 6) == 0 && ascii_iswhite(cmd[6])) { + if (*cmd != NUL && STRNCMP(cmd, "nested", 6) == 0 + && ascii_iswhite(cmd[6])) { nested = true; cmd = skipwhite(cmd + 6); } @@ -5903,14 +5904,15 @@ void do_autocmd(char_u *arg_in, int forceit) /* * Loop over the events. */ - last_event = (event_T)-1; /* for listing the event name */ - last_group = AUGROUP_ERROR; /* for listing the group name */ + last_event = (event_T)-1; // for listing the event name + last_group = AUGROUP_ERROR; // for listing the group name if (*arg == '*' || *arg == NUL || *arg == '|') { for (event = (event_T)0; (int)event < (int)NUM_EVENTS; - event = (event_T)((int)event + 1)) - if (do_autocmd_event(event, pat, - nested, cmd, forceit, group) == FAIL) + event = (event_T)((int)event + 1)) { + if (do_autocmd_event(event, pat, nested, cmd, forceit, group) == FAIL) { break; + } + } } else { while (*arg && *arg != '|' && !ascii_iswhite(*arg)) { event_T event = event_name2nr(arg, &arg); @@ -5939,8 +5941,8 @@ static int au_get_grouparg(char_u **argp) char_u *arg = *argp; int group = AUGROUP_ALL; - for (p = arg; *p && !ascii_iswhite(*p) && *p != '|'; ++p) - ; + for (p = arg; *p && !ascii_iswhite(*p) && *p != '|'; p++) { + } if (p > arg) { group_name = vim_strnsave(arg, (int)(p - arg)); group = au_find_group(group_name); |