Mercurial > vim
diff src/spellfile.c @ 16764:ef00b6bc186b v8.1.1384
patch 8.1.1384: using "int" for alloc() often results in compiler warnings
commit https://github.com/vim/vim/commit/964b3746b9c81e65887e2ac9a335f181db2bb592
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 18:54:09 2019 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 19:00:07 +0200 |
parents | b52ea9c5f1db |
children | 695d9ef00b03 |
line wrap: on
line diff
--- a/src/spellfile.c +++ b/src/spellfile.c @@ -1264,7 +1264,7 @@ read_compound(FILE *fd, slang_T *slang, c = todo * 2 + 7; if (enc_utf8) c += todo * 2; - pat = alloc((unsigned)c); + pat = alloc(c); if (pat == NULL) return SP_OTHERERROR; @@ -6615,7 +6615,7 @@ set_map_str(slang_T *lp, char_u *map) hash_T hash; hashitem_T *hi; - b = alloc((unsigned)(cl + headcl + 2)); + b = alloc(cl + headcl + 2); if (b == NULL) return; mb_char2bytes(c, b);