summaryrefslogtreecommitdiff
path: root/src/autocmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
commit964b3746b9c81e65887e2ac9a335f181db2bb592 (patch)
tree9afaaac41a1c4f71b359fd6706b88df00e22e7a1 /src/autocmd.c
parentd33a764123a8aedb20cd84aeff3b94810ee67c4c (diff)
downloadvim-git-964b3746b9c81e65887e2ac9a335f181db2bb592.tar.gz
patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384
Problem: Using "int" for alloc() often results in compiler warnings. Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim only works with 32 bit ints anyway.
Diffstat (limited to 'src/autocmd.c')
-rw-r--r--src/autocmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index e6cdb361e..614bc331f 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -1193,7 +1193,7 @@ do_autocmd_event(
return FAIL;
}
- ap = (AutoPat *)alloc((unsigned)sizeof(AutoPat));
+ ap = (AutoPat *)alloc(sizeof(AutoPat));
if (ap == NULL)
return FAIL;
ap->pat = vim_strnsave(pat, patlen);
@@ -1242,7 +1242,7 @@ do_autocmd_event(
prev_ac = &(ap->cmds);
while ((ac = *prev_ac) != NULL)
prev_ac = &ac->next;
- ac = (AutoCmd *)alloc((unsigned)sizeof(AutoCmd));
+ ac = (AutoCmd *)alloc(sizeof(AutoCmd));
if (ac == NULL)
return FAIL;
ac->cmd = vim_strsave(cmd);
@@ -2303,8 +2303,8 @@ auto_next_pat(
{
name = event_nr2name(apc->event);
s = _("%s Autocommands for \"%s\"");
- sourcing_name = alloc((unsigned)(STRLEN(s)
- + STRLEN(name) + ap->patlen + 1));
+ sourcing_name = alloc(STRLEN(s)
+ + STRLEN(name) + ap->patlen + 1);
if (sourcing_name != NULL)
{
sprintf((char *)sourcing_name, s,