vim-patch:8.1.2267: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Rearrange the code.
3b991527e8
This commit is contained in:
Jan Edmund Lazo
2020-08-18 23:26:08 -04:00
parent 45615cedd1
commit 8d6c1edc6e

View File

@@ -2650,7 +2650,7 @@ void buflist_list(exarg_T *eap)
int i; int i;
garray_T buflist; garray_T buflist;
buf_T **buflist_data = NULL, **p; buf_T **buflist_data = NULL;
if (vim_strchr(eap->arg, 't')) { if (vim_strchr(eap->arg, 't')) {
ga_init(&buflist, sizeof(buf_T *), 50); 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, qsort(buflist.ga_data, (size_t)buflist.ga_len,
sizeof(buf_T *), buf_time_compare); sizeof(buf_T *), buf_time_compare);
p = buflist_data = (buf_T **)buflist.ga_data; buflist_data = (buf_T **)buflist.ga_data;
buf = *p; buf = *buflist_data;
} }
buf_T **p = buflist_data;
for (; for (;
buf != NULL && !got_int; buf != NULL && !got_int;
buf = buflist_data buf = buflist_data != NULL
? (++p < buflist_data + buflist.ga_len ? *p : NULL) ? (++p < buflist_data + buflist.ga_len ? *p : NULL)
: buf->b_next) { : buf->b_next) {
const bool is_terminal = buf->terminal; const bool is_terminal = buf->terminal;