From 964b3746b9c81e65887e2ac9a335f181db2bb592 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 24 May 2019 18:54:09 +0200 Subject: patch 8.1.1384: using "int" for alloc() often results in compiler warnings 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. --- src/autocmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/autocmd.c') 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, -- cgit v1.2.1