diff options
author | dundargoc <gocdundar@gmail.com> | 2022-10-22 12:36:38 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-11-06 11:44:10 +0100 |
commit | 731cdde28ea8d48cc23ba2752a08c261c87eee92 (patch) | |
tree | 92e814050fdbca64aca435f03975b6d5678fbdf3 /src/nvim/option.c | |
parent | a79d28e4d7939c13f38cf4ce63ff240011bca96d (diff) | |
download | rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.gz rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.bz2 rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.zip |
refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning.
Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 523ae13e52..628e1a6581 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2950,15 +2950,13 @@ int get_option_value_strict(char *name, int64_t *numval, char **stringval, int o if (p->indir & PV_WIN) { if (opt_type == SREQ_BUF) { return 0; // Requested buffer-local, not window-local option - } else { - rv |= SOPT_WIN; } + rv |= SOPT_WIN; } else if (p->indir & PV_BUF) { if (opt_type == SREQ_WIN) { return 0; // Requested window-local, not buffer-local option - } else { - rv |= SOPT_BUF; } + rv |= SOPT_BUF; } } @@ -2969,9 +2967,8 @@ int get_option_value_strict(char *name, int64_t *numval, char **stringval, int o if (opt_type == SREQ_GLOBAL) { if (p->var == VAR_WIN) { return 0; - } else { - varp = p->var; } + varp = p->var; } else { if (opt_type == SREQ_BUF) { // Special case: 'modified' is b_changed, but we also want to @@ -3094,9 +3091,8 @@ char *set_option_value(const char *const name, const long number, const char *co } if (flags & P_NUM) { return set_num_option(opt_idx, varp, numval, NULL, 0, opt_flags); - } else { - return set_bool_option(opt_idx, varp, (int)numval, opt_flags); } + return set_bool_option(opt_idx, varp, (int)numval, opt_flags); } } return NULL; |