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/change.c | |
parent | d33a764123a8aedb20cd84aeff3b94810ee67c4c (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/change.c')
-rw-r--r-- | src/change.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/change.c b/src/change.c index b43ba35745..d2aa1530f1 100644 --- a/src/change.c +++ b/src/change.c @@ -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); |