diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-02 11:58:49 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-02 11:58:50 -0400 |
commit | 407ac8b42d74963a08c61ffb146ed41a941dc43d (patch) | |
tree | a23f5847330d3b560ab5ebfd2ca00b0d94888a2a | |
parent | 3de785e7b58e4d99e02382881767934efcd0f82c (diff) | |
download | rneovim-407ac8b42d74963a08c61ffb146ed41a941dc43d.tar.gz rneovim-407ac8b42d74963a08c61ffb146ed41a941dc43d.tar.bz2 rneovim-407ac8b42d74963a08c61ffb146ed41a941dc43d.zip |
fold: add const to deleteFold() variables
Declare and initialize variables on same line if possible.
-rw-r--r-- | src/nvim/fold.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 37a6bdad69..4db237a7b9 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -659,34 +659,30 @@ void foldCreate(linenr_T start, linenr_T end) * When "end" is not 0, delete all folds from "start" to "end". * When "recursive" is TRUE delete recursively. */ -void -deleteFold( - linenr_T start, - linenr_T end, - int recursive, - int had_visual // TRUE when Visual selection used +void deleteFold( + const linenr_T start, + const linenr_T end, + const int recursive, + const bool had_visual // true when Visual selection used ) { - garray_T *gap; fold_T *fp; - garray_T *found_ga; fold_T *found_fp = NULL; linenr_T found_off = 0; bool maybe_small = false; int level = 0; linenr_T lnum = start; - linenr_T lnum_off; - int did_one = FALSE; + bool did_one = false; linenr_T first_lnum = MAXLNUM; linenr_T last_lnum = 0; checkupdate(curwin); while (lnum <= end) { - /* Find the deepest fold for "start". */ - gap = &curwin->w_folds; - found_ga = NULL; - lnum_off = 0; + // Find the deepest fold for "start". + garray_T *gap = &curwin->w_folds; + garray_T *found_ga = NULL; + linenr_T lnum_off = 0; bool use_level = false; for (;; ) { if (!foldFind(gap, lnum - lnum_off, &fp)) @@ -723,7 +719,7 @@ deleteFold( parseMarker(curwin); deleteFoldMarkers(found_fp, recursive, found_off); } - did_one = TRUE; + did_one = true; /* redraw window */ changed_window_setting(); |