summaryrefslogtreecommitdiff
path: root/src/memfile.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/memfile.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/memfile.c')
-rw-r--r--src/memfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/memfile.c b/src/memfile.c
index 1827bcf2b..9a1b4cb1c 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -130,7 +130,7 @@ mf_open(char_u *fname, int flags)
struct STATFS stf;
#endif
- if ((mfp = (memfile_T *)alloc((unsigned)sizeof(memfile_T))) == NULL)
+ if ((mfp = (memfile_T *)alloc(sizeof(memfile_T))) == NULL)
return NULL;
if (fname == NULL) /* no file for this memfile, use memory only */
@@ -893,7 +893,7 @@ mf_alloc_bhdr(memfile_T *mfp, int page_count)
{
bhdr_T *hp;
- if ((hp = (bhdr_T *)alloc((unsigned)sizeof(bhdr_T))) != NULL)
+ if ((hp = (bhdr_T *)alloc(sizeof(bhdr_T))) != NULL)
{
if ((hp->bh_data = (char_u *)alloc(mfp->mf_page_size * page_count))
== NULL)
@@ -1108,7 +1108,7 @@ mf_trans_add(memfile_T *mfp, bhdr_T *hp)
if (hp->bh_bnum >= 0) /* it's already positive */
return OK;
- if ((np = (NR_TRANS *)alloc((unsigned)sizeof(NR_TRANS))) == NULL)
+ if ((np = (NR_TRANS *)alloc(sizeof(NR_TRANS))) == NULL)
return FAIL;
/*