aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2023-04-07 21:08:16 +0200
committerGitHub <noreply@github.com>2023-04-07 21:08:16 +0200
commit04933b1ea968f958d2541dd65fd33ebb503caac3 (patch)
tree430e333892c440dccce4d1b4606c83ab36f817c5 /src/nvim/eval.c
parent9408f2dcf7cade2631688300e9b58eed6bc5219a (diff)
downloadrneovim-04933b1ea968f958d2541dd65fd33ebb503caac3.tar.gz
rneovim-04933b1ea968f958d2541dd65fd33ebb503caac3.tar.bz2
rneovim-04933b1ea968f958d2541dd65fd33ebb503caac3.zip
refactor: remove redundant casts
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index f875e4f06f..f0b0e88b50 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -396,11 +396,11 @@ void eval_init(void)
// add to v: scope dict, unless the value is not always available
if (p->vv_type != VAR_UNKNOWN) {
- hash_add(&vimvarht, (char *)p->vv_di.di_key);
+ hash_add(&vimvarht, p->vv_di.di_key);
}
if (p->vv_flags & VV_COMPAT) {
// add to compat scope dict
- hash_add(&compat_hashtab, (char *)p->vv_di.di_key);
+ hash_add(&compat_hashtab, p->vv_di.di_key);
}
}
vimvars[VV_VERSION].vv_nr = VIM_VERSION_100;
@@ -3035,7 +3035,7 @@ static int eval7_leader(typval_T *const rettv, const bool numeric_only,
const char *const start_leader, const char **const end_leaderp)
FUNC_ATTR_NONNULL_ALL
{
- const char *end_leader = (char *)(*end_leaderp);
+ const char *end_leader = *end_leaderp;
int ret = OK;
bool error = false;
varnumber_T val = 0;
@@ -3263,7 +3263,7 @@ static int eval_index(char **arg, typval_T *rettv, int evaluate, int verbose)
bool empty2 = false;
ptrdiff_t len = -1;
int range = false;
- char *key = NULL;
+ const char *key = NULL;
switch (rettv->v_type) {
case VAR_FUNC:
@@ -3512,7 +3512,7 @@ static int eval_index(char **arg, typval_T *rettv, int evaluate, int verbose)
}
if (len == -1) {
- key = (char *)tv_get_string_chk(&var1);
+ key = tv_get_string_chk(&var1);
if (key == NULL) {
tv_clear(&var1);
return FAIL;
@@ -7607,7 +7607,7 @@ const void *var_shada_iter(const void *const iter, const char **const name, typv
} else {
hi = (const hashitem_T *)iter;
}
- *name = (char *)TV_DICT_HI2DI(hi)->di_key;
+ *name = TV_DICT_HI2DI(hi)->di_key;
tv_copy(&TV_DICT_HI2DI(hi)->di_tv, rettv);
while ((size_t)(++hi - hifirst) < hinum) {
if (!HASHITEM_EMPTY(hi) && (var_flavour(hi->hi_key) & flavour)) {
@@ -7944,7 +7944,7 @@ repeat:
// "path/to/this.file.ext" :r:r:r
// ^ ^------------- tail
// +--------------------- *fnamep
- if (s > MAX(tail, (char *)(*fnamep))) {
+ if (s > MAX(tail, *fnamep)) {
*fnamelen = (size_t)(s - *fnamep);
}
}