diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-11-27 09:33:12 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-27 09:45:32 +0100 |
commit | 6cf186edb5dec13bc7f4cd57be726d124af578de (patch) | |
tree | 17b5e54081db71af8f6e30d8da0020f3161594f1 /src | |
parent | c8b40930c03844908c37c8aeade0a0f1156a0a0c (diff) | |
download | rneovim-6cf186edb5dec13bc7f4cd57be726d124af578de.tar.gz rneovim-6cf186edb5dec13bc7f4cd57be726d124af578de.tar.bz2 rneovim-6cf186edb5dec13bc7f4cd57be726d124af578de.zip |
lint
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 07114c9507..913d27d508 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4619,10 +4619,10 @@ static int findoption(const char *const arg) /// Hidden Number or Toggle option: -1. /// hidden String option: -2. /// unknown option: -3. -int get_option_value ( +int get_option_value( char_u *name, long *numval, - char_u **stringval, /* NULL when only checking existence */ + char_u **stringval, ///< NULL when only checking existence int opt_flags ) { @@ -4630,32 +4630,31 @@ int get_option_value ( return 0; } - int opt_idx; - char_u *varp; - - opt_idx = findoption((const char *)name); + int opt_idx = findoption((const char *)name); if (opt_idx < 0) { // Unknown option. return -3; } - varp = get_varp_scope(&(options[opt_idx]), opt_flags); + char_u *varp = get_varp_scope(&(options[opt_idx]), opt_flags); if (options[opt_idx].flags & P_STRING) { - if (varp == NULL) /* hidden option */ + if (varp == NULL) { // hidden option return -2; + } if (stringval != NULL) { *stringval = vim_strsave(*(char_u **)(varp)); } return 0; } - if (varp == NULL) /* hidden option */ + if (varp == NULL) { // hidden option return -1; - if (options[opt_idx].flags & P_NUM) + } + if (options[opt_idx].flags & P_NUM) { *numval = *(long *)varp; - else { - /* Special case: 'modified' is b_changed, but we also want to consider - * it set when 'ff' or 'fenc' changed. */ + } else { + // Special case: 'modified' is b_changed, but we also want to consider + // it set when 'ff' or 'fenc' changed. if ((int *)varp == &curbuf->b_changed) { *numval = curbufIsChanged(); } else { |