]> granicus.if.org Git - vim/commitdiff
patch 8.1.0583: using illogical name for get_dict_number()/get_dict_string() v8.1.0583
authorBram Moolenaar <Bram@vim.org>
Fri, 14 Dec 2018 14:38:31 +0000 (15:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 14 Dec 2018 14:38:31 +0000 (15:38 +0100)
Problem:    Using illogical name for get_dict_number()/get_dict_string().
Solution:   Rename to start with dict_.

src/dict.c
src/edit.c
src/eval.c
src/evalfunc.c
src/proto/dict.pro
src/quickfix.c
src/tag.c
src/terminal.c
src/textprop.c
src/version.c

index da3e763e2f8ac675c7e1b4fd0bbb7c296acf4098..9ba0231f2b5ae1254e774b055b62d70a9d5d3406 100644 (file)
@@ -487,7 +487,7 @@ dict_find(dict_T *d, char_u *key, int len)
  * Returns NULL if the entry doesn't exist or out of memory.
  */
     char_u *
-get_dict_string(dict_T *d, char_u *key, int save)
+dict_get_string(dict_T *d, char_u *key, int save)
 {
     dictitem_T *di;
     char_u     *s;
@@ -506,7 +506,7 @@ get_dict_string(dict_T *d, char_u *key, int save)
  * Returns 0 if the entry doesn't exist.
  */
     varnumber_T
-get_dict_number(dict_T *d, char_u *key)
+dict_get_number(dict_T *d, char_u *key)
 {
     dictitem_T *di;
 
@@ -583,7 +583,7 @@ dict2string(typval_T *tv, int copyID, int restore_copyID)
  * Return OK or FAIL.  Returns NOTDONE for {expr}.
  */
     int
-get_dict_tv(char_u **arg, typval_T *rettv, int evaluate)
+dict_get_tv(char_u **arg, typval_T *rettv, int evaluate)
 {
     dict_T     *d = NULL;
     typval_T   tvkey;
index 205dc65de75edc0ca0fa1b268cd342bc9a0c27e3..c23597691b0a022018eeb524b7a88fb44f37e18a 100644 (file)
@@ -4343,23 +4343,23 @@ ins_compl_add_tv(typval_T *tv, int dir)
 
     if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
     {
-       word = get_dict_string(tv->vval.v_dict, (char_u *)"word", FALSE);
-       cptext[CPT_ABBR] = get_dict_string(tv->vval.v_dict,
+       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] = get_dict_string(tv->vval.v_dict,
+       cptext[CPT_MENU] = dict_get_string(tv->vval.v_dict,
                                                     (char_u *)"menu", FALSE);
-       cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict,
+       cptext[CPT_KIND] = dict_get_string(tv->vval.v_dict,
                                                     (char_u *)"kind", FALSE);
-       cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict,
+       cptext[CPT_INFO] = dict_get_string(tv->vval.v_dict,
                                                     (char_u *)"info", FALSE);
-       cptext[CPT_USER_DATA] = get_dict_string(tv->vval.v_dict,
+       cptext[CPT_USER_DATA] = dict_get_string(tv->vval.v_dict,
                                                 (char_u *)"user_data", FALSE);
-       if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL)
-           icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
-       if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
-           adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
-       if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
-           aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty");
+       if (dict_get_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL)
+           icase = dict_get_number(tv->vval.v_dict, (char_u *)"icase");
+       if (dict_get_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
+           adup = dict_get_number(tv->vval.v_dict, (char_u *)"dup");
+       if (dict_get_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
+           aempty = dict_get_number(tv->vval.v_dict, (char_u *)"empty");
     }
     else
     {
index 8839e057241c663bda177bbf940934fc0785cb2d..18aa5e562fe4e38e669e5ddadb30ed306becfe56 100644 (file)
@@ -4063,7 +4063,7 @@ eval7(
      */
     case '{':  ret = get_lambda_tv(arg, rettv, evaluate);
                if (ret == NOTDONE)
-                   ret = get_dict_tv(arg, rettv, evaluate);
+                   ret = dict_get_tv(arg, rettv, evaluate);
                break;
 
     /*
index 6e687554ed0872b8f5bb036e6ab00de15373f457..93cac5aa6853faf3de8504a8c900a05407de0997 100644 (file)
@@ -8072,7 +8072,7 @@ matchadd_dict_arg(typval_T *tv, char_u **conceal_char, win_T **win)
     }
 
     if (dict_find(tv->vval.v_dict, (char_u *)"conceal", -1) != NULL)
-       *conceal_char = get_dict_string(tv->vval.v_dict,
+       *conceal_char = dict_get_string(tv->vval.v_dict,
                                                   (char_u *)"conceal", FALSE);
 
     if ((di = dict_find(tv->vval.v_dict, (char_u *)"window", -1)) != NULL)
@@ -10668,7 +10668,7 @@ f_setcharsearch(typval_T *argvars, typval_T *rettv UNUSED)
 
     if ((d = argvars[0].vval.v_dict) != NULL)
     {
-       csearch = get_dict_string(d, (char_u *)"char", FALSE);
+       csearch = dict_get_string(d, (char_u *)"char", FALSE);
        if (csearch != NULL)
        {
 #ifdef FEAT_MBYTE
@@ -10922,16 +10922,16 @@ f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
                }
            }
 
-           group = get_dict_string(d, (char_u *)"group", TRUE);
-           priority = (int)get_dict_number(d, (char_u *)"priority");
-           id = (int)get_dict_number(d, (char_u *)"id");
+           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");
            conceal = dict_find(d, (char_u *)"conceal", -1) != NULL
-                             ? get_dict_string(d, (char_u *)"conceal", TRUE)
+                             ? dict_get_string(d, (char_u *)"conceal", TRUE)
                              : NULL;
            if (i == 0)
            {
                match_add(curwin, group,
-                   get_dict_string(d, (char_u *)"pattern", FALSE),
+                   dict_get_string(d, (char_u *)"pattern", FALSE),
                    priority, id, NULL, conceal);
            }
            else
@@ -13529,7 +13529,7 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
            return;
        }
        if (dict_find(dict, (char_u *)"repeat", -1) != NULL)
-           repeat = get_dict_number(dict, (char_u *)"repeat");
+           repeat = dict_get_number(dict, (char_u *)"repeat");
     }
 
     callback = get_callback(&argvars[1], &partial);
@@ -14080,29 +14080,29 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
     else
     {
        if (dict_find(dict, (char_u *)"lnum", -1) != NULL)
-           curwin->w_cursor.lnum = (linenr_T)get_dict_number(dict, (char_u *)"lnum");
+           curwin->w_cursor.lnum = (linenr_T)dict_get_number(dict, (char_u *)"lnum");
        if (dict_find(dict, (char_u *)"col", -1) != NULL)
-           curwin->w_cursor.col = (colnr_T)get_dict_number(dict, (char_u *)"col");
+           curwin->w_cursor.col = (colnr_T)dict_get_number(dict, (char_u *)"col");
 #ifdef FEAT_VIRTUALEDIT
        if (dict_find(dict, (char_u *)"coladd", -1) != NULL)
-           curwin->w_cursor.coladd = (colnr_T)get_dict_number(dict, (char_u *)"coladd");
+           curwin->w_cursor.coladd = (colnr_T)dict_get_number(dict, (char_u *)"coladd");
 #endif
        if (dict_find(dict, (char_u *)"curswant", -1) != NULL)
        {
-           curwin->w_curswant = (colnr_T)get_dict_number(dict, (char_u *)"curswant");
+           curwin->w_curswant = (colnr_T)dict_get_number(dict, (char_u *)"curswant");
            curwin->w_set_curswant = FALSE;
        }
 
        if (dict_find(dict, (char_u *)"topline", -1) != NULL)
-           set_topline(curwin, (linenr_T)get_dict_number(dict, (char_u *)"topline"));
+           set_topline(curwin, (linenr_T)dict_get_number(dict, (char_u *)"topline"));
 #ifdef FEAT_DIFF
        if (dict_find(dict, (char_u *)"topfill", -1) != NULL)
-           curwin->w_topfill = (int)get_dict_number(dict, (char_u *)"topfill");
+           curwin->w_topfill = (int)dict_get_number(dict, (char_u *)"topfill");
 #endif
        if (dict_find(dict, (char_u *)"leftcol", -1) != NULL)
-           curwin->w_leftcol = (colnr_T)get_dict_number(dict, (char_u *)"leftcol");
+           curwin->w_leftcol = (colnr_T)dict_get_number(dict, (char_u *)"leftcol");
        if (dict_find(dict, (char_u *)"skipcol", -1) != NULL)
-           curwin->w_skipcol = (colnr_T)get_dict_number(dict, (char_u *)"skipcol");
+           curwin->w_skipcol = (colnr_T)dict_get_number(dict, (char_u *)"skipcol");
 
        check_cursor();
        win_new_height(curwin, curwin->w_height);
index 21c8d6dac59e3f09ec4f83967d25358f6c85301f..94ed2a08557e7bb26e0fe5b74ab70c6458cc452a 100644 (file)
@@ -19,10 +19,10 @@ int dict_add_list(dict_T *d, char *key, list_T *list);
 int dict_add_dict(dict_T *d, char *key, dict_T *dict);
 long dict_len(dict_T *d);
 dictitem_T *dict_find(dict_T *d, char_u *key, int len);
-char_u *get_dict_string(dict_T *d, char_u *key, int save);
-varnumber_T get_dict_number(dict_T *d, char_u *key);
+char_u *dict_get_string(dict_T *d, char_u *key, int save);
+varnumber_T dict_get_number(dict_T *d, char_u *key);
 char_u *dict2string(typval_T *tv, int copyID, int restore_copyID);
-int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate);
+int dict_get_tv(char_u **arg, typval_T *rettv, int evaluate);
 void dict_extend(dict_T *d1, dict_T *d2, char_u *action);
 dictitem_T *dict_lookup(hashitem_T *hi);
 int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive);
index a8449c9cd46656d5459292170131ef9232ef1e8c..5291fb1115989b30c64e563b3c55fcde75d5c23b 100644 (file)
@@ -6258,16 +6258,16 @@ qf_add_entry_from_dict(
     if (first_entry)
        did_bufnr_emsg = FALSE;
 
-    filename = get_dict_string(d, (char_u *)"filename", TRUE);
-    module = get_dict_string(d, (char_u *)"module", TRUE);
-    bufnum = (int)get_dict_number(d, (char_u *)"bufnr");
-    lnum = (int)get_dict_number(d, (char_u *)"lnum");
-    col = (int)get_dict_number(d, (char_u *)"col");
-    vcol = (int)get_dict_number(d, (char_u *)"vcol");
-    nr = (int)get_dict_number(d, (char_u *)"nr");
-    type = get_dict_string(d, (char_u *)"type", TRUE);
-    pattern = get_dict_string(d, (char_u *)"pattern", TRUE);
-    text = get_dict_string(d, (char_u *)"text", TRUE);
+    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");
+    col = (int)dict_get_number(d, (char_u *)"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);
     if (text == NULL)
        text = vim_strsave((char_u *)"");
 
@@ -6290,7 +6290,7 @@ qf_add_entry_from_dict(
 
     // If the 'valid' field is present it overrules the detected value.
     if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
-       valid = (int)get_dict_number(d, (char_u *)"valid");
+       valid = (int)dict_get_number(d, (char_u *)"valid");
 
     status =  qf_add_entry(qi,
                        qf_idx,
@@ -6456,7 +6456,7 @@ qf_setprop_title(qf_info_T *qi, int qf_idx, dict_T *what, dictitem_T *di)
        return FAIL;
 
     vim_free(qfl->qf_title);
-    qfl->qf_title = get_dict_string(what, (char_u *)"title", TRUE);
+    qfl->qf_title = dict_get_string(what, (char_u *)"title", TRUE);
     if (qf_idx == qi->qf_curlist)
        qf_update_win_titlevar(qi);
 
index 5ae61f316b3ed90498ed8f12d722abe2eb3cda32..a1a9e2295931ab9d1914f624f40b73f9c01c40e5 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -4160,14 +4160,14 @@ tagstack_push_items(win_T *wp, list_T *l)
        if (list2fpos(&di->di_tv, &mark, &fnum, NULL) != OK)
            continue;
        if ((tagname =
-               get_dict_string(itemdict, (char_u *)"tagname", TRUE)) == NULL)
+               dict_get_string(itemdict, (char_u *)"tagname", TRUE)) == NULL)
            continue;
 
        if (mark.col > 0)
            mark.col--;
        tagstack_push_item(wp, tagname,
-               (int)get_dict_number(itemdict, (char_u *)"bufnr"),
-               (int)get_dict_number(itemdict, (char_u *)"matchnr") - 1,
+               (int)dict_get_number(itemdict, (char_u *)"bufnr"),
+               (int)dict_get_number(itemdict, (char_u *)"matchnr") - 1,
                mark, fnum);
     }
 }
index 53b6ca8a2a7abd1ec9b03915e8052b93e0819c61..42897bf07611392828739915b727e1bd893b8a2e 100644 (file)
@@ -3523,9 +3523,9 @@ handle_drop_command(listitem_T *item)
        dict_T *dict = opt_item->li_tv.vval.v_dict;
        char_u *p;
 
-       p = get_dict_string(dict, (char_u *)"ff", FALSE);
+       p = dict_get_string(dict, (char_u *)"ff", FALSE);
        if (p == NULL)
-           p = get_dict_string(dict, (char_u *)"fileformat", FALSE);
+           p = dict_get_string(dict, (char_u *)"fileformat", FALSE);
        if (p != NULL)
        {
            if (check_ff_value(p) == FAIL)
@@ -3533,9 +3533,9 @@ handle_drop_command(listitem_T *item)
            else
                ea.force_ff = *p;
        }
-       p = get_dict_string(dict, (char_u *)"enc", FALSE);
+       p = dict_get_string(dict, (char_u *)"enc", FALSE);
        if (p == NULL)
-           p = get_dict_string(dict, (char_u *)"encoding", FALSE);
+           p = dict_get_string(dict, (char_u *)"encoding", FALSE);
        if (p != NULL)
        {
            ea.cmd = alloc((int)STRLEN(p) + 12);
@@ -3547,7 +3547,7 @@ handle_drop_command(listitem_T *item)
            }
        }
 
-       p = get_dict_string(dict, (char_u *)"bad", FALSE);
+       p = dict_get_string(dict, (char_u *)"bad", FALSE);
        if (p != NULL)
            get_bad_opt(p, &ea);
 
@@ -3915,8 +3915,8 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
        d = argvars[2].vval.v_dict;
        if (d != NULL)
        {
-           max_height = get_dict_number(d, (char_u *)"rows");
-           max_width = get_dict_number(d, (char_u *)"columns");
+           max_height = dict_get_number(d, (char_u *)"rows");
+           max_width = dict_get_number(d, (char_u *)"columns");
        }
     }
 
index 85d32475dc87477be7afb0a07d70658185afed80..3e0207da37b2eab14f5932bf7aec07c895d59a1e 100644 (file)
@@ -173,7 +173,7 @@ f_prop_add(typval_T *argvars, typval_T *rettv UNUSED)
        EMSG(_("E965: missing property type name"));
        return;
     }
-    type_name = get_dict_string(dict, (char_u *)"type", FALSE);
+    type_name = dict_get_string(dict, (char_u *)"type", FALSE);
 
     if (dict_find(dict, (char_u *)"end_lnum", -1) != NULL)
     {
@@ -183,10 +183,10 @@ f_prop_add(typval_T *argvars, typval_T *rettv UNUSED)
     }
 
     if (dict_find(dict, (char_u *)"length", -1) != NULL)
-       length = get_dict_number(dict, (char_u *)"length");
+       length = dict_get_number(dict, (char_u *)"length");
     else if (dict_find(dict, (char_u *)"end_col", -1) != NULL)
     {
-       length = get_dict_number(dict, (char_u *)"end_col") - col;
+       length = dict_get_number(dict, (char_u *)"end_col") - col;
        if (length <= 0)
        {
            EMSG2(_(e_invargval), "end_col");
@@ -195,7 +195,7 @@ f_prop_add(typval_T *argvars, typval_T *rettv UNUSED)
     }
 
     if (dict_find(dict, (char_u *)"id", -1) != NULL)
-       id = get_dict_number(dict, (char_u *)"id");
+       id = dict_get_number(dict, (char_u *)"id");
 
     if (get_bufnr_from_arg(&argvars[2], &buf) == FAIL)
        return;
@@ -265,7 +265,7 @@ f_prop_add(typval_T *argvars, typval_T *rettv UNUSED)
 
 /*
  * Return TRUE if any text properties are defined globally or for buffer
- * 'buf".
+ * "buf".
  */
     int
 has_any_text_properties(buf_T *buf)
@@ -498,13 +498,13 @@ f_prop_remove(typval_T *argvars, typval_T *rettv)
 
     di = dict_find(dict, (char_u*)"all", -1);
     if (di != NULL)
-       do_all = get_dict_number(dict, (char_u *)"all");
+       do_all = dict_get_number(dict, (char_u *)"all");
 
     if (dict_find(dict, (char_u *)"id", -1) != NULL)
-       id = get_dict_number(dict, (char_u *)"id");
+       id = dict_get_number(dict, (char_u *)"id");
     if (dict_find(dict, (char_u *)"type", -1))
     {
-       char_u      *name = get_dict_string(dict, (char_u *)"type", FALSE);
+       char_u      *name = dict_get_string(dict, (char_u *)"type", FALSE);
        proptype_T  *type = lookup_prop_type(name, buf);
 
        if (type == NULL)
@@ -642,7 +642,7 @@ prop_type_set(typval_T *argvars, int add)
            char_u      *highlight;
            int         hl_id = 0;
 
-           highlight = get_dict_string(dict, (char_u *)"highlight", FALSE);
+           highlight = dict_get_string(dict, (char_u *)"highlight", FALSE);
            if (highlight != NULL && *highlight != NUL)
                hl_id = syn_name2id(highlight);
            if (hl_id <= 0)
index a0ffd4e37214ba326fa85e74945d0d9ddf3843b4..1c85bf1f62b8185d82f0f5c2d7bb89fb079af746 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    583,
 /**/
     582,
 /**/