patch 8.1.1393: unnecessary type casts
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
diff --git a/src/if_py_both.h b/src/if_py_both.h
index e36f4fd..bc33a80 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -2953,7 +2953,7 @@
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 @@
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 @@
/* 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();