diff options
author | Jason Schulz <jason@schulz.name> | 2016-01-14 22:33:51 -0800 |
---|---|---|
committer | Jason Schulz <jason@schulz.name> | 2016-01-15 20:32:00 -0800 |
commit | f82e982bda49d15f19dbd72531a6c1125d863486 (patch) | |
tree | 1010bd5868cd7937371823de131ecdf5e59f48e2 /src/nvim/ex_getln.c | |
parent | 7ad3f077dc68a83b2cdfb7b1d04de9266d7978a9 (diff) | |
download | rneovim-f82e982bda49d15f19dbd72531a6c1125d863486.tar.gz rneovim-f82e982bda49d15f19dbd72531a6c1125d863486.tar.bz2 rneovim-f82e982bda49d15f19dbd72531a6c1125d863486.zip |
Fix lint issues
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 1a9a5bd3ec..81d9b2ea01 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4767,35 +4767,40 @@ int del_history_idx(int histype, int idx) return TRUE; } -/* - * Get indices "num1,num2" that specify a range within a list (not a range of - * text lines in a buffer!) from a string. Used for ":history" and ":clist". - * Returns OK if parsed successfully, otherwise FAIL. - */ +/// Get indices that specify a range within a list (not a range of text lines +/// in a buffer!) from a string. Used for ":history" and ":clist". +/// +/// @param str string to parse range from +/// @param num1 from +/// @param num2 to +/// +/// @return OK if parsed successfully, otherwise FAIL. int get_list_range(char_u **str, int *num1, int *num2) { int len; - int first = FALSE; + int first = false; long num; *str = skipwhite(*str); - if (**str == '-' || ascii_isdigit(**str)) { /* parse "from" part of range */ - vim_str2nr(*str, NULL, &len, FALSE, FALSE, FALSE, &num, NULL); + if (**str == '-' || ascii_isdigit(**str)) { // parse "from" part of range + vim_str2nr(*str, NULL, &len, false, false, false, &num, NULL); *str += len; *num1 = (int)num; - first = TRUE; + first = true; } *str = skipwhite(*str); - if (**str == ',') { /* parse "to" part of range */ + if (**str == ',') { // parse "to" part of range *str = skipwhite(*str + 1); - vim_str2nr(*str, NULL, &len, FALSE, FALSE, FALSE, &num, NULL); + vim_str2nr(*str, NULL, &len, false, false, false, &num, NULL); if (len > 0) { *num2 = (int)num; *str = skipwhite(*str + len); - } else if (!first) /* no number given at all */ + } else if (!first) { // no number given at all return FAIL; - } else if (first) /* only one number given */ + } + } else if (first) { // only one number given *num2 = *num1; + } return OK; } |