0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.1393: unnecessary type casts

Problem:    Unnecessary type casts.
Solution:   Remove type casts from alloc() and lalloc() calls. (Mike Williams)
This commit is contained in:
Bram Moolenaar
2019-05-25 20:21:28 +02:00
parent 682725c141
commit 51e14387f1
31 changed files with 70 additions and 74 deletions

View File

@@ -2953,7 +2953,7 @@ FunctionNew(PyTypeObject *subtype, char_u *name, int argc, typval_T *argv,
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, partial_T *pt, int exported)
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();