diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-02 08:31:04 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-02 08:44:42 -0400 |
commit | 3de785e7b58e4d99e02382881767934efcd0f82c (patch) | |
tree | f3e994b4753566a8aca998c84c7176735db9c475 /src/nvim/fold.c | |
parent | d2c1d9c466b1154afa47befef019439a241810c3 (diff) | |
download | rneovim-3de785e7b58e4d99e02382881767934efcd0f82c.tar.gz rneovim-3de785e7b58e4d99e02382881767934efcd0f82c.tar.bz2 rneovim-3de785e7b58e4d99e02382881767934efcd0f82c.zip |
fold: add const to hasFoldingWin() variables
cache is bool so update callers to pass true/false, not TRUE/FALSE.
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r-- | src/nvim/fold.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 6cf29a56f0..37a6bdad69 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -147,29 +147,27 @@ int hasAnyFolding(win_T *win) */ bool hasFolding(linenr_T lnum, linenr_T *firstp, linenr_T *lastp) { - return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL); + return hasFoldingWin(curwin, lnum, firstp, lastp, true, NULL); } /* hasFoldingWin() {{{2 */ bool hasFoldingWin( - win_T *win, - linenr_T lnum, - linenr_T *firstp, - linenr_T *lastp, - int cache, /* when TRUE: use cached values of window */ - foldinfo_T *infop /* where to store fold info */ + win_T *const win, + const linenr_T lnum, + linenr_T *const firstp, + linenr_T *const lastp, + const bool cache, // when true: use cached values of window + foldinfo_T *const infop // where to store fold info ) { bool had_folded = false; linenr_T first = 0; linenr_T last = 0; linenr_T lnum_rel = lnum; - int x; fold_T *fp; int level = 0; bool use_level = false; bool maybe_small = false; - garray_T *gap; int low_level = 0; checkupdate(win); @@ -187,7 +185,7 @@ bool hasFoldingWin( * First look in cached info for displayed lines. This is probably * the fastest, but it can only be used if the entry is still valid. */ - x = find_wl_entry(win, lnum); + const int x = find_wl_entry(win, lnum); if (x >= 0) { first = win->w_lines[x].wl_lnum; last = win->w_lines[x].wl_lastlnum; @@ -199,7 +197,7 @@ bool hasFoldingWin( /* * Recursively search for a fold that contains "lnum". */ - gap = &win->w_folds; + garray_T *gap = &win->w_folds; for (;; ) { if (!foldFind(gap, lnum_rel, &fp)) break; @@ -296,8 +294,9 @@ long foldedCount(win_T *win, linenr_T lnum, foldinfo_T *infop) { linenr_T last; - if (hasFoldingWin(win, lnum, NULL, &last, FALSE, infop)) + if (hasFoldingWin(win, lnum, NULL, &last, false, infop)) { return (long)(last - lnum + 1); + } return 0; } |