0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts

Problem:    Alloc() returning "char_u *" causes a lot of type casts.
Solution:   Have it return "void *". (Mike Williams)  Define ALLOC_ONE() to
            check the simple allocations.
This commit is contained in:
Bram Moolenaar
2019-05-28 23:08:19 +02:00
parent b58a4b938c
commit c799fe206e
77 changed files with 381 additions and 418 deletions

View File

@@ -3210,7 +3210,7 @@ mch_early_init(void)
* Ignore any errors.
*/
#if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
signal_stack = (char *)alloc(SIGSTKSZ);
signal_stack = alloc(SIGSTKSZ);
init_signal_stack();
#endif
}
@@ -6843,7 +6843,7 @@ mch_expand_wildcards(
goto notfound;
}
*num_file = i;
*file = (char_u **)alloc(sizeof(char_u *) * i);
*file = ALLOC_MULT(char_u *, i);
if (*file == NULL)
{
/* out of memory */
@@ -6938,7 +6938,7 @@ save_patterns(
int i;
char_u *s;
*file = (char_u **)alloc(num_pat * sizeof(char_u *));
*file = ALLOC_MULT(char_u *, num_pat);
if (*file == NULL)
return FAIL;
for (i = 0; i < num_pat; i++)