mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
refactor(option): change some int to bool
This commit is contained in:
@@ -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:
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user