fix lint error

This commit is contained in:
lonerover
2017-01-06 09:25:15 +08:00
parent bef645e5e4
commit 6c69bc9788

View File

@@ -5653,14 +5653,14 @@ static event_T event_name2nr(char_u *start, char_u **end)
int len; int len;
// the event name ends with end of line, '|', a blank or a comma */ // 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) { for (i = 0; event_names[i].name != NULL; i++) {
len = (int)event_names[i].len; len = (int)event_names[i].len;
if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) {
break; break;
} }
}
if (*p == ',') if (*p == ',')
++p; ++p;
*end = p; *end = p;
@@ -5876,7 +5876,8 @@ void do_autocmd(char_u *arg_in, int forceit)
// Check for "nested" flag. // Check for "nested" flag.
cmd = skipwhite(cmd); 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; nested = true;
cmd = skipwhite(cmd + 6); cmd = skipwhite(cmd + 6);
} }
@@ -5903,14 +5904,15 @@ void do_autocmd(char_u *arg_in, int forceit)
/* /*
* Loop over the events. * Loop over the events.
*/ */
last_event = (event_T)-1; /* for listing the event name */ last_event = (event_T)-1; // for listing the event name
last_group = AUGROUP_ERROR; /* for listing the group name */ last_group = AUGROUP_ERROR; // for listing the group name
if (*arg == '*' || *arg == NUL || *arg == '|') { if (*arg == '*' || *arg == NUL || *arg == '|') {
for (event = (event_T)0; (int)event < (int)NUM_EVENTS; for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (event_T)((int)event + 1)) event = (event_T)((int)event + 1)) {
if (do_autocmd_event(event, pat, if (do_autocmd_event(event, pat, nested, cmd, forceit, group) == FAIL) {
nested, cmd, forceit, group) == FAIL)
break; break;
}
}
} else { } else {
while (*arg && *arg != '|' && !ascii_iswhite(*arg)) { while (*arg && *arg != '|' && !ascii_iswhite(*arg)) {
event_T event = event_name2nr(arg, &arg); event_T event = event_name2nr(arg, &arg);
@@ -5939,8 +5941,8 @@ static int au_get_grouparg(char_u **argp)
char_u *arg = *argp; char_u *arg = *argp;
int group = AUGROUP_ALL; 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) { if (p > arg) {
group_name = vim_strnsave(arg, (int)(p - arg)); group_name = vim_strnsave(arg, (int)(p - arg));
group = au_find_group(group_name); group = au_find_group(group_name);