patch 8.2.0173: build fails with old compiler
Problem: Build fails with old compiler.
Solution: Do not use anonymous unions. (John Marriott)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 9cdd65a..19f7294 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4070,7 +4070,7 @@
// Start at specified item. Use the cached index that list_find()
// sets, so that a negative number also works.
item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error));
- idx = l->lv_idx;
+ idx = l->lv_u.mat.lv_idx;
if (argvars[3].v_type != VAR_UNKNOWN)
ic = (int)tv_get_number_chk(&argvars[3], &error);
if (error)
@@ -4678,7 +4678,7 @@
li = list_find(l, start);
if (li == NULL)
goto theend;
- idx = l->lv_idx; // use the cached index
+ idx = l->lv_u.mat.lv_idx; // use the cached index
}
else
{
@@ -5330,9 +5330,9 @@
// works with ":for". If used otherwise range_list_materialize() must
// be called.
list->lv_first = &range_list_item;
- list->lv_start = start;
- list->lv_end = end;
- list->lv_stride = stride;
+ list->lv_u.nonmat.lv_start = start;
+ list->lv_u.nonmat.lv_end = end;
+ list->lv_u.nonmat.lv_stride = stride;
list->lv_len = (end - start) / stride + 1;
}
}
@@ -5345,15 +5345,15 @@
{
if (list->lv_first == &range_list_item)
{
- varnumber_T start = list->lv_start;
- varnumber_T end = list->lv_end;
- int stride = list->lv_stride;
+ varnumber_T start = list->lv_u.nonmat.lv_start;
+ varnumber_T end = list->lv_u.nonmat.lv_end;
+ int stride = list->lv_u.nonmat.lv_stride;
varnumber_T i;
list->lv_first = NULL;
- list->lv_last = NULL;
+ list->lv_u.mat.lv_last = NULL;
list->lv_len = 0;
- list->lv_idx_item = NULL;
+ list->lv_u.mat.lv_idx_item = NULL;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
if (list_append_number(list, (varnumber_T)i) == FAIL)
break;