summaryrefslogtreecommitdiffstats
path: root/src/misc1.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/misc1.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/misc1.c')
-rw-r--r--src/misc1.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 550a7273e2..bb82f0903a 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2180,7 +2180,7 @@ vim_getenv(char_u *name, int *mustfree)
pend1 = remove_tail(p, pend, (char_u *)"MacOS");
if (pend1 != pend)
{
- pnew = alloc((unsigned)(pend1 - p) + 15);
+ pnew = alloc(pend1 - p + 15);
if (pnew != NULL)
{
STRNCPY(pnew, p, (pend1 - p));
@@ -2341,7 +2341,7 @@ vim_setenv(char_u *name, char_u *val)
* Putenv does not copy the string, it has to remain
* valid. The allocated memory will never be freed.
*/
- envbuf = alloc((unsigned)(STRLEN(name) + STRLEN(val) + 2));
+ envbuf = alloc(STRLEN(name) + STRLEN(val) + 2);
if (envbuf != NULL)
{
sprintf((char *)envbuf, "%s=%s", name, val);
@@ -3019,7 +3019,7 @@ concat_fnames(char_u *fname1, char_u *fname2, int sep)
{
char_u *dest;
- dest = alloc((unsigned)(STRLEN(fname1) + STRLEN(fname2) + 3));
+ dest = alloc(STRLEN(fname1) + STRLEN(fname2) + 3);
if (dest != NULL)
{
STRCPY(dest, fname1);
@@ -3040,7 +3040,7 @@ concat_str(char_u *str1, char_u *str2)
char_u *dest;
size_t l = STRLEN(str1);
- dest = alloc((unsigned)(l + STRLEN(str2) + 1L));
+ dest = alloc(l + STRLEN(str2) + 1L);
if (dest != NULL)
{
STRCPY(dest, str1);
@@ -3076,7 +3076,7 @@ FullName_save(
if (fname == NULL)
return NULL;
- buf = alloc((unsigned)MAXPATHL);
+ buf = alloc(MAXPATHL);
if (buf != NULL)
{
if (vim_FullName(fname, buf, MAXPATHL, force) != FAIL)
@@ -4231,7 +4231,7 @@ addfile(
if (ga_grow(gap, 1) == FAIL)
return;
- p = alloc((unsigned)(STRLEN(f) + 1 + isdir));
+ p = alloc(STRLEN(f) + 1 + isdir);
if (p == NULL)
return;