changeset 19918:ccfeae6af59e v8.2.0515

patch 8.2.0515: some compilers cannot add to "void *" Commit: https://github.com/vim/vim/commit/b8ed3aa9e708ec0af4e9ee8921ad198f0e949c0d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 5 19:09:05 2020 +0200 patch 8.2.0515: some compilers cannot add to "void *" Problem: Some compilers cannot add to "void *". Solution: Cast to "char *".
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Apr 2020 19:15:33 +0200
parents 94b3ff2cc739
children b4b102849236
files src/version.c src/vim9compile.c
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    515,
+/**/
     514,
 /**/
     513,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -368,7 +368,8 @@ func_type_add_arg_types(
     functype->tt_args = ALLOC_CLEAR_MULT(type_T *, argcount);
     if (functype->tt_args == NULL)
 	return FAIL;
-    ((type_T **)type_gap->ga_data)[type_gap->ga_len] = (void *)functype->tt_args;
+    ((type_T **)type_gap->ga_data)[type_gap->ga_len] =
+						     (void *)functype->tt_args;
     ++type_gap->ga_len;
 
     functype->tt_argcount = argcount;
@@ -1846,7 +1847,7 @@ type_name(type_T *type, char **tofree)
 
 	    if (i > 0)
 	    {
-		STRCPY(ga.ga_data + ga.ga_len, ", ");
+		STRCPY((char *)ga.ga_data + ga.ga_len, ", ");
 		ga.ga_len += 2;
 	    }
 	    len = (int)STRLEN(arg_type);
@@ -1856,13 +1857,13 @@ type_name(type_T *type, char **tofree)
 		return "[unknown]";
 	    }
 	    *tofree = ga.ga_data;
-	    STRCPY(ga.ga_data + ga.ga_len, arg_type);
+	    STRCPY((char *)ga.ga_data + ga.ga_len, arg_type);
 	    ga.ga_len += len;
 	    vim_free(arg_free);
 	}
 
 	if (type->tt_member == &t_void)
-	    STRCPY(ga.ga_data + ga.ga_len, ")");
+	    STRCPY((char *)ga.ga_data + ga.ga_len, ")");
 	else
 	{
 	    char *ret_free;
@@ -1876,8 +1877,8 @@ type_name(type_T *type, char **tofree)
 		return "[unknown]";
 	    }
 	    *tofree = ga.ga_data;
-	    STRCPY(ga.ga_data + ga.ga_len, "): ");
-	    STRCPY(ga.ga_data + ga.ga_len + 3, ret_name);
+	    STRCPY((char *)ga.ga_data + ga.ga_len, "): ");
+	    STRCPY((char *)ga.ga_data + ga.ga_len + 3, ret_name);
 	    vim_free(ret_free);
 	}
 	return ga.ga_data;