diff src/evalfunc.c @ 19229:d776967d0f0d v8.2.0173

patch 8.2.0173: build fails with old compiler Commit: https://github.com/vim/vim/commit/0ff6aad393c4130818fb4f49137380f78d7cc882 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 29 21:27:21 2020 +0100 patch 8.2.0173: build fails with old compiler Problem: Build fails with old compiler. Solution: Do not use anonymous unions. (John Marriott)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Jan 2020 21:30:05 +0100
parents e7b4fff348dd
children c077438ceb93
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4070,7 +4070,7 @@ f_index(typval_T *argvars, typval_T *ret
 	    // 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 @@ find_some_match(typval_T *argvars, typva
 	    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 @@ f_range(typval_T *argvars, typval_T *ret
 	// 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 @@ range_list_materialize(list_T *list)
 {
     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;