Rewrite options_array_set to be clearer and remove a spurious warning

with newer GCC. From Ben Boeckel.
This commit is contained in:
nicm
2019-10-15 08:30:36 +00:00
parent 0c5e9c6efa
commit 9fd62efcf0
2 changed files with 37 additions and 20 deletions

View File

@ -191,7 +191,7 @@ window_tree_cmp_session(const void *a0, const void *b0)
const struct session *const *b = b0;
const struct session *sa = *a;
const struct session *sb = *b;
int result;
int result = 0;
switch (window_tree_sort->field) {
case WINDOW_TREE_BY_INDEX:
@ -226,7 +226,7 @@ window_tree_cmp_window(const void *a0, const void *b0)
const struct winlink *wlb = *b;
struct window *wa = wla->window;
struct window *wb = wlb->window;
int result;
int result = 0;
switch (window_tree_sort->field) {
case WINDOW_TREE_BY_INDEX: