summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-28 23:08:19 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-28 23:08:19 +0200
commitc799fe206e61f2e2c1231bc46cbe4bb354f3da69 (patch)
tree68b3d2a8bb82519e29fc95f317d2ee02b07f95fa /src/os_unix.c
parentb58a4b938c4bc7e0499700859bd7abba9acc5b11 (diff)
downloadvim-git-c799fe206e61f2e2c1231bc46cbe4bb354f3da69.tar.gz
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type castsv8.1.1414
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.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 803f9441c..01f5f5946 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -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++)