Mercurial > vim
diff src/if_py_both.h @ 16782:fc58fee685e2 v8.1.1393
patch 8.1.1393: unnecessary type casts
commit https://github.com/vim/vim/commit/51e14387f120392b74b84408cafec33942337a05
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 25 20:21:28 2019 +0200
patch 8.1.1393: unnecessary type casts
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 May 2019 20:30:06 +0200 |
parents | 9aa87f5aab55 |
children | ce04ebdf26b8 |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -2953,7 +2953,7 @@ FunctionNew(PyTypeObject *subtype, char_ char_u *np; size_t len = STRLEN(p) + 1; - if ((np = alloc((int)len + 2)) == NULL) + if ((np = alloc(len + 2)) == NULL) { vim_free(p); return NULL; @@ -3139,7 +3139,7 @@ set_partial(FunctionObject *self, partia if (exported) { pt->pt_argv = (typval_T *)alloc_clear( - sizeof(typval_T) * self->argc); + sizeof(typval_T) * self->argc); for (i = 0; i < pt->pt_argc; ++i) copy_tv(&self->argv[i], &pt->pt_argv[i]); } @@ -4262,7 +4262,7 @@ StringToLine(PyObject *obj) /* Create a copy of the string, with internal nulls replaced by * newline characters, as is the vim convention. */ - save = (char *)alloc((unsigned)(len+1)); + save = (char *)alloc(len+1); if (save == NULL) { PyErr_NoMemory();