diff options
author | Steven Oliver <oliver.steven@gmail.com> | 2015-08-30 16:27:47 -0400 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2015-09-04 11:07:33 +0200 |
commit | f7c5dc4db266bfc1db3ea76d114d9a04413fe875 (patch) | |
tree | ec6fdb7594d41c89d3b71f9ebd82ced7652b2e0d /src/nvim/option.c | |
parent | ea33a75d0738526dd1ecfdeb387aeccb15fb7832 (diff) | |
download | rneovim-f7c5dc4db266bfc1db3ea76d114d9a04413fe875.tar.gz rneovim-f7c5dc4db266bfc1db3ea76d114d9a04413fe875.tar.bz2 rneovim-f7c5dc4db266bfc1db3ea76d114d9a04413fe875.zip |
Remove instances of TRUE/FALSE macro
memory.c
os_unix.c
path.c
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index ee50567728..71ca36c7e2 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1820,13 +1820,13 @@ static void didset_options(void) /* initialize the table for 'iskeyword' et.al. */ (void)init_chartab(); - (void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE); - (void)opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE); - (void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE); - (void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE); - (void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE); - (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE); - (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE); + (void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, true); + (void)opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, true); + (void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, true); + (void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, true); + (void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, true); + (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, true); + (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, true); (void)spell_check_msm(); (void)spell_check_sps(); (void)compile_cap_prog(curwin->w_s); @@ -2136,7 +2136,7 @@ did_set_string_option ( // make the local value empty: use the global value *flags = 0; } else { - if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) { + if (opt_strings_flags(bkc, p_bkc_values, flags, true) != OK) { errmsg = e_invarg; } @@ -2144,7 +2144,7 @@ did_set_string_option ( + ((*flags & BKC_YES) != 0) + ((*flags & BKC_NO) != 0) != 1) { // Must have exactly one of "auto", "yes" and "no". - (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE); + (void)opt_strings_flags(oldval, p_bkc_values, flags, true); errmsg = e_invarg; } } @@ -2214,17 +2214,17 @@ did_set_string_option ( } /* 'sessionoptions' */ else if (varp == &p_ssop) { - if (opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE) != OK) + if (opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, true) != OK) errmsg = e_invarg; if ((ssop_flags & SSOP_CURDIR) && (ssop_flags & SSOP_SESDIR)) { /* Don't allow both "sesdir" and "curdir". */ - (void)opt_strings_flags(oldval, p_ssop_values, &ssop_flags, TRUE); + (void)opt_strings_flags(oldval, p_ssop_values, &ssop_flags, true); errmsg = e_invarg; } } /* 'viewoptions' */ else if (varp == &p_vop) { - if (opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE) != OK) + if (opt_strings_flags(p_vop, p_ssop_values, &vop_flags, true) != OK) errmsg = e_invarg; } /* 'scrollopt' */ @@ -2563,7 +2563,7 @@ did_set_string_option ( } /* 'switchbuf' */ else if (varp == &p_swb) { - if (opt_strings_flags(p_swb, p_swb_values, &swb_flags, TRUE) != OK) + if (opt_strings_flags(p_swb, p_swb_values, &swb_flags, true) != OK) errmsg = e_invarg; } /* 'debug' */ @@ -2573,7 +2573,7 @@ did_set_string_option ( } /* 'display' */ else if (varp == &p_dy) { - if (opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE) != OK) + if (opt_strings_flags(p_dy, p_dy_values, &dy_flags, true) != OK) errmsg = e_invarg; else (void)init_chartab(); @@ -2724,7 +2724,7 @@ did_set_string_option ( } /* 'casemap' */ else if (varp == &p_cmp) { - if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE) != OK) + if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, true) != OK) errmsg = e_invarg; } /* 'diffopt' */ @@ -2765,7 +2765,7 @@ did_set_string_option ( } /* 'foldopen' */ else if (varp == &p_fdo) { - if (opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE) != OK) + if (opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, true) != OK) errmsg = e_invarg; } /* 'foldclose' */ @@ -2780,7 +2780,7 @@ did_set_string_option ( } /* 'virtualedit' */ else if (varp == &p_ve) { - if (opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE) != OK) + if (opt_strings_flags(p_ve, p_ve_values, &ve_flags, true) != OK) errmsg = e_invarg; else if (STRCMP(p_ve, oldval) != 0) { /* Recompute cursor position in case the new 've' setting @@ -3418,10 +3418,10 @@ set_bool_option ( else if ((int *)varp == &curwin->w_p_wrap) { if (curwin->w_p_wrap) curwin->w_leftcol = 0; - } else if ((int *)varp == &p_ea) { + } else if ((bool *)varp == &p_ea) { if (p_ea && !old_value) - win_equal(curwin, FALSE, 0); - } else if ((int *)varp == &p_acd) { + win_equal(curwin, false, 0); + } else if ((bool *)varp == &p_acd) { /* Change directories when the 'acd' option is set now. */ do_autochdir(); } @@ -6011,8 +6011,7 @@ static void fill_breakat_flags(void) * Return OK for correct value, FAIL otherwise. * Empty is always OK. */ -static int -check_opt_strings ( +static int check_opt_strings( char_u *val, char **values, int list /* when TRUE: accept a list of values */ @@ -6028,12 +6027,11 @@ check_opt_strings ( * Return OK for correct value, FAIL otherwise. * Empty is always OK. */ -static int -opt_strings_flags ( - char_u *val, /* new value */ +static int opt_strings_flags( + char_u *val, /* new value */ char **values, /* array of valid string values */ unsigned *flagp, - int list /* when TRUE: accept a list of values */ + bool list /* when TRUE: accept a list of values */ ) { unsigned int new_flags = 0; @@ -6109,11 +6107,10 @@ static int check_opt_wim(void) /* * Check if backspacing over something is allowed. + * The parameter what is one of the following: whatBS_INDENT, BS_EOL + * or BS_START */ -int -can_bs ( - int what /* BS_INDENT, BS_EOL or BS_START */ -) +bool can_bs(int what) { switch (*p_bs) { case '2': return TRUE; @@ -6149,7 +6146,7 @@ void save_file_ff(buf_T *buf) * When "ignore_empty" is true don't consider a new, empty buffer to be * changed. */ -int file_ff_differs(buf_T *buf, int ignore_empty) +bool file_ff_differs(buf_T *buf, bool ignore_empty) { /* In a buffer that was never loaded the options are not valid. */ if (buf->b_flags & BF_NEVERLOADED) |