summaryrefslogtreecommitdiffstats
path: root/src/fileio.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/fileio.c
parentd33a764123a8aedb20cd84aeff3b94810ee67c4c (diff)
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/fileio.c')
-rw-r--r--src/fileio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 57c5f47fc6..e41f967622 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6203,7 +6203,7 @@ buf_modname(
*/
if (fname == NULL || *fname == NUL)
{
- retval = alloc((unsigned)(MAXPATHL + extlen + 3));
+ retval = alloc(MAXPATHL + extlen + 3);
if (retval == NULL)
return NULL;
if (mch_dirname(retval, MAXPATHL) == FAIL ||
@@ -6222,7 +6222,7 @@ buf_modname(
else
{
fnamelen = (int)STRLEN(fname);
- retval = alloc((unsigned)(fnamelen + extlen + 3));
+ retval = alloc(fnamelen + extlen + 3);
if (retval == NULL)
return NULL;
STRCPY(retval, fname);
@@ -6894,8 +6894,8 @@ buf_check_timestamp(
{
if (!helpmesg)
mesg2 = "";
- tbuf = (char *)alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
- + STRLEN(mesg2) + 2));
+ tbuf = (char *)alloc(STRLEN(path) + STRLEN(mesg)
+ + STRLEN(mesg2) + 2);
sprintf(tbuf, mesg, path);
#ifdef FEAT_EVAL
/* Set warningmsg here, before the unimportant and output-specific
@@ -7391,7 +7391,7 @@ vim_settempdir(char_u *tempdir)
{
char_u *buf;
- buf = alloc((unsigned)MAXPATHL + 2);
+ buf = alloc(MAXPATHL + 2);
if (buf != NULL)
{
if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL)