patch 8.2.0967: unnecessary type casts for vim_strnsave()
Problem: Unnecessary type casts for vim_strnsave().
Solution: Remove the type casts.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index f59ec12..17c16d8 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1575,7 +1575,7 @@
RETURN_OK_IF_SKIP(cctx);
if ((isn = generate_instr(cctx, ISN_STRINGMEMBER)) == NULL)
return FAIL;
- isn->isn_arg.string = vim_strnsave(name, (int)len);
+ isn->isn_arg.string = vim_strnsave(name, len);
// check for dict type
type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
@@ -1671,7 +1671,7 @@
// entries. This is less efficient, but memory is cheap these days.
lvar->lv_idx = cctx->ctx_locals_count++;
- lvar->lv_name = vim_strnsave(name, (int)(len == 0 ? STRLEN(name) : len));
+ lvar->lv_name = vim_strnsave(name, len == 0 ? STRLEN(name) : len);
lvar->lv_const = isConst;
lvar->lv_type = type;
@@ -4627,7 +4627,7 @@
--p;
varlen = p - arg;
- name = vim_strnsave(arg, (int)varlen);
+ name = vim_strnsave(arg, varlen);
if (name == NULL)
return NULL;
@@ -6268,7 +6268,7 @@
{
if (p > start)
{
- generate_PUSHS(cctx, vim_strnsave(start, (int)(p - start)));
+ generate_PUSHS(cctx, vim_strnsave(start, p - start));
++count;
}
p += 2;