1
0
forked from aniani/vim

patch 8.1.1384: using "int" for alloc() often results in compiler warnings

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.
This commit is contained in:
Bram Moolenaar
2019-05-24 18:54:09 +02:00
parent d33a764123
commit 964b3746b9
63 changed files with 293 additions and 322 deletions

View File

@@ -985,7 +985,7 @@ ins_char_bytes(char_u *buf, int charlen)
}
}
newp = alloc_check((unsigned)(linelen + newlen - oldlen));
newp = alloc(linelen + newlen - oldlen);
if (newp == NULL)
return;
@@ -1060,7 +1060,7 @@ ins_str(char_u *s)
oldp = ml_get(lnum);
oldlen = (int)STRLEN(oldp);
newp = alloc_check((unsigned)(oldlen + newlen + 1));
newp = alloc(oldlen + newlen + 1);
if (newp == NULL)
return;
if (col > 0)
@@ -1213,7 +1213,7 @@ del_bytes(
newp = oldp; // use same allocated memory
else
{ // need to allocate a new line
newp = alloc((unsigned)(newlen + 1));
newp = alloc(newlen + 1);
if (newp == NULL)
return FAIL;
mch_memmove(newp, oldp, (size_t)col);