refactor(option): change some int to bool

This commit is contained in:
Lewis Russell
2023-07-13 10:22:18 +01:00
parent 354a115442
commit 95c880ce31
3 changed files with 8 additions and 7 deletions

View File

@@ -1098,7 +1098,7 @@ static char *stropt_get_newval(int nextchar, int opt_idx, char **argp, void *var
/// Part of do_set() for string options.
static void do_set_option_string(int opt_idx, int opt_flags, char **argp, int nextchar,
set_op_T op_arg, uint32_t flags, void *varp_arg, char *errbuf,
size_t errbuflen, int *value_checked, const char **errmsg)
size_t errbuflen, bool *value_checked, const char **errmsg)
{
char *arg = *argp;
set_op_T op = op_arg;
@@ -1337,7 +1337,7 @@ static void do_set_option_value(int opt_idx, int opt_flags, char **argp, int pre
set_op_T op, uint32_t flags, void *varp, char *errbuf,
size_t errbuflen, const char **errmsg)
{
int value_checked = false;
bool value_checked = false;
if (flags & P_BOOL) { // boolean
do_set_bool(opt_idx, opt_flags, prefix, nextchar, varp, errmsg);
} else if (flags & P_NUM) { // numeric
@@ -3793,7 +3793,7 @@ const char *set_option_value(const char *const name, const OptVal value, int opt
goto end;
}
int value_checked = false;
bool value_checked = false;
switch (v.type) {
case kOptValTypeNil:

View File

@@ -1009,9 +1009,9 @@ typedef struct {
// Option value was checked to be safe, no need to set P_INSECURE
// Used for the 'keymap', 'filetype' and 'syntax' options.
int os_value_checked;
bool os_value_checked;
// Option value changed. Used for the 'filetype' and 'syntax' options.
int os_value_changed;
bool os_value_changed;
// Used by the 'isident', 'iskeyword', 'isprint' and 'isfname' options.
// Set to true if the character table is modified when processing the

View File

@@ -428,7 +428,7 @@ void set_string_option_direct_in_buf(buf_T *buf, const char *name, int opt_idx,
///
/// @return NULL on success, an untranslated error message on error.
const char *set_string_option(const int opt_idx, const char *const value, const int opt_flags,
int *value_checked, char *const errbuf, const size_t errbuflen)
bool *value_checked, char *const errbuf, const size_t errbuflen)
FUNC_ATTR_NONNULL_ARG(2) FUNC_ATTR_WARN_UNUSED_RESULT
{
vimoption_T *opt = get_option(opt_idx);
@@ -2061,7 +2061,8 @@ static void do_spelllang_source(win_T *win)
///
/// @return NULL for success, or an untranslated error message for an error
const char *did_set_string_option(buf_T *buf, win_T *win, int opt_idx, char **varp, char *oldval,
char *errbuf, size_t errbuflen, int opt_flags, int *value_checked)
char *errbuf, size_t errbuflen, int opt_flags,
bool *value_checked)
{
const char *errmsg = NULL;
int restore_chartab = false;