diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-24 18:54:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-24 18:54:09 +0200 |
commit | 964b3746b9c81e65887e2ac9a335f181db2bb592 (patch) | |
tree | 9afaaac41a1c4f71b359fd6706b88df00e22e7a1 /src/userfunc.c | |
parent | d33a764123a8aedb20cd84aeff3b94810ee67c4c (diff) | |
download | vim-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/userfunc.c')
-rw-r--r-- | src/userfunc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 763903f85..dcf803401 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -557,7 +557,7 @@ fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error) } else { - fname = alloc((unsigned)(i + STRLEN(name + llen) + 1)); + fname = alloc(i + STRLEN(name + llen) + 1); if (fname == NULL) *error = ERROR_OTHER; else @@ -978,7 +978,7 @@ call_user_func( /* need space for function name + ("function " + 3) or "[number]" */ len = (save_sourcing_name == NULL ? 0 : STRLEN(save_sourcing_name)) + STRLEN(fp->uf_name) + 20; - sourcing_name = alloc((unsigned)len); + sourcing_name = alloc(len); if (sourcing_name != NULL) { if (save_sourcing_name != NULL @@ -1932,7 +1932,7 @@ trans_function_name( } } - name = alloc((unsigned)(len + lead + 1)); + name = alloc(len + lead + 1); if (name != NULL) { if (lead > 0) @@ -2787,7 +2787,7 @@ func_dump_profile(FILE *fd) if (todo == 0) return; /* nothing to dump */ - sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T *) * todo)); + sorttab = (ufunc_T **)alloc(sizeof(ufunc_T *) * todo); for (hi = func_hashtab.ht_array; todo > 0; ++hi) { |