Problem: Too many type casts for dict_get functions.
Solution: Change the key argument from "char_u *" to "char *".
}
}
- group_name = dict_get_string(event_dict, (char_u *)"group", TRUE);
+ group_name = dict_get_string(event_dict, "group", TRUE);
if (group_name == NULL || *group_name == NUL)
// if the autocmd group name is not specified, then use the current
// autocmd group
{
varnumber_T bnum;
- bnum = dict_get_number_def(event_dict, (char_u *)"bufnr", -1);
+ bnum = dict_get_number_def(event_dict, "bufnr", -1);
if (bnum == -1)
continue;
pat = (char_u *)"";
}
- once = dict_get_bool(event_dict, (char_u *)"once", FALSE);
- nested = dict_get_bool(event_dict, (char_u *)"nested", FALSE);
+ once = dict_get_bool(event_dict, "once", FALSE);
+ nested = dict_get_bool(event_dict, "nested", FALSE);
// if 'replace' is true, then remove all the commands associated with
// this autocmd event/group and add the new command.
- replace = dict_get_bool(event_dict, (char_u *)"replace", FALSE);
+ replace = dict_get_bool(event_dict, "replace", FALSE);
- cmd = dict_get_string(event_dict, (char_u *)"cmd", TRUE);
+ cmd = dict_get_string(event_dict, "cmd", TRUE);
if (cmd == NULL)
{
if (delete)
// return only the autocmds in the specified group
if (dict_has_key(argvars[0].vval.v_dict, "group"))
{
- name = dict_get_string(argvars[0].vval.v_dict,
- (char_u *)"group", TRUE);
+ name = dict_get_string(argvars[0].vval.v_dict, "group", TRUE);
if (name == NULL)
return;
{
int i;
- name = dict_get_string(argvars[0].vval.v_dict,
- (char_u *)"event", TRUE);
+ name = dict_get_string(argvars[0].vval.v_dict, "event", TRUE);
if (name == NULL)
return;
// return only the autocmds for the specified pattern
if (dict_has_key(argvars[0].vval.v_dict, "pattern"))
{
- pat = dict_get_string(argvars[0].vval.v_dict,
- (char_u *)"pattern", TRUE);
+ pat = dict_get_string(argvars[0].vval.v_dict, "pattern", TRUE);
if (pat == NULL)
return;
}
FOR_ALL_LIST_ITEMS(buf->b_recorded_changes, li)
{
prev_lnum = (linenr_T)dict_get_number(
- li->li_tv.vval.v_dict, (char_u *)"lnum");
+ li->li_tv.vval.v_dict, "lnum");
prev_lnume = (linenr_T)dict_get_number(
- li->li_tv.vval.v_dict, (char_u *)"end");
+ li->li_tv.vval.v_dict, "end");
if (prev_lnum >= lnum || prev_lnum > lnume || prev_lnume >= lnum)
{
// the current change is going to make the line number in
{
varnumber_T lnum;
- lnum = dict_get_number(li->li_tv.vval.v_dict, (char_u *)"lnum");
+ lnum = dict_get_number(li->li_tv.vval.v_dict, "lnum");
if (start > lnum)
start = lnum;
- lnum = dict_get_number(li->li_tv.vval.v_dict, (char_u *)"end");
+ lnum = dict_get_number(li->li_tv.vval.v_dict, "end");
if (end < lnum)
end = lnum;
- added += dict_get_number(li->li_tv.vval.v_dict, (char_u *)"added");
+ added += dict_get_number(li->li_tv.vval.v_dict, "added");
}
argv[1].v_type = VAR_NUMBER;
argv[1].vval.v_number = start;
* 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);
* 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);
* 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);
}
* 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);
* 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);
if (sel_d != NULL)
{
filtered = TRUE;
- sel_buflisted = dict_get_bool(sel_d, (char_u *)"buflisted", FALSE);
- sel_bufloaded = dict_get_bool(sel_d, (char_u *)"bufloaded", FALSE);
- sel_bufmodified = dict_get_bool(sel_d, (char_u *)"bufmodified",
+ sel_buflisted = dict_get_bool(sel_d, "buflisted", FALSE);
+ sel_bufloaded = dict_get_bool(sel_d, "bufloaded", FALSE);
+ sel_bufmodified = dict_get_bool(sel_d, "bufmodified",
FALSE);
}
}
return;
if (argvars[1].v_type == VAR_DICT
- && dict_get_bool(argvars[1].vval.v_dict, (char_u *)"errmsg",
- VVAL_FALSE))
+ && dict_get_bool(argvars[1].vval.v_dict, "errmsg", VVAL_FALSE))
emsgoff = FALSE;
rettv->v_type = VAR_STRING;
if ((d = argvars[0].vval.v_dict) != NULL)
{
- csearch = dict_get_string(d, (char_u *)"char", FALSE);
+ csearch = dict_get_string(d, "char", FALSE);
if (csearch != NULL)
{
if (enc_utf8)
if (di != NULL)
regcontents = &di->di_tv;
- stropt = dict_get_string(d, (char_u *)"regtype", FALSE);
+ stropt = dict_get_string(d, "regtype", FALSE);
if (stropt != NULL)
{
int ret = get_yank_type(&stropt, &yank_type, &block_len);
if (regname == '"')
{
- stropt = dict_get_string(d, (char_u *)"points_to", FALSE);
+ stropt = dict_get_string(d, "points_to", FALSE);
if (stropt != NULL)
{
pointreg = *stropt;
regname = pointreg;
}
}
- else if (dict_get_bool(d, (char_u *)"isunnamed", -1) > 0)
+ else if (dict_get_bool(d, "isunnamed", -1) > 0)
pointreg = regname;
}
else
}
d = argvars[2].vval.v_dict;
- if (dict_get_bool(d, (char_u *)"vertical", FALSE))
+ if (dict_get_bool(d, "vertical", FALSE))
flags |= WSP_VERT;
if ((di = dict_find(d, (char_u *)"rightbelow", -1)) != NULL)
flags |= tv_get_bool(&di->di_tv) ? WSP_BELOW : WSP_ABOVE;
- size = (int)dict_get_number(d, (char_u *)"size");
+ size = (int)dict_get_number(d, "size");
}
win_move_into_split(wp, targetwin, size, flags);
else
{
if (dict_has_key(dict, "lnum"))
- curwin->w_cursor.lnum = (linenr_T)dict_get_number(dict, (char_u *)"lnum");
+ curwin->w_cursor.lnum = (linenr_T)dict_get_number(dict, "lnum");
if (dict_has_key(dict, "col"))
- curwin->w_cursor.col = (colnr_T)dict_get_number(dict, (char_u *)"col");
+ curwin->w_cursor.col = (colnr_T)dict_get_number(dict, "col");
if (dict_has_key(dict, "coladd"))
- curwin->w_cursor.coladd = (colnr_T)dict_get_number(dict, (char_u *)"coladd");
+ curwin->w_cursor.coladd = (colnr_T)dict_get_number(dict, "coladd");
if (dict_has_key(dict, "curswant"))
{
- curwin->w_curswant = (colnr_T)dict_get_number(dict, (char_u *)"curswant");
+ curwin->w_curswant = (colnr_T)dict_get_number(dict, "curswant");
curwin->w_set_curswant = FALSE;
}
if (dict_has_key(dict, "topline"))
- set_topline(curwin, (linenr_T)dict_get_number(dict, (char_u *)"topline"));
+ set_topline(curwin, (linenr_T)dict_get_number(dict, "topline"));
#ifdef FEAT_DIFF
if (dict_has_key(dict, "topfill"))
- curwin->w_topfill = (int)dict_get_number(dict, (char_u *)"topfill");
+ curwin->w_topfill = (int)dict_get_number(dict, "topfill");
#endif
if (dict_has_key(dict, "leftcol"))
- curwin->w_leftcol = (colnr_T)dict_get_number(dict, (char_u *)"leftcol");
+ curwin->w_leftcol = (colnr_T)dict_get_number(dict, "leftcol");
if (dict_has_key(dict, "skipcol"))
- curwin->w_skipcol = (colnr_T)dict_get_number(dict, (char_u *)"skipcol");
+ curwin->w_skipcol = (colnr_T)dict_get_number(dict, "skipcol");
check_cursor();
win_new_height(curwin, curwin->w_height);
{
char_u *name1, *name2;
- name1 = dict_get_string(*(dict_T**)p1, (char_u*)"name", FALSE);
- name2 = dict_get_string(*(dict_T**)p2, (char_u*)"name", FALSE);
+ name1 = dict_get_string(*(dict_T**)p1, "name", FALSE);
+ name2 = dict_get_string(*(dict_T**)p2, "name", FALSE);
if (readdirex_sort == READDIR_SORT_BYTE)
return STRCMP(name1, name2);
else if (readdirex_sort == READDIR_SORT_IC)
}
if (dict_has_key(tv->vval.v_dict, "sort"))
- compare = dict_get_string(tv->vval.v_dict, (char_u *)"sort", FALSE);
+ compare = dict_get_string(tv->vval.v_dict, "sort", FALSE);
else
{
semsg(_(e_dictionary_key_str_required), "sort");
char_u *event;
INPUT inputs[1];
- event = dict_get_string(args, (char_u *)"event", TRUE);
+ event = dict_get_string(args, "event", TRUE);
if (event == NULL)
return FALSE;
{
WORD vkCode;
- vkCode = dict_get_number_def(args, (char_u *)"keycode", 0);
+ vkCode = dict_get_number_def(args, "keycode", 0);
if (vkCode <= 0 || vkCode >= 0xFF)
{
semsg(_(e_invalid_argument_nr), (long)vkCode);
p = attr_str;
for (i = 0; i < (int)ARRAY_LENGTH(hl_name_table); i++)
{
- if (dict_get_bool(attrdict, (char_u *)hl_name_table[i],
- VVAL_FALSE) == VVAL_TRUE)
+ if (dict_get_bool(attrdict, hl_name_table[i], VVAL_FALSE) == VVAL_TRUE)
{
if (p != attr_str && (size_t)(p - attr_str + 2) < len)
STRCPY(p, (char_u *)",");
if (name == NULL || *name == NUL || error)
return FALSE;
- if (dict_get_bool(dict, (char_u *)"force", VVAL_FALSE) == VVAL_TRUE)
+ if (dict_get_bool(dict, "force", VVAL_FALSE) == VVAL_TRUE)
forceit = TRUE;
- if (dict_get_bool(dict, (char_u *)"default", VVAL_FALSE) == VVAL_TRUE)
+ if (dict_get_bool(dict, "default", VVAL_FALSE) == VVAL_TRUE)
dodefault = TRUE;
if (dict_has_key(dict, "cleared"))
varnumber_T cleared;
// clear a highlight group
- cleared = dict_get_bool(dict, (char_u *)"cleared", FALSE);
+ cleared = dict_get_bool(dict, "cleared", FALSE);
if (cleared == TRUE)
{
vim_snprintf((char *)hlsetBuf, HLSETBUFSZ, "clear %s", name);
user_data.v_type = VAR_UNKNOWN;
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
{
- word = dict_get_string(tv->vval.v_dict, (char_u *)"word", FALSE);
- cptext[CPT_ABBR] = dict_get_string(tv->vval.v_dict,
- (char_u *)"abbr", FALSE);
- cptext[CPT_MENU] = dict_get_string(tv->vval.v_dict,
- (char_u *)"menu", FALSE);
- cptext[CPT_KIND] = dict_get_string(tv->vval.v_dict,
- (char_u *)"kind", FALSE);
- cptext[CPT_INFO] = dict_get_string(tv->vval.v_dict,
- (char_u *)"info", FALSE);
- dict_get_tv(tv->vval.v_dict, (char_u *)"user_data", &user_data);
- if (dict_get_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL
- && dict_get_number(tv->vval.v_dict, (char_u *)"icase"))
+ word = dict_get_string(tv->vval.v_dict, "word", FALSE);
+ cptext[CPT_ABBR] = dict_get_string(tv->vval.v_dict, "abbr", FALSE);
+ cptext[CPT_MENU] = dict_get_string(tv->vval.v_dict, "menu", FALSE);
+ cptext[CPT_KIND] = dict_get_string(tv->vval.v_dict, "kind", FALSE);
+ cptext[CPT_INFO] = dict_get_string(tv->vval.v_dict, "info", FALSE);
+ dict_get_tv(tv->vval.v_dict, "user_data", &user_data);
+ if (dict_get_string(tv->vval.v_dict, "icase", FALSE) != NULL
+ && dict_get_number(tv->vval.v_dict, "icase"))
flags |= CP_ICASE;
- if (dict_get_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
- dup = dict_get_number(tv->vval.v_dict, (char_u *)"dup");
- if (dict_get_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
- empty = dict_get_number(tv->vval.v_dict, (char_u *)"empty");
- if (dict_get_string(tv->vval.v_dict, (char_u *)"equal", FALSE) != NULL
- && dict_get_number(tv->vval.v_dict, (char_u *)"equal"))
+ if (dict_get_string(tv->vval.v_dict, "dup", FALSE) != NULL)
+ dup = dict_get_number(tv->vval.v_dict, "dup");
+ if (dict_get_string(tv->vval.v_dict, "empty", FALSE) != NULL)
+ empty = dict_get_number(tv->vval.v_dict, "empty");
+ if (dict_get_string(tv->vval.v_dict, "equal", FALSE) != NULL
+ && dict_get_number(tv->vval.v_dict, "equal"))
flags |= CP_EQUAL;
}
else
if (dict_only)
{
d = argvars[0].vval.v_dict;
- which = dict_get_string(d, (char_u *)"mode", FALSE);
- is_abbr = dict_get_bool(d, (char_u *)"abbr", -1);
+ which = dict_get_string(d, "mode", FALSE);
+ is_abbr = dict_get_bool(d, "abbr", -1);
if (which == NULL || is_abbr < 0)
{
emsg(_(e_entries_missing_in_mapset_dict_argument));
// Get the values in the same order as above in get_maparg().
- lhs = dict_get_string(d, (char_u *)"lhs", FALSE);
- lhsraw = dict_get_string(d, (char_u *)"lhsraw", FALSE);
- lhsrawalt = dict_get_string(d, (char_u *)"lhsrawalt", FALSE);
- rhs = dict_get_string(d, (char_u *)"rhs", FALSE);
+ lhs = dict_get_string(d, "lhs", FALSE);
+ lhsraw = dict_get_string(d, "lhsraw", FALSE);
+ lhsrawalt = dict_get_string(d, "lhsrawalt", FALSE);
+ rhs = dict_get_string(d, "rhs", FALSE);
if (lhs == NULL || lhsraw == NULL || rhs == NULL)
{
emsg(_(e_entries_missing_in_mapset_dict_argument));
rhs = replace_termcodes(rhs, &arg_buf,
REPTERM_DO_LT | REPTERM_SPECIAL, NULL);
- noremap = dict_get_number(d, (char_u *)"noremap") ? REMAP_NONE: 0;
- if (dict_get_number(d, (char_u *)"script") != 0)
+ noremap = dict_get_number(d, "noremap") ? REMAP_NONE: 0;
+ if (dict_get_number(d, "script") != 0)
noremap = REMAP_SCRIPT;
- expr = dict_get_number(d, (char_u *)"expr") != 0;
- silent = dict_get_number(d, (char_u *)"silent") != 0;
- sid = dict_get_number(d, (char_u *)"sid");
- scriptversion = dict_get_number(d, (char_u *)"scriptversion");
- lnum = dict_get_number(d, (char_u *)"lnum");
- buffer = dict_get_number(d, (char_u *)"buffer");
- nowait = dict_get_number(d, (char_u *)"nowait") != 0;
+ expr = dict_get_number(d, "expr") != 0;
+ silent = dict_get_number(d, "silent") != 0;
+ sid = dict_get_number(d, "sid");
+ scriptversion = dict_get_number(d, "scriptversion");
+ lnum = dict_get_number(d, "lnum");
+ buffer = dict_get_number(d, "buffer");
+ nowait = dict_get_number(d, "nowait") != 0;
// mode from the dict is not used
if (buffer)
}
if (dict_has_key(tv->vval.v_dict, "conceal"))
- *conceal_char = dict_get_string(tv->vval.v_dict,
- (char_u *)"conceal", FALSE);
+ *conceal_char = dict_get_string(tv->vval.v_dict, "conceal", FALSE);
if ((di = dict_find(tv->vval.v_dict, (char_u *)"window", -1)) != NULL)
{
}
}
- group = dict_get_string(d, (char_u *)"group", TRUE);
- priority = (int)dict_get_number(d, (char_u *)"priority");
- id = (int)dict_get_number(d, (char_u *)"id");
+ group = dict_get_string(d, "group", TRUE);
+ priority = (int)dict_get_number(d, "priority");
+ id = (int)dict_get_number(d, "id");
conceal = dict_has_key(d, "conceal")
- ? dict_get_string(d, (char_u *)"conceal", TRUE)
+ ? dict_get_string(d, "conceal", TRUE)
: NULL;
if (i == 0)
{
match_add(win, group,
- dict_get_string(d, (char_u *)"pattern", FALSE),
+ dict_get_string(d, "pattern", FALSE),
priority, id, NULL, conceal);
}
else
static poppos_T
get_pos_entry(dict_T *d, int give_error)
{
- char_u *str = dict_get_string(d, (char_u *)"pos", FALSE);
+ char_u *str = dict_get_string(d, "pos", FALSE);
int nr;
if (str == NULL)
char_u *str;
dictitem_T *di;
- if ((nr = dict_get_number_def(d, (char_u *)"minwidth", -1)) >= 0)
+ if ((nr = dict_get_number_def(d, "minwidth", -1)) >= 0)
wp->w_minwidth = nr;
- if ((nr = dict_get_number_def(d, (char_u *)"minheight", -1)) >= 0)
+ if ((nr = dict_get_number_def(d, "minheight", -1)) >= 0)
wp->w_minheight = nr;
- if ((nr = dict_get_number_def(d, (char_u *)"maxwidth", -1)) >= 0)
+ if ((nr = dict_get_number_def(d, "maxwidth", -1)) >= 0)
wp->w_maxwidth = nr;
- if ((nr = dict_get_number_def(d, (char_u *)"maxheight", -1)) >= 0)
+ if ((nr = dict_get_number_def(d, "maxheight", -1)) >= 0)
wp->w_maxheight = nr;
nr = popup_options_one(d, (char_u *)"line");
wp->w_wantcol = nr;
- nr = dict_get_bool(d, (char_u *)"fixed", -1);
+ nr = dict_get_bool(d, "fixed", -1);
if (nr != -1)
wp->w_popup_fixed = nr != 0;
wp->w_popup_pos = ppt;
}
- str = dict_get_string(d, (char_u *)"textprop", FALSE);
+ str = dict_get_string(d, "textprop", FALSE);
if (str != NULL)
{
wp->w_popup_prop_type = 0;
di = dict_find(d, (char_u *)"textpropid", -1);
if (di != NULL)
- wp->w_popup_prop_id = dict_get_number(d, (char_u *)"textpropid");
+ wp->w_popup_prop_id = dict_get_number(d, "textpropid");
}
/*
di = dict_find(dict, (char_u *)"firstline", -1);
if (di != NULL)
{
- wp->w_firstline = dict_get_number(dict, (char_u *)"firstline");
+ wp->w_firstline = dict_get_number(dict, "firstline");
if (wp->w_firstline < 0)
wp->w_firstline = -1;
}
- nr = dict_get_bool(dict, (char_u *)"scrollbar", -1);
+ nr = dict_get_bool(dict, "scrollbar", -1);
if (nr != -1)
wp->w_want_scrollbar = nr;
- str = dict_get_string(dict, (char_u *)"title", FALSE);
+ str = dict_get_string(dict, "title", FALSE);
if (str != NULL)
{
vim_free(wp->w_popup_title);
wp->w_popup_title = vim_strsave(str);
}
- nr = dict_get_bool(dict, (char_u *)"wrap", -1);
+ nr = dict_get_bool(dict, "wrap", -1);
if (nr != -1)
wp->w_p_wrap = nr != 0;
- nr = dict_get_bool(dict, (char_u *)"drag", -1);
+ nr = dict_get_bool(dict, "drag", -1);
if (nr != -1)
{
if (nr)
else
wp->w_popup_flags &= ~POPF_DRAG;
}
- nr = dict_get_bool(dict, (char_u *)"dragall", -1);
+ nr = dict_get_bool(dict, "dragall", -1);
if (nr != -1)
{
if (nr)
wp->w_popup_flags &= ~POPF_DRAGALL;
}
- nr = dict_get_bool(dict, (char_u *)"posinvert", -1);
+ nr = dict_get_bool(dict, "posinvert", -1);
if (nr != -1)
{
if (nr)
wp->w_popup_flags &= ~POPF_POSINVERT;
}
- nr = dict_get_bool(dict, (char_u *)"resize", -1);
+ nr = dict_get_bool(dict, "resize", -1);
if (nr != -1)
{
if (nr)
semsg(_(e_invalid_value_for_argument_str_str), "close", tv_get_string(&di->di_tv));
}
- str = dict_get_string(dict, (char_u *)"highlight", FALSE);
+ str = dict_get_string(dict, "highlight", FALSE);
if (str != NULL)
{
set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
di = dict_find(dict, (char_u *)"zindex", -1);
if (di != NULL)
{
- wp->w_zindex = dict_get_number(dict, (char_u *)"zindex");
+ wp->w_zindex = dict_get_number(dict, "zindex");
if (wp->w_zindex < 1)
wp->w_zindex = POPUPWIN_DEFAULT_ZINDEX;
if (wp->w_zindex > 32000)
#if defined(FEAT_TIMERS)
// Add timer to close the popup after some time.
- nr = dict_get_number(dict, (char_u *)"time");
+ nr = dict_get_number(dict, "time");
if (nr > 0)
popup_add_timeout(wp, nr);
#endif
handle_moved_argument(wp, di, TRUE);
}
- nr = dict_get_bool(dict, (char_u *)"cursorline", -1);
+ nr = dict_get_bool(dict, "cursorline", -1);
if (nr != -1)
{
if (nr != 0)
set_callback(&wp->w_filter_cb, &callback);
}
}
- nr = dict_get_bool(dict, (char_u *)"mapping", -1);
+ nr = dict_get_bool(dict, "mapping", -1);
if (nr != -1)
{
if (nr)
wp->w_popup_flags &= ~POPF_MAPPING;
}
- str = dict_get_string(dict, (char_u *)"filtermode", FALSE);
+ str = dict_get_string(dict, "filtermode", FALSE);
if (str != NULL)
{
if (STRCMP(str, "a") == 0)
apply_general_options(wp, dict);
- nr = dict_get_bool(dict, (char_u *)"hidden", FALSE);
+ nr = dict_get_bool(dict, "hidden", FALSE);
if (nr > 0)
wp->w_popup_flags |= POPF_HIDDEN | POPF_HIDDEN_FORCE;
return;
}
dict = li->li_tv.vval.v_dict;
- p = dict == NULL ? NULL
- : dict_get_string(dict, (char_u *)"text", FALSE);
+ p = dict == NULL ? NULL : dict_get_string(dict, "text", FALSE);
ml_append_buf(buf, lnum++,
p == NULL ? (char_u *)"" : p, (colnr_T)0, TRUE);
}
dict = pli->li_tv.vval.v_dict;
if (dict != NULL)
{
- int col = dict_get_number(dict, (char_u *)"col");
+ int col = dict_get_number(dict, "col");
prop_add_common( lnum, col, dict, buf, NULL);
}
if (d != NULL)
{
if (dict_has_key(d, "tabpage"))
- tabnr = (int)dict_get_number(d, (char_u *)"tabpage");
+ tabnr = (int)dict_get_number(d, "tabpage");
else if (type == TYPE_NOTIFICATION)
tabnr = -1; // notifications are global by default
else
long dict_len(dict_T *d);
dictitem_T *dict_find(dict_T *d, char_u *key, int len);
int dict_has_key(dict_T *d, char *key);
-int dict_get_tv(dict_T *d, char_u *key, typval_T *rettv);
-char_u *dict_get_string(dict_T *d, char_u *key, int save);
-varnumber_T dict_get_number(dict_T *d, char_u *key);
-varnumber_T dict_get_number_def(dict_T *d, char_u *key, int def);
+int dict_get_tv(dict_T *d, char *key, typval_T *rettv);
+char_u *dict_get_string(dict_T *d, char *key, int save);
+varnumber_T dict_get_number(dict_T *d, char *key);
+varnumber_T dict_get_number_def(dict_T *d, char *key, int def);
varnumber_T dict_get_number_check(dict_T *d, char_u *key);
-varnumber_T dict_get_bool(dict_T *d, char_u *key, int def);
+varnumber_T dict_get_bool(dict_T *d, char *key, int def);
char_u *dict2string(typval_T *tv, int copyID, int restore_copyID);
char_u *get_literal_key(char_u **arg);
int eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal);
if (first_entry)
did_bufnr_emsg = FALSE;
- filename = dict_get_string(d, (char_u *)"filename", TRUE);
- module = dict_get_string(d, (char_u *)"module", TRUE);
- bufnum = (int)dict_get_number(d, (char_u *)"bufnr");
- lnum = (int)dict_get_number(d, (char_u *)"lnum");
- end_lnum = (int)dict_get_number(d, (char_u *)"end_lnum");
- col = (int)dict_get_number(d, (char_u *)"col");
- end_col = (int)dict_get_number(d, (char_u *)"end_col");
- vcol = (int)dict_get_number(d, (char_u *)"vcol");
- nr = (int)dict_get_number(d, (char_u *)"nr");
- type = dict_get_string(d, (char_u *)"type", TRUE);
- pattern = dict_get_string(d, (char_u *)"pattern", TRUE);
- text = dict_get_string(d, (char_u *)"text", TRUE);
+ filename = dict_get_string(d, "filename", TRUE);
+ module = dict_get_string(d, "module", TRUE);
+ bufnum = (int)dict_get_number(d, "bufnr");
+ lnum = (int)dict_get_number(d, "lnum");
+ end_lnum = (int)dict_get_number(d, "end_lnum");
+ col = (int)dict_get_number(d, "col");
+ end_col = (int)dict_get_number(d, "end_col");
+ vcol = (int)dict_get_number(d, "vcol");
+ nr = (int)dict_get_number(d, "nr");
+ type = dict_get_string(d, "type", TRUE);
+ pattern = dict_get_string(d, "pattern", TRUE);
+ text = dict_get_string(d, "text", TRUE);
if (text == NULL)
text = vim_strsave((char_u *)"");
// If the 'valid' field is present it overrules the detected value.
if (dict_has_key(d, "valid"))
- valid = (int)dict_get_bool(d, (char_u *)"valid", FALSE);
+ valid = (int)dict_get_bool(d, "valid", FALSE);
status = qf_add_entry(qfl,
NULL, // dir
return FAIL;
vim_free(qfl->qf_title);
- qfl->qf_title = dict_get_string(what, (char_u *)"title", TRUE);
+ qfl->qf_title = dict_get_string(what, "title", TRUE);
if (qf_idx == qi->qf_curlist)
qf_update_win_titlevar(qi);
if (error)
return;
}
- recompute = dict_get_bool(dict, (char_u *)"recompute", recompute);
+ recompute = dict_get_bool(dict, "recompute", recompute);
di = dict_find(dict, (char_u *)"pattern", -1);
if (di != NULL)
{
// For a dict, either use the specified key to lookup the string or
// use the specified callback function to get the string.
if (key != NULL)
- itemstr = dict_get_string(li->li_tv.vval.v_dict, key, FALSE);
+ itemstr = dict_get_string(li->li_tv.vval.v_dict,
+ (char *)key, FALSE);
else
{
typval_T argv[2];
{
if (dict == NULL)
return -1;
- name = dict_get_string(dict, (char_u *)"name", TRUE);
+ name = dict_get_string(dict, "name", TRUE);
}
else
name = vim_strsave(name_arg);
goto cleanup;
if (dict != NULL)
{
- icon = dict_get_string(dict, (char_u *)"icon", TRUE);
- linehl = dict_get_string(dict, (char_u *)"linehl", TRUE);
- text = dict_get_string(dict, (char_u *)"text", TRUE);
- texthl = dict_get_string(dict, (char_u *)"texthl", TRUE);
- culhl = dict_get_string(dict, (char_u *)"culhl", TRUE);
- numhl = dict_get_string(dict, (char_u *)"numhl", TRUE);
+ icon = dict_get_string(dict, "icon", TRUE);
+ linehl = dict_get_string(dict, "linehl", TRUE);
+ text = dict_get_string(dict, "text", TRUE);
+ texthl = dict_get_string(dict, "texthl", TRUE);
+ culhl = dict_get_string(dict, "culhl", TRUE);
+ numhl = dict_get_string(dict, "numhl", TRUE);
}
if (sign_define_by_name(name, icon, linehl, text, texthl, culhl, numhl) == OK)
if (group_tv != NULL)
group = tv_get_string(group_tv);
else
- group = dict_get_string(dict, (char_u *)"group", FALSE);
+ group = dict_get_string(dict, "group", FALSE);
if (group != NULL)
{
if (group[0] == '\0') // global sign group
}
if (dict_has_key(dict, "id"))
{
- sign_id = dict_get_number(dict, (char_u *)"id");
+ sign_id = dict_get_number(dict, "id");
if (sign_id <= 0)
{
emsg(_(e_invalid_argument));
continue;
if (list2fpos(&di->di_tv, &mark, &fnum, NULL, FALSE) != OK)
continue;
- if ((tagname =
- dict_get_string(itemdict, (char_u *)"tagname", TRUE)) == NULL)
+ if ((tagname = dict_get_string(itemdict, "tagname", TRUE)) == NULL)
continue;
if (mark.col > 0)
mark.col--;
tagstack_push_item(wp, tagname,
- (int)dict_get_number(itemdict, (char_u *)"bufnr"),
- (int)dict_get_number(itemdict, (char_u *)"matchnr") - 1,
+ (int)dict_get_number(itemdict, "bufnr"),
+ (int)dict_get_number(itemdict, "matchnr") - 1,
mark, fnum,
- dict_get_string(itemdict, (char_u *)"user_data", TRUE));
+ dict_get_string(itemdict, "user_data", TRUE));
}
}
dict_T *dict = opt_item->li_tv.vval.v_dict;
char_u *p;
- p = dict_get_string(dict, (char_u *)"ff", FALSE);
+ p = dict_get_string(dict, "ff", FALSE);
if (p == NULL)
- p = dict_get_string(dict, (char_u *)"fileformat", FALSE);
+ p = dict_get_string(dict, "fileformat", FALSE);
if (p != NULL)
{
if (check_ff_value(p) == FAIL)
else
ea.force_ff = *p;
}
- p = dict_get_string(dict, (char_u *)"enc", FALSE);
+ p = dict_get_string(dict, "enc", FALSE);
if (p == NULL)
- p = dict_get_string(dict, (char_u *)"encoding", FALSE);
+ p = dict_get_string(dict, "encoding", FALSE);
if (p != NULL)
{
ea.cmd = alloc(STRLEN(p) + 12);
}
}
- p = dict_get_string(dict, (char_u *)"bad", FALSE);
+ p = dict_get_string(dict, "bad", FALSE);
if (p != NULL)
get_bad_opt(p, &ea);
d = argvars[2].vval.v_dict;
if (d != NULL)
{
- max_height = dict_get_number(d, (char_u *)"rows");
- max_width = dict_get_number(d, (char_u *)"columns");
+ max_height = dict_get_number(d, "rows");
+ max_width = dict_get_number(d, "columns");
}
}
|| !dict_has_key(args, "modifiers"))
return FALSE;
- (void)dict_get_tv(args, (char_u *)"files", &t);
- row = (int)dict_get_number(args, (char_u *)"row");
- col = (int)dict_get_number(args, (char_u *)"col");
- mods = (int)dict_get_number(args, (char_u *)"modifiers");
+ (void)dict_get_tv(args, "files", &t);
+ row = (int)dict_get_number(args, "row");
+ col = (int)dict_get_number(args, "col");
+ mods = (int)dict_get_number(args, "modifiers");
if (t.v_type != VAR_LIST || list_len(t.vval.v_list) == 0)
return FALSE;
|| !dict_has_key(args, "forward"))
return FALSE;
- find_text = dict_get_string(args, (char_u *)"find_text", TRUE);
- repl_text = dict_get_string(args, (char_u *)"repl_text", TRUE);
- flags = (int)dict_get_number(args, (char_u *)"flags");
- forward = (int)dict_get_number(args, (char_u *)"forward");
+ find_text = dict_get_string(args, "find_text", TRUE);
+ repl_text = dict_get_string(args, "repl_text", TRUE);
+ flags = (int)dict_get_number(args, "flags");
+ forward = (int)dict_get_number(args, "forward");
retval = gui_do_findrepl(flags, find_text, repl_text, forward);
vim_free(find_text);
return FALSE;
// Note: "move" is optional, requires fewer arguments
- move = (int)dict_get_bool(args, (char_u *)"move", FALSE);
+ move = (int)dict_get_bool(args, "move", FALSE);
if (!move && (!dict_has_key(args, "button")
|| !dict_has_key(args, "multiclick")
|| !dict_has_key(args, "modifiers")))
return FALSE;
- row = (int)dict_get_number(args, (char_u *)"row");
- col = (int)dict_get_number(args, (char_u *)"col");
+ row = (int)dict_get_number(args, "row");
+ col = (int)dict_get_number(args, "col");
if (move)
{
- if (dict_get_bool(args, (char_u *)"cell", FALSE))
+ if (dict_get_bool(args, "cell", FALSE))
{
// click in the middle of the character cell
row = row * gui.char_height + gui.char_height / 2;
}
else
{
- button = (int)dict_get_number(args, (char_u *)"button");
- repeated_click = (int)dict_get_number(args, (char_u *)"multiclick");
- mods = (int)dict_get_number(args, (char_u *)"modifiers");
+ button = (int)dict_get_number(args, "button");
+ repeated_click = (int)dict_get_number(args, "multiclick");
+ mods = (int)dict_get_number(args, "modifiers");
// Reset the scroll values to known values.
// XXX: Remove this when/if the scroll step is made configurable.
|| !dict_has_key(args, "dragging"))
return FALSE;
- which = dict_get_string(args, (char_u *)"which", FALSE);
- value = (long)dict_get_number(args, (char_u *)"value");
- dragging = (int)dict_get_number(args, (char_u *)"dragging");
+ which = dict_get_string(args, "which", FALSE);
+ value = (long)dict_get_number(args, "value");
+ dragging = (int)dict_get_number(args, "dragging");
if (STRCMP(which, "left") == 0)
sb = &curwin->w_scrollbars[SBAR_LEFT];
if (!dict_has_key(args, "tabnr"))
return FALSE;
- tabnr = (int)dict_get_number(args, (char_u *)"tabnr");
+ tabnr = (int)dict_get_number(args, "tabnr");
return send_tabline_event(tabnr);
# else
|| !dict_has_key(args, "item"))
return FALSE;
- tabnr = (int)dict_get_number(args, (char_u *)"tabnr");
- item = (int)dict_get_number(args, (char_u *)"item");
+ tabnr = (int)dict_get_number(args, "tabnr");
+ item = (int)dict_get_number(args, "item");
send_tabline_menu_event(tabnr, item);
# endif
emsg(_(e_missing_property_type_name));
return;
}
- type_name = dict_get_string(dict, (char_u *)"type", FALSE);
+ type_name = dict_get_string(dict, "type", FALSE);
if (dict_has_key(dict, "id"))
- id = dict_get_number(dict, (char_u *)"id");
+ id = dict_get_number(dict, "id");
if (get_bufnr_from_arg(&argvars[0], &buf) == FAIL)
return;
emsg(_(e_missing_property_type_name));
return;
}
- type_name = dict_get_string(dict, (char_u *)"type", FALSE);
+ type_name = dict_get_string(dict, "type", FALSE);
if (dict_has_key(dict, "end_lnum"))
{
- end_lnum = dict_get_number(dict, (char_u *)"end_lnum");
+ end_lnum = dict_get_number(dict, "end_lnum");
if (end_lnum < start_lnum)
{
semsg(_(e_invalid_value_for_argument_str), "end_lnum");
if (dict_has_key(dict, "length"))
{
- long length = dict_get_number(dict, (char_u *)"length");
+ long length = dict_get_number(dict, "length");
if (length < 0 || end_lnum > start_lnum)
{
}
else if (dict_has_key(dict, "end_col"))
{
- end_col = dict_get_number(dict, (char_u *)"end_col");
+ end_col = dict_get_number(dict, "end_col");
if (end_col <= 0)
{
semsg(_(e_invalid_value_for_argument_str), "end_col");
end_col = 1;
if (dict_has_key(dict, "id"))
- id = dict_get_number(dict, (char_u *)"id");
+ id = dict_get_number(dict, "id");
if (dict_arg != NULL && get_bufnr_from_arg(dict_arg, &buf) == FAIL)
return;
return;
}
- skipstart = dict_get_bool(dict, (char_u *)"skipstart", 0);
+ skipstart = dict_get_bool(dict, "skipstart", 0);
if (dict_has_key(dict, "id"))
{
- id = dict_get_number(dict, (char_u *)"id");
+ id = dict_get_number(dict, "id");
id_found = TRUE;
}
if (dict_has_key(dict, "type"))
{
- char_u *name = dict_get_string(dict, (char_u *)"type", FALSE);
+ char_u *name = dict_get_string(dict, "type", FALSE);
proptype_T *type = lookup_prop_type(name, buf);
if (type == NULL)
return;
type_id = type->pt_id;
}
- both = dict_get_bool(dict, (char_u *)"both", FALSE);
+ both = dict_get_bool(dict, "both", FALSE);
if (!id_found && type_id == -1)
{
emsg(_(e_need_at_least_one_of_id_or_type));
if (buf->b_ml.ml_mfp == NULL)
return;
- do_all = dict_get_bool(dict, (char_u *)"all", FALSE);
+ do_all = dict_get_bool(dict, "all", FALSE);
if (dict_has_key(dict, "id"))
- id = dict_get_number(dict, (char_u *)"id");
+ id = dict_get_number(dict, "id");
if (dict_has_key(dict, "type"))
{
- char_u *name = dict_get_string(dict, (char_u *)"type", FALSE);
+ char_u *name = dict_get_string(dict, "type", FALSE);
proptype_T *type = lookup_prop_type(name, buf);
if (type == NULL)
return;
type_id = type->pt_id;
}
- both = dict_get_bool(dict, (char_u *)"both", FALSE);
+ both = dict_get_bool(dict, "both", FALSE);
if (id == -1 && type_id == -1)
{
char_u *highlight;
int hl_id = 0;
- highlight = dict_get_string(dict, (char_u *)"highlight", FALSE);
+ highlight = dict_get_string(dict, "highlight", FALSE);
if (highlight != NULL && *highlight != NUL)
hl_id = syn_name2id(highlight);
if (hl_id <= 0)
return;
}
if (dict_has_key(dict, "repeat"))
- repeat = dict_get_number(dict, (char_u *)"repeat");
+ repeat = dict_get_number(dict, "repeat");
}
callback = get_callback(&argvars[1]);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 63,
/**/
62,
/**/