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/ex_docmd.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/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index f4f7639e7..c6e00bec5 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5094,7 +5094,7 @@ repl_cmdline( i = (int)(src - *cmdlinep) + (int)STRLEN(src + srclen) + len + 3; if (eap->nextcmd != NULL) i += (int)STRLEN(eap->nextcmd);/* add space for next command */ - if ((new_cmdline = alloc((unsigned)i)) == NULL) + if ((new_cmdline = alloc(i)) == NULL) return NULL; /* out of memory! */ /* @@ -6547,7 +6547,7 @@ alist_unlink(alist_T *al) void alist_new(void) { - curwin->w_alist = (alist_T *)alloc((unsigned)sizeof(alist_T)); + curwin->w_alist = (alist_T *)alloc(sizeof(alist_T)); if (curwin->w_alist == NULL) { curwin->w_alist = &global_alist; @@ -6581,7 +6581,7 @@ alist_expand(int *fnum_list, int fnum_len) * expansion. Also, the vimrc file isn't read yet, thus the user * can't set the options. */ p_su = empty_option; - old_arg_files = (char_u **)alloc((unsigned)(sizeof(char_u *) * GARGCOUNT)); + old_arg_files = (char_u **)alloc(sizeof(char_u *) * GARGCOUNT); if (old_arg_files != NULL) { for (i = 0; i < GARGCOUNT; ++i) @@ -8839,7 +8839,7 @@ ex_normal(exarg_T *eap) } if (len > 0) { - arg = alloc((unsigned)(STRLEN(eap->arg) + len + 1)); + arg = alloc(STRLEN(eap->arg) + len + 1); if (arg != NULL) { len = 0; @@ -9628,7 +9628,7 @@ arg_all(void) } /* allocate memory */ - retval = alloc((unsigned)len + 1); + retval = alloc(len + 1); if (retval == NULL) break; } @@ -10622,7 +10622,7 @@ get_view_file(int c) for (p = sname; *p; ++p) if (*p == '=' || vim_ispathsep(*p)) ++len; - retval = alloc((unsigned)(STRLEN(sname) + len + STRLEN(p_vdir) + 9)); + retval = alloc(STRLEN(sname) + len + STRLEN(p_vdir) + 9); if (retval != NULL) { STRCPY(retval, p_vdir); |