summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-23 09:52:04 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-23 09:52:04 +0100
commitd61efa50f8f5b9d9dcbc136705cc33874f0fdcb3 (patch)
tree7ca7416ffda546d9f45ba93d3c93f3418bd6bcd0 /src/dict.c
parent5ac50de83f1b4136f903c51a1d4e7d84a26c2271 (diff)
patch 9.0.0063: too many type casts for dict_get functionsv9.0.0063
Problem: Too many type casts for dict_get functions. Solution: Change the key argument from "char_u *" to "char *".
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c18
1 files changed, 9 insertions, 9 deletions
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);