From d61efa50f8f5b9d9dcbc136705cc33874f0fdcb3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 23 Jul 2022 09:52:04 +0100 Subject: patch 9.0.0063: too many type casts for dict_get functions Problem: Too many type casts for dict_get functions. Solution: Change the key argument from "char_u *" to "char *". --- src/dict.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/dict.c') diff --git a/src/dict.c b/src/dict.c index d2819578a7..29608bd88c 100644 --- a/src/dict.c +++ b/src/dict.c @@ -662,11 +662,11 @@ dict_has_key(dict_T *d, char *key) * Returns FAIL if the entry doesn't exist or out of memory. */ int -dict_get_tv(dict_T *d, char_u *key, typval_T *rettv) +dict_get_tv(dict_T *d, char *key, typval_T *rettv) { dictitem_T *di; - di = dict_find(d, key, -1); + di = dict_find(d, (char_u *)key, -1); if (di == NULL) return FAIL; copy_tv(&di->di_tv, rettv); @@ -680,12 +680,12 @@ dict_get_tv(dict_T *d, char_u *key, typval_T *rettv) * Returns NULL if the entry doesn't exist or out of memory. */ char_u * -dict_get_string(dict_T *d, char_u *key, int save) +dict_get_string(dict_T *d, char *key, int save) { dictitem_T *di; char_u *s; - di = dict_find(d, key, -1); + di = dict_find(d, (char_u *)key, -1); if (di == NULL) return NULL; s = tv_get_string(&di->di_tv); @@ -699,7 +699,7 @@ dict_get_string(dict_T *d, char_u *key, int save) * Returns 0 if the entry doesn't exist. */ varnumber_T -dict_get_number(dict_T *d, char_u *key) +dict_get_number(dict_T *d, char *key) { return dict_get_number_def(d, key, 0); } @@ -709,11 +709,11 @@ dict_get_number(dict_T *d, char_u *key) * Returns "def" if the entry doesn't exist. */ varnumber_T -dict_get_number_def(dict_T *d, char_u *key, int def) +dict_get_number_def(dict_T *d, char *key, int def) { dictitem_T *di; - di = dict_find(d, key, -1); + di = dict_find(d, (char_u *)key, -1); if (di == NULL) return def; return tv_get_number(&di->di_tv); @@ -745,11 +745,11 @@ dict_get_number_check(dict_T *d, char_u *key) * Returns "def" if the entry doesn't exist. */ varnumber_T -dict_get_bool(dict_T *d, char_u *key, int def) +dict_get_bool(dict_T *d, char *key, int def) { dictitem_T *di; - di = dict_find(d, key, -1); + di = dict_find(d, (char_u *)key, -1); if (di == NULL) return def; return tv_get_bool(&di->di_tv); -- cgit v1.2.3