Skip to content

Commit b8ed3aa

Browse files
committed
patch 8.2.0515: some compilers cannot add to "void *"
Problem: Some compilers cannot add to "void *". Solution: Cast to "char *".
1 parent bdff012 commit b8ed3aa

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
515,
741743
/**/
742744
514,
743745
/**/

src/vim9compile.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ func_type_add_arg_types(
368368
functype->tt_args = ALLOC_CLEAR_MULT(type_T *, argcount);
369369
if (functype->tt_args == NULL)
370370
return FAIL;
371-
((type_T **)type_gap->ga_data)[type_gap->ga_len] = (void *)functype->tt_args;
371+
((type_T **)type_gap->ga_data)[type_gap->ga_len] =
372+
(void *)functype->tt_args;
372373
++type_gap->ga_len;
373374

374375
functype->tt_argcount = argcount;
@@ -1846,7 +1847,7 @@ type_name(type_T *type, char **tofree)
18461847

18471848
if (i > 0)
18481849
{
1849-
STRCPY(ga.ga_data + ga.ga_len, ", ");
1850+
STRCPY((char *)ga.ga_data + ga.ga_len, ", ");
18501851
ga.ga_len += 2;
18511852
}
18521853
len = (int)STRLEN(arg_type);
@@ -1856,13 +1857,13 @@ type_name(type_T *type, char **tofree)
18561857
return "[unknown]";
18571858
}
18581859
*tofree = ga.ga_data;
1859-
STRCPY(ga.ga_data + ga.ga_len, arg_type);
1860+
STRCPY((char *)ga.ga_data + ga.ga_len, arg_type);
18601861
ga.ga_len += len;
18611862
vim_free(arg_free);
18621863
}
18631864

18641865
if (type->tt_member == &t_void)
1865-
STRCPY(ga.ga_data + ga.ga_len, ")");
1866+
STRCPY((char *)ga.ga_data + ga.ga_len, ")");
18661867
else
18671868
{
18681869
char *ret_free;
@@ -1876,8 +1877,8 @@ type_name(type_T *type, char **tofree)
18761877
return "[unknown]";
18771878
}
18781879
*tofree = ga.ga_data;
1879-
STRCPY(ga.ga_data + ga.ga_len, "): ");
1880-
STRCPY(ga.ga_data + ga.ga_len + 3, ret_name);
1880+
STRCPY((char *)ga.ga_data + ga.ga_len, "): ");
1881+
STRCPY((char *)ga.ga_data + ga.ga_len + 3, ret_name);
18811882
vim_free(ret_free);
18821883
}
18831884
return ga.ga_data;

0 commit comments

Comments
 (0)