From 8d6c1edc6e31d202590082fa58bf042926e696b2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 18 Aug 2020 23:26:08 -0400 Subject: vim-patch:8.1.2267: compiler warning for uninitialized variable Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Rearrange the code. https://github.com/vim/vim/commit/3b991527e8167f25ad1dfe780b9633c153600955 --- src/nvim/buffer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index b3bbdce9d9..4648631ebe 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2650,7 +2650,7 @@ void buflist_list(exarg_T *eap) int i; garray_T buflist; - buf_T **buflist_data = NULL, **p; + buf_T **buflist_data = NULL; if (vim_strchr(eap->arg, 't')) { ga_init(&buflist, sizeof(buf_T *), 50); @@ -2662,13 +2662,14 @@ void buflist_list(exarg_T *eap) qsort(buflist.ga_data, (size_t)buflist.ga_len, sizeof(buf_T *), buf_time_compare); - p = buflist_data = (buf_T **)buflist.ga_data; - buf = *p; + buflist_data = (buf_T **)buflist.ga_data; + buf = *buflist_data; } + buf_T **p = buflist_data; for (; buf != NULL && !got_int; - buf = buflist_data + buf = buflist_data != NULL ? (++p < buflist_data + buflist.ga_len ? *p : NULL) : buf->b_next) { const bool is_terminal = buf->terminal; -- cgit