]> granicus.if.org Git - vim/commitdiff
patch 8.0.0451: some macros are in lower case v8.0.0451
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Mar 2017 18:22:36 +0000 (19:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Mar 2017 18:22:36 +0000 (19:22 +0100)
Problem:    Some macros are in lower case.
Solution:   Make a few more macros upper case. Avoid lower case macros use an
            argument twice.

39 files changed:
src/charset.c
src/edit.c
src/eval.c
src/ex_cmds.c
src/ex_cmds2.c
src/ex_docmd.c
src/ex_getln.c
src/fileio.c
src/fold.c
src/gui.c
src/gui_gtk.c
src/macros.h
src/mark.c
src/mbyte.c
src/memline.c
src/menu.c
src/message.c
src/misc1.c
src/misc2.c
src/ops.c
src/option.c
src/os_amiga.c
src/os_mswin.c
src/os_unix.c
src/os_win32.c
src/popupmnu.c
src/proto/misc2.pro
src/regexp.c
src/regexp_nfa.c
src/screen.c
src/search.c
src/spell.c
src/spellfile.c
src/syntax.c
src/tag.c
src/ui.c
src/undo.c
src/version.c
src/window.c

index 1e1b8b1af89f2bb7642613554a54df8694ff7a69..18a693547ddc93ddc28777516d249e4fbbc8fc76 100644 (file)
@@ -870,7 +870,7 @@ win_linetabsize(win_T *wp, char_u *line, colnr_T len)
     char_u     *s;
 
     for (s = line; *s != NUL && (len == MAXCOL || s < line + len);
-                                                               mb_ptr_adv(s))
+                                                               MB_PTR_ADV(s))
        col += win_lbr_chartabsize(wp, line, s, col, NULL);
     return (int)col;
 }
@@ -1026,7 +1026,7 @@ lbr_chartabsize_adv(
     int                retval;
 
     retval = lbr_chartabsize(line, *s, col);
-    mb_ptr_adv(*s);
+    MB_PTR_ADV(*s);
     return retval;
 }
 
@@ -1089,8 +1089,8 @@ win_lbr_chartabsize(
      * needs a break here
      */
     if (wp->w_p_lbr
-           && vim_isbreak(c)
-           && !vim_isbreak(s[1])
+           && VIM_ISBREAK(c)
+           && !VIM_ISBREAK(s[1])
            && wp->w_p_wrap
 # ifdef FEAT_WINDOWS
            && wp->w_width != 0
@@ -1115,12 +1115,12 @@ win_lbr_chartabsize(
        for (;;)
        {
            ps = s;
-           mb_ptr_adv(s);
+           MB_PTR_ADV(s);
            c = *s;
            if (!(c != NUL
-                   && (vim_isbreak(c)
-                       || (!vim_isbreak(c)
-                           && (col2 == col || !vim_isbreak(*ps))))))
+                   && (VIM_ISBREAK(c)
+                       || (!VIM_ISBREAK(c)
+                           && (col2 == col || !VIM_ISBREAK(*ps))))))
                break;
 
            col2 += win_chartabsize(wp, s, col2);
@@ -1369,7 +1369,7 @@ getvcol(
                break;
 
            vcol += incr;
-           mb_ptr_adv(ptr);
+           MB_PTR_ADV(ptr);
        }
     }
     else
@@ -1390,7 +1390,7 @@ getvcol(
                break;
 
            vcol += incr;
-           mb_ptr_adv(ptr);
+           MB_PTR_ADV(ptr);
        }
     }
     if (start != NULL)
index 7082b9adcb0d8208ab4555abe8f96a6c1ffc2ffc..45eaf0ff23f7fd4b52a2ac5cdff3aad3548cff4f 100644 (file)
@@ -857,7 +857,7 @@ edit(
 
                    if (str != NULL)
                    {
-                       for (p = str; *p != NUL; mb_ptr_adv(p))
+                       for (p = str; *p != NUL; MB_PTR_ADV(p))
                            ins_compl_addleader(PTR2CHAR(p));
                        vim_free(str);
                    }
@@ -1492,7 +1492,7 @@ normalchar:
                    if (*str != NUL && stop_arrow() != FAIL)
                    {
                        /* Insert the new value of v:char literally. */
-                       for (p = str; *p != NUL; mb_ptr_adv(p))
+                       for (p = str; *p != NUL; MB_PTR_ADV(p))
                        {
                            c = PTR2CHAR(p);
                            if (c == CAR || c == K_KENTER || c == NL)
@@ -2403,7 +2403,7 @@ ins_compl_add_infercase(
            actual_len = 0;
            while (*p != NUL)
            {
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
                ++actual_len;
            }
        }
@@ -2419,7 +2419,7 @@ ins_compl_add_infercase(
            actual_compl_length = 0;
            while (*p != NUL)
            {
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
                ++actual_compl_length;
            }
        }
@@ -2722,8 +2722,8 @@ ins_compl_longest_match(compl_T *match)
 #ifdef FEAT_MBYTE
            if (has_mbyte)
            {
-               mb_ptr_adv(p);
-               mb_ptr_adv(s);
+               MB_PTR_ADV(p);
+               MB_PTR_ADV(s);
            }
            else
 #endif
@@ -3474,7 +3474,7 @@ ins_compl_bs(void)
 
     line = ml_get_curline();
     p = line + curwin->w_cursor.col;
-    mb_ptr_back(line, p);
+    MB_PTR_BACK(line, p);
 
     /* Stop completion when the whole word was deleted.  For Omni completion
      * allow the word to be deleted, we won't match everything.
@@ -4023,7 +4023,7 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
        if (len > 0)
            len -= (*mb_head_off)(p, p + len);
 #endif
-       for (p += len; *p != NUL; mb_ptr_adv(p))
+       for (p += len; *p != NUL; MB_PTR_ADV(p))
            AppendCharToRedobuff(K_BS);
     }
     else
@@ -5336,9 +5336,9 @@ ins_complete(int c, int enable_pum)
            {
                char_u  *p = line + startcol;
 
-               mb_ptr_back(line, p);
+               MB_PTR_BACK(line, p);
                while (p > line && vim_isfilec(PTR2CHAR(p)))
-                   mb_ptr_back(line, p);
+                   MB_PTR_BACK(line, p);
                if (p == line && vim_isfilec(PTR2CHAR(p)))
                    startcol = 0;
                else
index 61843bcfbafee7874d44521dd0185d99633a1385..f52de721aa29ecd1be41e0dac4d8009c7f7797bf 100644 (file)
@@ -2551,7 +2551,7 @@ set_context_for_expression(
            for (p = arg + STRLEN(arg); p >= arg; )
            {
                xp->xp_pattern = p;
-               mb_ptr_back(arg, p);
+               MB_PTR_BACK(arg, p);
                if (vim_iswhite(*p))
                    break;
            }
@@ -4814,7 +4814,7 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
     /*
      * Find the end of the string, skipping backslashed characters.
      */
-    for (p = *arg + 1; *p != NUL && *p != '"'; mb_ptr_adv(p))
+    for (p = *arg + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
        {
@@ -4952,7 +4952,7 @@ get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate)
     /*
      * Find the end of the string, skipping ''.
      */
-    for (p = *arg + 1; *p != NUL; mb_ptr_adv(p))
+    for (p = *arg + 1; *p != NUL; MB_PTR_ADV(p))
     {
        if (*p == '\'')
        {
@@ -5910,7 +5910,7 @@ string_quote(char_u *str, int function)
     if (str != NULL)
     {
        len += (unsigned)STRLEN(str);
-       for (p = str; *p != NUL; mb_ptr_adv(p))
+       for (p = str; *p != NUL; MB_PTR_ADV(p))
            if (*p == '\'')
                ++len;
     }
@@ -6369,12 +6369,12 @@ find_name_end(
                        || *p == '{'
                        || ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.'))
                        || mb_nest != 0
-                       || br_nest != 0); mb_ptr_adv(p))
+                       || br_nest != 0); MB_PTR_ADV(p))
     {
        if (*p == '\'')
        {
            /* skip over 'string' to avoid counting [ and ] inside it. */
-           for (p = p + 1; *p != NUL && *p != '\''; mb_ptr_adv(p))
+           for (p = p + 1; *p != NUL && *p != '\''; MB_PTR_ADV(p))
                ;
            if (*p == NUL)
                break;
@@ -6382,7 +6382,7 @@ find_name_end(
        else if (*p == '"')
        {
            /* skip over "str\"ing" to avoid counting [ and ] inside it. */
-           for (p = p + 1; *p != NUL && *p != '"'; mb_ptr_adv(p))
+           for (p = p + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p))
                if (*p == '\\' && p[1] != NUL)
                    ++p;
            if (*p == NUL)
@@ -9410,7 +9410,7 @@ shortpath_for_partial(
     /* Count up the path separators from the RHS.. so we know which part
      * of the path to return. */
     sepcount = 0;
-    for (p = *fnamep; p < *fnamep + *fnamelen; mb_ptr_adv(p))
+    for (p = *fnamep; p < *fnamep + *fnamelen; MB_PTR_ADV(p))
        if (vim_ispathsep(*p))
            ++sepcount;
 
@@ -9528,7 +9528,7 @@ repeat:
        }
 
        /* When "/." or "/.." is used: force expansion to get rid of it. */
-       for (p = *fnamep; *p != NUL; mb_ptr_adv(p))
+       for (p = *fnamep; *p != NUL; MB_PTR_ADV(p))
        {
            if (vim_ispathsep(*p)
                    && p[1] == '.'
@@ -9658,7 +9658,7 @@ repeat:
        *usedlen += 2;
        s = get_past_head(*fnamep);
        while (tail > s && after_pathsep(s, tail))
-           mb_ptr_back(*fnamep, tail);
+           MB_PTR_BACK(*fnamep, tail);
        *fnamelen = (int)(tail - *fnamep);
 #ifdef VMS
        if (*fnamelen > 0)
@@ -9677,7 +9677,7 @@ repeat:
        else
        {
            while (tail > s && !after_pathsep(s, tail))
-               mb_ptr_back(*fnamep, tail);
+               MB_PTR_BACK(*fnamep, tail);
        }
     }
 
index 386183d68258f0f5d02c39841b17e719e2d88f68..898ad41eb3415394e4b485e8078afbc5d194b047 100644 (file)
@@ -4863,7 +4863,7 @@ do_sub(exarg_T *eap)
            }
            if (cmd[0] == '\\' && cmd[1] != 0)  /* skip escaped characters */
                ++cmd;
-           mb_ptr_adv(cmd);
+           MB_PTR_ADV(cmd);
        }
 
        if (!eap->skip)
index f8d35dc73d2d34a133ce8fc2018eea6c3ccc3f97..2da38b7ca9f2c09b36829cbd4856de4fc0a41dab 100644 (file)
@@ -3526,7 +3526,7 @@ add_pack_plugin(char_u *fname, void *cookie)
     {
        /* directory is not yet in 'runtimepath', add it */
        p4 = p3 = p2 = p1 = get_past_head(ffname);
-       for (p = p1; *p; mb_ptr_adv(p))
+       for (p = p1; *p; MB_PTR_ADV(p))
            if (vim_ispathsep_nocolon(*p))
            {
                p4 = p3; p3 = p2; p2 = p1; p1 = p;
index 0bf940f3198d57f17bceeee0eb7d5bc115cb4a2d..f107ee72e64ec1de81a1e4c0ac872e3d87ee5be9 100644 (file)
@@ -3696,7 +3696,7 @@ set_one_cmd_context(
                    return NULL;    /* It's a comment */
                }
            }
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
        }
     }
 
@@ -3720,7 +3720,7 @@ set_one_cmd_context(
        {
            if (*p == '\\' && *(p + 1) != NUL)
                ++p; /* skip over escaped character */
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
        }
     }
 
@@ -3780,7 +3780,7 @@ set_one_cmd_context(
                    else
 #endif
                        len = 1;
-                   mb_ptr_adv(p);
+                   MB_PTR_ADV(p);
                }
                if (in_quote)
                    bow = p;
@@ -3788,7 +3788,7 @@ set_one_cmd_context(
                    xp->xp_pattern = p;
                p -= len;
            }
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
        }
 
        /*
@@ -4204,7 +4204,7 @@ set_one_cmd_context(
                            arg = p + 1;
                        else if (*p == '\\' && *(p + 1) != NUL)
                            ++p; /* skip over escaped character */
-                       mb_ptr_adv(p);
+                       MB_PTR_ADV(p);
                    }
                    xp->xp_pattern = arg;
                }
@@ -5280,7 +5280,7 @@ separate_nextcmd(exarg_T *eap)
     p = eap->arg;
 #endif
 
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == Ctrl_V)
        {
@@ -5380,7 +5380,7 @@ skip_cmd_arg(
            else
                ++p;
        }
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     }
     return p;
 }
@@ -11861,7 +11861,7 @@ ses_put_fname(FILE *fd, char_u *name, unsigned *flagp)
     if (*flagp & SSOP_SLASH)
     {
        /* change all backslashes to forward slashes */
-       for (p = sname; *p != NUL; mb_ptr_adv(p))
+       for (p = sname; *p != NUL; MB_PTR_ADV(p))
            if (*p == '\\')
                *p = '/';
     }
index d3fda24c87a08187ffa48bb1301fd979b29efea3..01286ac29764d3fa779b30f632f0275e4d6e9ef7 100644 (file)
@@ -4296,7 +4296,7 @@ sm_gettail(char_u *s)
            t = p;
            had_sep = FALSE;
        }
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     }
     return t;
 }
@@ -5370,7 +5370,7 @@ ExpandRTDir(
        if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
        {
            e -= 4;
-           for (s = e; s > match; mb_ptr_back(match, s))
+           for (s = e; s > match; MB_PTR_BACK(match, s))
                if (s < match || vim_ispathsep(*s))
                    break;
            ++s;
index 48955e01ced682afd2c6221499f6252d5386a71c..25706cc02232ddf2ec148e0377753a9c2e0b1f47 100644 (file)
@@ -6247,7 +6247,7 @@ buf_modname(
      * Then truncate what is after the '/', '\' or ':' to 8 characters for
      * MSDOS and 26 characters for AMIGA, a lot more for UNIX.
      */
-    for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr))
+    for (ptr = retval + fnamelen; ptr > retval; MB_PTR_BACK(retval, ptr))
     {
        if (*ext == '.'
 #ifdef USE_LONG_FNAME
index db8da63ed1d7f7abfb23bf4b9a00462b1c3228df..9597ab8317aa4a04674856e2acf8c763a1ff3c51 100644 (file)
@@ -2064,7 +2064,7 @@ foldtext_cleanup(char_u *str)
        }
        else
        {
-           mb_ptr_adv(s);
+           MB_PTR_ADV(s);
        }
     }
 }
@@ -3249,7 +3249,7 @@ foldlevelMarker(fline_T *flp)
                --flp->lvl_next;
        }
        else
-           mb_ptr_adv(s);
+           MB_PTR_ADV(s);
     }
 
     /* The level can't go negative, must be missing a start marker. */
index 36d6975ed4e29a459a340c31db8b6b39abbd9b8f..34f9f20459df6f4e7b716b370863630d6a2aee93 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -4500,7 +4500,7 @@ scroll_line_len(linenr_T lnum)
        for (;;)
        {
            w = chartabsize(p, col);
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
            if (*p == NUL)              /* don't count the last character */
                break;
            col += w;
index c015d7ee66cabeef5554bdbe695c29c32a713f0b..d22a3ce5f81eecdaf1a2dcb5117abb6562347fd4 100644 (file)
@@ -1522,7 +1522,7 @@ split_button_string(char_u *button_string, int *n_buttons)
            else if (*p == DLG_HOTKEY_CHAR)
                *p++ = '_';
            else
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
        }
        array[count] = NULL; /* currently not relied upon, but doesn't hurt */
     }
index 559a4bef027469c66c731cc54ae007b1ead6608c..97e7e832239e198b427292b6cd5a1e629071d466 100644 (file)
@@ -8,6 +8,9 @@
 
 /*
  * macros.h: macro definitions for often used code
+ *
+ * Macros should be ALL_CAPS.  An exception is for where a function is
+ * replaced and an argument is not used more than once.
  */
 
 /*
 #endif
 
 /*
- * vim_isbreak() is used very often if 'linebreak' is set, use a macro to make
- * it work fast.
+ * VIM_ISBREAK() is used very often if 'linebreak' is set, use a macro to make
+ * it work fast.  Only works for single byte characters!
  */
-#define vim_isbreak(c) (breakat_flags[(char_u)(c)])
+#define VIM_ISBREAK(c) ((c) < 256 && breakat_flags[(char_u)(c)])
 
 /*
  * On VMS file names are different and require a translation.
 #  define mch_stat(n, p)       vim_stat((n), (p))
 # else
 #  ifdef STAT_IGNORES_SLASH
-    /* On Solaris stat() accepts "file/" as if it was "file".  Return -1 if
-     * the name ends in "/" and it's not a directory. */
-#   define mch_stat(n, p)      (illegal_slash(n) ? -1 : stat((n), (p)))
+#   define mch_stat(n, p)      vim_stat((n), (p))
 #  else
 #   define mch_stat(n, p)      stat((n), (p))
 #  endif
 #endif
 
 /*
- * mb_ptr_adv(): advance a pointer to the next character, taking care of
+ * MB_PTR_ADV(): advance a pointer to the next character, taking care of
  * multi-byte characters if needed.
- * mb_ptr_back(): backup a pointer to the previous character, taking care of
+ * MB_PTR_BACK(): backup a pointer to the previous character, taking care of
  * multi-byte characters if needed.
  * MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers.
  * PTR2CHAR(): get character from pointer.
  */
 #ifdef FEAT_MBYTE
 /* Get the length of the character p points to */
-# define MB_PTR2LEN(p)         (has_mbyte ? (*mb_ptr2len)(p) : 1)
+# define MB_PTR2LEN(p)     (has_mbyte ? (*mb_ptr2len)(p) : 1)
 /* Advance multi-byte pointer, skip over composing chars. */
-# define mb_ptr_adv(p)     p += has_mbyte ? (*mb_ptr2len)(p) : 1
+# define MB_PTR_ADV(p)     p += has_mbyte ? (*mb_ptr2len)(p) : 1
 /* Advance multi-byte pointer, do not skip over composing chars. */
-# define mb_cptr_adv(p)            p += enc_utf8 ? utf_ptr2len(p) : has_mbyte ? (*mb_ptr2len)(p) : 1
+# define MB_CPTR_ADV(p)            p += enc_utf8 ? utf_ptr2len(p) : has_mbyte ? (*mb_ptr2len)(p) : 1
 /* Backup multi-byte pointer. Only use with "p" > "s" ! */
-# define mb_ptr_back(s, p)  p -= has_mbyte ? ((*mb_head_off)(s, p - 1) + 1) : 1
+# define MB_PTR_BACK(s, p)  p -= has_mbyte ? ((*mb_head_off)(s, p - 1) + 1) : 1
 /* get length of multi-byte char, not including composing chars */
 # define MB_CPTR2LEN(p)            (enc_utf8 ? utf_ptr2len(p) : (*mb_ptr2len)(p))
 
 #else
 # define MB_PTR2LEN(p)         1
 # define MB_CPTR2LEN(p)                1
-# define mb_ptr_adv(p)         ++p
-# define mb_cptr_adv(p)                ++p
-# define mb_ptr_back(s, p)     --p
+# define MB_PTR_ADV(p)         ++p
+# define MB_CPTR_ADV(p)                ++p
+# define MB_PTR_BACK(s, p)     --p
 # define MB_COPY_CHAR(f, t)    *t++ = *f++
 # define MB_CHARLEN(p)         STRLEN(p)
 # define MB_CHAR2LEN(c)                1
index 0265160ab1e409a88e90c75a30a411fef968c683..194125eb0011522e067d6d94a5c3bffb52536862 100644 (file)
@@ -695,7 +695,7 @@ mark_line(pos_T *mp, int lead_len)
        return NULL;
     /* Truncate the line to fit it in the window */
     len = 0;
-    for (p = s; *p != NUL; mb_ptr_adv(p))
+    for (p = s; *p != NUL; MB_PTR_ADV(p))
     {
        len += ptr2cells(p);
        if (len >= Columns - lead_len)
index 11dc0fb3504fcbe76424606c012cc86cf912ecbf..d9bca6b07468ebbe3a09c9dd8718494c73603256 100644 (file)
@@ -4047,7 +4047,7 @@ mb_prevptr(
     char_u *p)
 {
     if (p > line)
-       mb_ptr_back(line, p);
+       MB_PTR_BACK(line, p);
     return p;
 }
 
@@ -5708,7 +5708,6 @@ static int xim_real_init(Window x11_window, Display *x11_display);
 
 
 #ifdef USE_X11R6_XIM
-static void xim_instantiate_cb(Display *display, XPointer client_data, XPointer        call_data);
 static void xim_destroy_cb(XIM im, XPointer client_data, XPointer call_data);
 
     static void
index f9852e55bbc591b5835040d34011b40f8038ba79..723bcd4bc512a5698398048fe40829e109f60b5b 100644 (file)
@@ -2028,7 +2028,7 @@ make_percent_swname(char_u *dir, char_u *name)
        if (s != NULL)
        {
            STRCPY(s, f);
-           for (d = s; *d != NUL; mb_ptr_adv(d))
+           for (d = s; *d != NUL; MB_PTR_ADV(d))
                if (vim_ispathsep(*d))
                    *d = '%';
            d = concat_fnames(dir, s, TRUE);
@@ -4015,7 +4015,7 @@ get_file_in_dir(
 
 #ifdef WIN3264
     if (retval != NULL)
-       for (t = gettail(retval); *t != NUL; mb_ptr_adv(t))
+       for (t = gettail(retval); *t != NUL; MB_PTR_ADV(t))
            if (*t == ':')
                *t = '%';
 #endif
@@ -4154,7 +4154,7 @@ findswapname(
        if (buf_fname == NULL)
            buf_fname = buf->b_fname;
        else
-           for (t = gettail(buf_fname); *t != NUL; mb_ptr_adv(t))
+           for (t = gettail(buf_fname); *t != NUL; MB_PTR_ADV(t))
                if (*t == ':')
                    *t = '%';
     }
index 05a229b45582829746d923fcde393929165486d6..b1b4ec7d41004a59a93fb54c6bac03409969b9fe 100644 (file)
@@ -152,7 +152,7 @@ ex_menu(
        {
            if (*arg == '\\')
                STRMOVE(arg, arg + 1);
-           mb_ptr_adv(arg);
+           MB_PTR_ADV(arg);
        }
        if (*arg != NUL)
        {
@@ -661,7 +661,7 @@ add_menu_path(
 
                    STRCPY(tearpath, menu_path);
                    idx = (int)(next_name - path_name - 1);
-                   for (s = tearpath; *s && s < tearpath + idx; mb_ptr_adv(s))
+                   for (s = tearpath; *s && s < tearpath + idx; MB_PTR_ADV(s))
                    {
                        if ((*s == '\\' || *s == Ctrl_V) && s[1])
                        {
@@ -1472,7 +1472,7 @@ menu_name_skip(char_u *name)
 {
     char_u  *p;
 
-    for (p = name; *p && *p != '.'; mb_ptr_adv(p))
+    for (p = name; *p && *p != '.'; MB_PTR_ADV(p))
     {
        if (*p == '\\' || *p == Ctrl_V)
        {
@@ -2485,7 +2485,7 @@ menu_unescape_name(char_u *name)
 {
     char_u  *p;
 
-    for (p = name; *p && *p != '.'; mb_ptr_adv(p))
+    for (p = name; *p && *p != '.'; MB_PTR_ADV(p))
        if (*p == '\\')
            STRMOVE(p, p + 1);
 }
index a4d2cc8f3a9732e0361b386de84e045353837d9d..06f8cb9f152a7a60efa7a9fe0ec86c71f5d41958 100644 (file)
@@ -3746,7 +3746,7 @@ msg_show_console_dialog(
            }
 
            /* advance to the next character */
-           mb_ptr_adv(r);
+           MB_PTR_ADV(r);
        }
 
        if (copy)
index e862219ab83b754feab27a4c248e3236d6b23a1d..97c333af64261e8dc287e4a020c4ba2978c932b8 100644 (file)
@@ -1140,7 +1140,7 @@ open_line(
 
                            while (old_size < repl_size && p > leader)
                            {
-                               mb_ptr_back(leader, p);
+                               MB_PTR_BACK(leader, p);
                                old_size += ptr2cells(p);
                            }
                            l = lead_repl_len - (int)(endp - p);
@@ -2070,7 +2070,7 @@ plines_win_col(win_T *wp, linenr_T lnum, long column)
     while (*s != NUL && --column >= 0)
     {
        col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL);
-       mb_ptr_adv(s);
+       MB_PTR_ADV(s);
     }
 
     /*
@@ -4837,7 +4837,7 @@ gettail(char_u *fname)
     {
        if (vim_ispathsep_nocolon(*p2))
            p1 = p2 + 1;
-       mb_ptr_adv(p2);
+       MB_PTR_ADV(p2);
     }
     return p1;
 }
@@ -4875,7 +4875,7 @@ gettail_dir(char_u *fname)
                dir_end = next_dir_end;
            look_for_sep = TRUE;
        }
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     }
     return dir_end;
 }
@@ -4910,7 +4910,7 @@ gettail_sep(char_u *fname)
 getnextcomp(char_u *fname)
 {
     while (*fname && !vim_ispathsep(*fname))
-       mb_ptr_adv(fname);
+       MB_PTR_ADV(fname);
     if (*fname)
        ++fname;
     return fname;
@@ -10378,7 +10378,7 @@ find_previous_pathsep(char_u *path, char_u **psep)
     {
        if (vim_ispathsep(**psep))
            return OK;
-       mb_ptr_back(path, *psep);
+       MB_PTR_BACK(path, *psep);
     }
 
     return FAIL;
@@ -10533,7 +10533,7 @@ get_path_cutoff(char_u *fname, garray_T *gap)
     /* skip to the file or directory name */
     if (cutoff != NULL)
        while (vim_ispathsep(*cutoff))
-           mb_ptr_adv(cutoff);
+           MB_PTR_ADV(cutoff);
 
     return cutoff;
 }
@@ -10790,7 +10790,7 @@ static int has_env_var(char_u *p);
     static int
 has_env_var(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
            ++p;
@@ -10816,7 +10816,7 @@ static int has_special_wildchar(char_u *p);
     static int
 has_special_wildchar(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        /* Allow for escaping. */
        if (*p == '\\' && p[1] != NUL)
@@ -11293,7 +11293,7 @@ get_isolated_shell_name(void)
 
        /* Find the last path separator before the space. */
        p1 = p_sh;
-       for (p2 = p_sh; p2 < p; mb_ptr_adv(p2))
+       for (p2 = p_sh; p2 < p; MB_PTR_ADV(p2))
            if (vim_ispathsep(*p2))
                p1 = p2 + 1;
        p = vim_strnsave(p1, (int)(p - p1));
index cfdfc4c4ac670b633a8f20f0901c99c14d151130..a6f3c1e21fd0256a35f2012d3eeca44856a41ddb 100644 (file)
@@ -196,7 +196,7 @@ coladvance2(
            /* Count a tab for what it's worth (if list mode not on) */
 #ifdef FEAT_LINEBREAK
            csize = win_lbr_chartabsize(curwin, line, ptr, col, &head);
-           mb_ptr_adv(ptr);
+           MB_PTR_ADV(ptr);
 #else
            csize = lbr_chartabsize_adv(line, &ptr, col);
 #endif
@@ -1418,7 +1418,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
 
     /* First count the number of extra bytes required. */
     length = (unsigned)STRLEN(string) + 3;  /* two quotes and a trailing NUL */
-    for (p = string; *p != NUL; mb_ptr_adv(p))
+    for (p = string; *p != NUL; MB_PTR_ADV(p))
     {
 # ifdef WIN32
        if (!p_ssl)
@@ -1950,7 +1950,7 @@ vim_strrchr(char_u *string, int c)
     {
        if (*p == c)
            retval = p;
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     }
     return retval;
 }
@@ -1971,7 +1971,7 @@ vim_strpbrk(char_u *s, char_u *charset)
     {
        if (vim_strchr(charset, *s) != NULL)
            return s;
-       mb_ptr_adv(s);
+       MB_PTR_ADV(s);
     }
     return NULL;
 }
@@ -3364,7 +3364,7 @@ vim_chdirfile(char_u *fname)
  * Used for systems where stat() ignores a trailing slash on a file name.
  * The Vim code assumes a trailing slash is only ignored for a directory.
  */
-    int
+    static int
 illegal_slash(char *name)
 {
     if (name[0] == NUL)
@@ -3375,6 +3375,17 @@ illegal_slash(char *name)
        return FALSE;       /* trailing slash for a directory */
     return TRUE;
 }
+
+/*
+ * Special implementation of mch_stat() for Solaris.
+ */
+    int
+vim_stat(const char *name, stat_T *stp)
+{
+    /* On Solaris stat() accepts "file/" as if it was "file".  Return -1 if
+     * the name ends in "/" and it's not a directory. */
+    return illegal_slash(n) ? -1 : stat(n, p);
+}
 #endif
 
 #if defined(CURSOR_SHAPE) || defined(PROTO)
index 8b883aa305907883c4aa238d4e67feb9df2fb14c..23856c8457f29f9253d226a852c33efb8ca4febb 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -486,7 +486,7 @@ shift_block(oparg_T *oap, int amount)
         * the part of which is displayed at the block's beginning. Let's start
         * searching from the next character. */
        if (bd.startspaces)
-           mb_ptr_adv(non_white);
+           MB_PTR_ADV(non_white);
 
        /* The character's column is in "bd.start_vcol".  */
        non_white_col = bd.start_vcol;
@@ -526,7 +526,7 @@ shift_block(oparg_T *oap, int amount)
            if (verbatim_copy_width + incr > destination_col)
                break;
            verbatim_copy_width += incr;
-           mb_ptr_adv(verbatim_copy_end);
+           MB_PTR_ADV(verbatim_copy_end);
        }
 
        /* If "destination_col" is different from the width of the initial
@@ -3458,7 +3458,7 @@ do_put(
                goto end;
            p = ml_get_cursor();
            if (dir == FORWARD && *p != NUL)
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
            ptr = vim_strsave(p);
            if (ptr == NULL)
                goto end;
@@ -3468,7 +3468,7 @@ do_put(
            oldp = ml_get_curline();
            p = oldp + curwin->w_cursor.col;
            if (dir == FORWARD && *p != NUL)
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
            ptr = vim_strnsave(oldp, p - oldp);
            if (ptr == NULL)
                goto end;
@@ -4489,11 +4489,11 @@ do_join(
            if (has_mbyte)
            {
                cend = curr + currsize;
-               mb_ptr_back(curr, cend);
+               MB_PTR_BACK(curr, cend);
                endcurr1 = (*mb_ptr2char)(cend);
                if (cend > curr)
                {
-                   mb_ptr_back(curr, cend);
+                   MB_PTR_BACK(curr, cend);
                    endcurr2 = (*mb_ptr2char)(cend);
                }
            }
@@ -5262,7 +5262,7 @@ block_prep(
        }
 #endif
        prev_pstart = pstart;
-       mb_ptr_adv(pstart);
+       MB_PTR_ADV(pstart);
     }
     bdp->start_char_vcols = incr;
     if (bdp->start_vcol < oap->start_vcol)     /* line too short */
index 2c4b1c247f246afba3c953d9a88decebf1128637..e6c05ec10c3c4b5f661ab0bacde3dcabad25acd2 100644 (file)
@@ -6785,7 +6785,7 @@ did_set_string_option(
        {
            if (ptr2cells(s) != 1)
                errmsg = (char_u *)N_("E595: contains unprintable or wide character");
-           mb_ptr_adv(s);
+           MB_PTR_ADV(s);
        }
     }
 #endif
@@ -11666,7 +11666,7 @@ ExpandOldSetting(int *num_file, char_u ***file)
 #ifdef BACKSLASH_IN_FILENAME
     /* For MS-Windows et al. we don't double backslashes at the start and
      * before a file name character. */
-    for (var = buf; *var != NUL; mb_ptr_adv(var))
+    for (var = buf; *var != NUL; MB_PTR_ADV(var))
        if (var[0] == '\\' && var[1] == '\\'
                && expand_option_idx >= 0
                && (options[expand_option_idx].flags & P_EXPAND)
@@ -11866,7 +11866,7 @@ langmap_set(void)
     for (p = p_langmap; p[0] != NUL; )
     {
        for (p2 = p; p2[0] != NUL && p2[0] != ',' && p2[0] != ';';
-                                                              mb_ptr_adv(p2))
+                                                              MB_PTR_ADV(p2))
        {
            if (p2[0] == '\\' && p2[1] != NUL)
                ++p2;
@@ -11892,7 +11892,7 @@ langmap_set(void)
            to = NUL;
            if (p2 == NULL)
            {
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
                if (p[0] != ',')
                {
                    if (p[0] == '\\')
@@ -11932,10 +11932,10 @@ langmap_set(void)
                langmap_mapchar[from & 255] = to;
 
            /* Advance to next pair */
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
            if (p2 != NULL)
            {
-               mb_ptr_adv(p2);
+               MB_PTR_ADV(p2);
                if (*p == ';')
                {
                    p = p2;
index 87fcca97e12fc7b234be1d565a64691ba6407758..85e0c4ef0e9344cf61bd98cde106a1b6594daf98 100644 (file)
@@ -1567,7 +1567,7 @@ sortcmp(const void *a, const void *b)
     int
 mch_has_exp_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
            ++p;
@@ -1580,7 +1580,7 @@ mch_has_exp_wildcard(char_u *p)
     int
 mch_has_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
            ++p;
index 5f6e11dab6bf76efb278e9512335fed76f9d0dac..a713ea190dfe38865da166bcbb08c669d5bd37ba 100644 (file)
@@ -454,7 +454,7 @@ slash_adjust(char_u *p)
     {
        if (*p == psepcN)
            *p = psepc;
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     }
 }
 
@@ -600,7 +600,7 @@ vim_stat(const char *name, stat_T *stp)
     vim_strncpy((char_u *)buf, (char_u *)name, sizeof(buf) - 1);
     p = buf + STRLEN(buf);
     if (p > buf)
-       mb_ptr_back(buf, p);
+       MB_PTR_BACK(buf, p);
 
     /* Remove trailing '\\' except root path. */
     if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':')
@@ -720,7 +720,7 @@ display_errors(void)
     int
 mch_has_exp_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (vim_strchr((char_u *)"?*[", *p) != NULL
                || (*p == '~' && p[1] != NUL))
@@ -736,7 +736,7 @@ mch_has_exp_wildcard(char_u *p)
     int
 mch_has_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (vim_strchr((char_u *)
 #  ifdef VIM_BACKTICK
index 9dd5c34e7ca866e84d79ef41e9835089f800c8f4..69868aca7b7507417ec58d39559be6ec0b238cd1 100644 (file)
@@ -6522,7 +6522,7 @@ save_patterns(
     int
 mch_has_exp_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
            ++p;
@@ -6546,7 +6546,7 @@ mch_has_exp_wildcard(char_u *p)
     int
 mch_has_wildcard(char_u *p)
 {
-    for ( ; *p; mb_ptr_adv(p))
+    for ( ; *p; MB_PTR_ADV(p))
     {
        if (*p == '\\' && p[1] != NUL)
            ++p;
index ed15920f1dc1aadf69e3809b5ef6c7bb2ea58783..6016f8631e89df38de3e445970913621c10ed1de 100644 (file)
@@ -5741,7 +5741,7 @@ write_chars(
        {
            char_u *p = pchBuf;
            for (n = 0; n < cchwritten; n++)
-               mb_cptr_adv(p);
+               MB_CPTR_ADV(p);
            written = p - pchBuf;
            g_coord.X += (SHORT)mb_string2cells(pchBuf, written);
        }
index fc5e1c32beddb7097f2599628e50ef6ce823d748..58e38176c814da14f9b921298989e9db4ea2f391 100644 (file)
@@ -335,7 +335,7 @@ pum_redraw(void)
                case 3: p = pum_array[idx].pum_extra; break;
            }
            if (p != NULL)
-               for ( ; ; mb_ptr_adv(p))
+               for ( ; ; MB_PTR_ADV(p))
                {
                    if (s == NULL)
                        s = p;
@@ -369,7 +369,7 @@ pum_redraw(void)
                                        {
                                            size -= has_mbyte
                                                    ? (*mb_ptr2cells)(rt) : 1;
-                                           mb_ptr_adv(rt);
+                                           MB_PTR_ADV(rt);
                                        } while (size > pum_width);
 
                                        if (size < pum_width)
index 83384c028c1ce12269da36dfe91369d94d6b4fab..68c40daa1fe759e5d1efbbaf18dcc5e54cef5d27 100644 (file)
@@ -83,7 +83,7 @@ int get_real_state(void);
 int after_pathsep(char_u *b, char_u *p);
 int same_directory(char_u *f1, char_u *f2);
 int vim_chdirfile(char_u *fname);
-int illegal_slash(char *name);
+int vim_stat(const char *name, stat_T *stp);
 char_u *parse_shape_opt(int what);
 int get_shape_idx(int mouse);
 void update_mouseshape(int shape_idx);
index b33c08b4dec51044c7277ff2bdcf22544bc068a5..57f3423c5ed9bda08149687630cba12b6c1defe4 100644 (file)
@@ -1205,7 +1205,7 @@ skip_anyof(char_u *p)
            {
                ++p;
                if (*p != ']' && *p != NUL)
-                   mb_ptr_adv(p);
+                   MB_PTR_ADV(p);
            }
        else if (*p == '\\'
                && !reg_cpo_bsl
@@ -1252,7 +1252,7 @@ skip_regexp(
        mymagic = MAGIC_OFF;
     get_cpo_flags();
 
-    for (; p[0] != NUL; mb_ptr_adv(p))
+    for (; p[0] != NUL; MB_PTR_ADV(p))
     {
        if (p[0] == dirc)       /* found end of regexp */
            break;
@@ -3864,7 +3864,7 @@ bt_regexec_both(
            {
                if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0)
                    break;              /* Found it. */
-               mb_ptr_adv(s);
+               MB_PTR_ADV(s);
            }
 #endif
        else
@@ -3872,7 +3872,7 @@ bt_regexec_both(
            {
                if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0)
                    break;              /* Found it. */
-               mb_ptr_adv(s);
+               MB_PTR_ADV(s);
            }
        if (s == NULL)          /* Not present. */
            goto theend;
@@ -4204,7 +4204,7 @@ reg_match_visual(void)
     return TRUE;
 }
 
-#define ADVANCE_REGINPUT() mb_ptr_adv(reginput)
+#define ADVANCE_REGINPUT() MB_PTR_ADV(reginput)
 
 /*
  * The arguments from BRACE_LIMITS are stored here.  They are actually local
@@ -4775,7 +4775,7 @@ regmatch(
            {
                /* Skip composing characters. */
                while (utf_iscomposing(utf_ptr2char(reginput)))
-                   mb_cptr_adv(reginput);
+                   MB_CPTR_ADV(reginput);
            }
 #endif
            break;
@@ -5557,7 +5557,7 @@ regmatch(
                        no = FAIL;
                    else
                    {
-                       mb_ptr_back(regline, rp->rs_un.regsave.rs_u.ptr);
+                       MB_PTR_BACK(regline, rp->rs_un.regsave.rs_u.ptr);
                        if (limit > 0 && (long)(behind_pos.rs_u.ptr
                                     - rp->rs_un.regsave.rs_u.ptr) > limit)
                            no = FAIL;
@@ -5644,7 +5644,7 @@ regmatch(
                                fast_breakcheck();
                            }
                            else
-                               mb_ptr_back(regline, reginput);
+                               MB_PTR_BACK(regline, reginput);
                        }
                        else
                        {
@@ -5788,7 +5788,7 @@ regrepeat(
            while (*scan != NUL && count < maxcount)
            {
                ++count;
-               mb_ptr_adv(scan);
+               MB_PTR_ADV(scan);
            }
            if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline
                                      || rex.reg_line_lbr || count == maxcount)
@@ -5811,7 +5811,7 @@ regrepeat(
        {
            if (vim_isIDc(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
            {
-               mb_ptr_adv(scan);
+               MB_PTR_ADV(scan);
            }
            else if (*scan == NUL)
            {
@@ -5842,7 +5842,7 @@ regrepeat(
            if (vim_iswordp_buf(scan, rex.reg_buf)
                                          && (testval || !VIM_ISDIGIT(*scan)))
            {
-               mb_ptr_adv(scan);
+               MB_PTR_ADV(scan);
            }
            else if (*scan == NUL)
            {
@@ -5872,7 +5872,7 @@ regrepeat(
        {
            if (vim_isfilec(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
            {
-               mb_ptr_adv(scan);
+               MB_PTR_ADV(scan);
            }
            else if (*scan == NUL)
            {
@@ -5913,7 +5913,7 @@ regrepeat(
            else if (vim_isprintc(PTR2CHAR(scan)) == 1
                                          && (testval || !VIM_ISDIGIT(*scan)))
            {
-               mb_ptr_adv(scan);
+               MB_PTR_ADV(scan);
            }
            else if (rex.reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
                ++scan;
@@ -7546,7 +7546,7 @@ vim_regsub_both(
            {
                int had_backslash = FALSE;
 
-               for (s = eval_result; *s != NUL; mb_ptr_adv(s))
+               for (s = eval_result; *s != NUL; MB_PTR_ADV(s))
                {
                    /* Change NL to CR, so that it becomes a line break,
                     * unless called from vim_regexec_nl().
index de22dcbacc16d35a805ea9e04895c701a79e17ab..13f5065e84bff62d0e7504d617755b1785909f32 100644 (file)
@@ -1425,7 +1425,7 @@ nfa_regatom(void)
                    EMSG(_(e_nopresub));
                    return FAIL;
                }
-               for (lp = reg_prev_sub; *lp != NUL; mb_cptr_adv(lp))
+               for (lp = reg_prev_sub; *lp != NUL; MB_CPTR_ADV(lp))
                {
                    EMIT(PTR2CHAR(lp));
                    if (lp != reg_prev_sub)
@@ -1672,7 +1672,7 @@ collection:
                    else
                        EMIT(result);
                    regparse = endp;
-                   mb_ptr_adv(regparse);
+                   MB_PTR_ADV(regparse);
                    return OK;
                }
                /*
@@ -1684,7 +1684,7 @@ collection:
                if (*regparse == '^')                   /* negated range */
                {
                    negated = TRUE;
-                   mb_ptr_adv(regparse);
+                   MB_PTR_ADV(regparse);
                    EMIT(NFA_START_NEG_COLL);
                }
                else
@@ -1694,7 +1694,7 @@ collection:
                    startc = '-';
                    EMIT(startc);
                    EMIT(NFA_CONCAT);
-                   mb_ptr_adv(regparse);
+                   MB_PTR_ADV(regparse);
                }
                /* Emit the OR branches for each character in the [] */
                emit_range = FALSE;
@@ -1797,7 +1797,7 @@ collection:
                    {
                        emit_range = TRUE;
                        startc = oldstartc;
-                       mb_ptr_adv(regparse);
+                       MB_PTR_ADV(regparse);
                        continue;           /* reading the end of the range */
                    }
 
@@ -1817,7 +1817,7 @@ collection:
                            )
                        )
                    {
-                       mb_ptr_adv(regparse);
+                       MB_PTR_ADV(regparse);
 
                        if (*regparse == 'n')
                            startc = reg_string ? NL : NFA_NEWL;
@@ -1832,7 +1832,7 @@ collection:
                                /* TODO(RE) This needs more testing */
                                startc = coll_get_char();
                                got_coll_char = TRUE;
-                               mb_ptr_back(old_regparse, regparse);
+                               MB_PTR_BACK(old_regparse, regparse);
                            }
                            else
                            {
@@ -1932,10 +1932,10 @@ collection:
                        }
                    }
 
-                   mb_ptr_adv(regparse);
+                   MB_PTR_ADV(regparse);
                } /* while (p < endp) */
 
-               mb_ptr_back(old_regparse, regparse);
+               MB_PTR_BACK(old_regparse, regparse);
                if (*regparse == '-')       /* if last, '-' is just a char */
                {
                    EMIT('-');
@@ -1944,7 +1944,7 @@ collection:
 
                /* skip the trailing ] */
                regparse = endp;
-               mb_ptr_adv(regparse);
+               MB_PTR_ADV(regparse);
 
                /* Mark end of the collection. */
                if (negated == TRUE)
index 306308b0a164c94f11cbb71dddcba4fe94a0b468..a609076f110736be0bec6f4a2babc9b2809fd785 100644 (file)
@@ -3397,7 +3397,7 @@ win_line(
 #ifdef FEAT_MBYTE
            prev_ptr = ptr;
 #endif
-           mb_ptr_adv(ptr);
+           MB_PTR_ADV(ptr);
        }
 
        /* When:
@@ -4554,7 +4554,7 @@ win_line(
                 * Found last space before word: check for line break.
                 */
                if (wp->w_p_lbr && c0 == c
-                                     && vim_isbreak(c) && !vim_isbreak(*ptr))
+                                     && VIM_ISBREAK(c) && !VIM_ISBREAK(*ptr))
                {
 # ifdef FEAT_MBYTE
                    int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
@@ -6408,7 +6408,7 @@ status_match_len(expand_T *xp, char_u *s)
     {
        s += skip_status_match_char(xp, s);
        len += ptr2cells(s);
-       mb_ptr_adv(s);
+       MB_PTR_ADV(s);
     }
 
     return len;
@@ -10469,7 +10469,7 @@ draw_tabline(void)
                    while (len > room)
                    {
                        len -= ptr2cells(p);
-                       mb_ptr_adv(p);
+                       MB_PTR_ADV(p);
                    }
                else
 #endif
index 101bcff05aee4e64706ae09fe6a19f1a4cc99aa3..51d87601933e313ed3586c60d21d2014e0354237 100644 (file)
@@ -3828,7 +3828,7 @@ in_html_tag(
 
        /* We search forward until the cursor, because searching backwards is
         * very slow for DBCS encodings. */
-       for (p = line; p < line + curwin->w_cursor.col; mb_ptr_adv(p))
+       for (p = line; p < line + curwin->w_cursor.col; MB_PTR_ADV(p))
            if (*p == '>' || *p == '<')
            {
                lc = *p;
@@ -3848,7 +3848,7 @@ in_html_tag(
        {
            if (*p == '<')      /* find '<' under/before cursor */
                break;
-           mb_ptr_back(line, p);
+           MB_PTR_BACK(line, p);
            if (*p == '>')      /* find '>' before cursor */
                break;
        }
@@ -3859,7 +3859,7 @@ in_html_tag(
     pos.lnum = curwin->w_cursor.lnum;
     pos.col = (colnr_T)(p - line);
 
-    mb_ptr_adv(p);
+    MB_PTR_ADV(p);
     if (end_tag)
        /* check that there is a '/' after the '<' */
        return *p == '/';
@@ -3974,7 +3974,7 @@ again:
      */
     inc_cursor();
     p = ml_get_cursor();
-    for (cp = p; *cp != NUL && *cp != '>' && !vim_iswhite(*cp); mb_ptr_adv(cp))
+    for (cp = p; *cp != NUL && *cp != '>' && !vim_iswhite(*cp); MB_PTR_ADV(cp))
        ;
     len = (int)(cp - p);
     if (len == 0)
index 1e1f03f056242a8182083e52c29c610dcd6c07c2..62299dca60535502c40dc28bdc9771bce78bd0e6 100644 (file)
@@ -468,7 +468,7 @@ spell_check(
     {
        do
        {
-           mb_ptr_adv(mi.mi_fend);
+           MB_PTR_ADV(mi.mi_fend);
        } while (*mi.mi_fend != NUL && spell_iswordp(mi.mi_fend, wp));
 
        if (capcol != NULL && *capcol == 0 && wp->w_s->b_cap_prog != NULL)
@@ -494,7 +494,7 @@ spell_check(
     /* case-fold the word with one non-word character, so that we can check
      * for the word end. */
     if (*mi.mi_fend != NUL)
-       mb_ptr_adv(mi.mi_fend);
+       MB_PTR_ADV(mi.mi_fend);
 
     (void)spell_casefold(ptr, (int)(mi.mi_fend - ptr), mi.mi_fword,
                                                             MAXWLEN + 1);
@@ -582,7 +582,7 @@ spell_check(
        else if (mi.mi_end == ptr)
            /* Always include at least one character.  Required for when there
             * is a mixup in "midword". */
-           mb_ptr_adv(mi.mi_end);
+           MB_PTR_ADV(mi.mi_end);
        else if (mi.mi_result == SP_BAD
                && LANGP_ENTRY(wp->w_s->b_langp, 0)->lp_slang->sl_nobreak)
        {
@@ -598,8 +598,8 @@ spell_check(
                fp = mi.mi_fword;
                for (;;)
                {
-                   mb_ptr_adv(p);
-                   mb_ptr_adv(fp);
+                   MB_PTR_ADV(p);
+                   MB_PTR_ADV(fp);
                    if (p >= mi.mi_end)
                        break;
                    mi.mi_compoff = (int)(fp - mi.mi_fword);
@@ -827,8 +827,8 @@ find_word(matchinf_T *mip, int mode)
            p = mip->mi_word;
            if (STRNCMP(ptr, p, wlen) != 0)
            {
-               for (s = ptr; s < ptr + wlen; mb_ptr_adv(s))
-                   mb_ptr_adv(p);
+               for (s = ptr; s < ptr + wlen; MB_PTR_ADV(s))
+                   MB_PTR_ADV(p);
                wlen = (int)(p - mip->mi_word);
            }
        }
@@ -952,8 +952,8 @@ find_word(matchinf_T *mip, int mode)
                    {
                        /* case folding may have changed the length */
                        p = mip->mi_word;
-                       for (s = ptr; s < ptr + mip->mi_compoff; mb_ptr_adv(s))
-                           mb_ptr_adv(p);
+                       for (s = ptr; s < ptr + mip->mi_compoff; MB_PTR_ADV(s))
+                           MB_PTR_ADV(p);
                    }
                    else
 #endif
@@ -969,7 +969,7 @@ find_word(matchinf_T *mip, int mode)
                         * character we do not accept a Onecap word.  We do
                         * accept a no-caps word, even when the dictionary
                         * word specifies ONECAP. */
-                       mb_ptr_back(mip->mi_word, p);
+                       MB_PTR_BACK(mip->mi_word, p);
                        if (spell_iswordp_nmw(p, mip->mi_win)
                                ? capflags == WF_ONECAP
                                : (flags & WF_ONECAP) != 0
@@ -1038,8 +1038,8 @@ find_word(matchinf_T *mip, int mode)
                    p = mip->mi_fword;
                    if (STRNCMP(ptr, p, wlen) != 0)
                    {
-                       for (s = ptr; s < ptr + wlen; mb_ptr_adv(s))
-                           mb_ptr_adv(p);
+                       for (s = ptr; s < ptr + wlen; MB_PTR_ADV(s))
+                           MB_PTR_ADV(p);
                        mip->mi_compoff = (int)(p - mip->mi_fword);
                    }
                }
@@ -1506,12 +1506,12 @@ fold_more(matchinf_T *mip)
     p = mip->mi_fend;
     do
     {
-       mb_ptr_adv(mip->mi_fend);
+       MB_PTR_ADV(mip->mi_fend);
     } while (*mip->mi_fend != NUL && spell_iswordp(mip->mi_fend, mip->mi_win));
 
     /* Include the non-word character so that we can check for the word end. */
     if (*mip->mi_fend != NUL)
-       mb_ptr_adv(mip->mi_fend);
+       MB_PTR_ADV(mip->mi_fend);
 
     (void)spell_casefold(p, (int)(mip->mi_fend - p),
                             mip->mi_fword + mip->mi_fwordlen,
@@ -2760,7 +2760,7 @@ captype(
     int                past_second = FALSE;    /* past second word char */
 
     /* find first letter */
-    for (p = word; !spell_iswordp_nmw(p, curwin); mb_ptr_adv(p))
+    for (p = word; !spell_iswordp_nmw(p, curwin); MB_PTR_ADV(p))
        if (end == NULL ? *p == NUL : p >= end)
            return 0;       /* only non-word characters, illegal word */
 #ifdef FEAT_MBYTE
@@ -2775,7 +2775,7 @@ captype(
      * Need to check all letters to find a word with mixed upper/lower.
      * But a word with an upper char only at start is a ONECAP.
      */
-    for ( ; end == NULL ? *p != NUL : p < end; mb_ptr_adv(p))
+    for ( ; end == NULL ? *p != NUL : p < end; MB_PTR_ADV(p))
        if (spell_iswordp_nmw(p, curwin))
        {
            c = PTR2CHAR(p);
@@ -2818,7 +2818,7 @@ badword_captype(char_u *word, char_u *end)
        /* Count the number of UPPER and lower case letters. */
        l = u = 0;
        first = FALSE;
-       for (p = word; p < end; mb_ptr_adv(p))
+       for (p = word; p < end; MB_PTR_ADV(p))
        {
            c = PTR2CHAR(p);
            if (SPELL_ISUPPER(c))
@@ -3385,10 +3385,10 @@ spell_suggest(int count)
        p = line + curwin->w_cursor.col;
        /* Backup to before start of word. */
        while (p > line && spell_iswordp_nmw(p, curwin))
-           mb_ptr_back(line, p);
+           MB_PTR_BACK(line, p);
        /* Forward to start of word. */
        while (*p != NUL && !spell_iswordp_nmw(p, curwin))
-           mb_ptr_adv(p);
+           MB_PTR_ADV(p);
 
        if (!spell_iswordp_nmw(p, curwin))              /* No word found. */
        {
@@ -3624,7 +3624,7 @@ check_need_cap(linenr_T lnum, colnr_T col)
        p = line + endcol;
        for (;;)
        {
-           mb_ptr_back(line, p);
+           MB_PTR_BACK(line, p);
            if (p == line || spell_iswordp_nmw(p, curwin))
                break;
            if (vim_regexec(&regmatch, p, 0)
@@ -4644,7 +4644,7 @@ suggest_trie_walk(
 
                    /* Get pointer to last char of previous word. */
                    p = preword + sp->ts_prewordlen;
-                   mb_ptr_back(preword, p);
+                   MB_PTR_BACK(preword, p);
                }
            }
 
@@ -4746,11 +4746,11 @@ suggest_trie_walk(
                    /* Give a penalty when changing non-word char to word
                     * char, e.g., "thes," -> "these". */
                    p = fword + sp->ts_fidx;
-                   mb_ptr_back(fword, p);
+                   MB_PTR_BACK(fword, p);
                    if (!spell_iswordp(p, curwin))
                    {
                        p = preword + STRLEN(preword);
-                       mb_ptr_back(preword, p);
+                       MB_PTR_BACK(preword, p);
                        if (spell_iswordp(p, curwin))
                            newscore += SCORE_NONWORD;
                    }
@@ -5157,7 +5157,7 @@ suggest_trie_walk(
                                     * to the score.  Also for the soundfold
                                     * tree (might seem illogical but does
                                     * give better scores). */
-                                   mb_ptr_back(tword, p);
+                                   MB_PTR_BACK(tword, p);
                                    if (c == mb_ptr2char(p))
                                        sp->ts_score -= SCORE_INS
                                                               - SCORE_INSDUP;
@@ -5867,9 +5867,9 @@ nofold_len(char_u *fword, int flen, char_u *word)
     char_u     *p;
     int                i = 0;
 
-    for (p = fword; p < fword + flen; mb_ptr_adv(p))
+    for (p = fword; p < fword + flen; MB_PTR_ADV(p))
        ++i;
-    for (p = word; i > 0; mb_ptr_adv(p))
+    for (p = word; i > 0; MB_PTR_ADV(p))
        --i;
     return (int)(p - word);
 }
@@ -6745,8 +6745,8 @@ add_suggestion(
        badlen = (int)(pbad - su->su_badptr);
        if (goodlen <= 0 || badlen <= 0)
            break;
-       mb_ptr_back(goodword, pgood);
-       mb_ptr_back(su->su_badptr, pbad);
+       MB_PTR_BACK(goodword, pgood);
+       MB_PTR_BACK(su->su_badptr, pbad);
 #ifdef FEAT_MBYTE
        if (has_mbyte)
        {
@@ -8976,7 +8976,7 @@ spell_to_word_end(char_u *start, win_T *win)
     char_u  *p = start;
 
     while (*p != NUL && spell_iswordp(p, win))
-       mb_ptr_adv(p);
+       MB_PTR_ADV(p);
     return p;
 }
 
@@ -9002,7 +9002,7 @@ spell_word_start(int startcol)
     line = ml_get_curline();
     for (p = line + startcol; p > line; )
     {
-       mb_ptr_back(line, p);
+       MB_PTR_BACK(line, p);
        if (spell_iswordp_nmw(p, curwin))
            break;
     }
@@ -9011,7 +9011,7 @@ spell_word_start(int startcol)
     while (p > line)
     {
        col = (int)(p - line);
-       mb_ptr_back(line, p);
+       MB_PTR_BACK(line, p);
        if (!spell_iswordp(p, curwin))
            break;
        col = 0;
index 00ef019a6a6ffbdc3ba920bbd3adf25b43005d41..6188aaf40ce3e2f9a6b89450074c89a554e94a53 100644 (file)
@@ -1429,7 +1429,7 @@ set_sofo(slang_T *lp, char_u *from, char_u *to)
        for (p = from, s = to; *p != NUL && *s != NUL; )
        {
            c = mb_cptr2char_adv(&p);
-           mb_cptr_adv(s);
+           MB_CPTR_ADV(s);
            if (c >= 256)
                ++lp->sl_sal_first[c & 0xff];
        }
@@ -2802,7 +2802,7 @@ spell_read_aff(spellinfo_T *spin, char_u *fname)
                            {
                                p = aff_entry->ae_add
                                                  + STRLEN(aff_entry->ae_add);
-                               mb_ptr_back(aff_entry->ae_add, p);
+                               MB_PTR_BACK(aff_entry->ae_add, p);
                                if (PTR2CHAR(p) == c_up)
                                {
                                    upper = TRUE;
@@ -2930,10 +2930,10 @@ spell_read_aff(spellinfo_T *spin, char_u *fname)
                {
                    /* Replace underscore with space (can't include a space
                     * directly). */
-                   for (p = items[1]; *p != NUL; mb_ptr_adv(p))
+                   for (p = items[1]; *p != NUL; MB_PTR_ADV(p))
                        if (*p == '_')
                            *p = ' ';
-                   for (p = items[2]; *p != NUL; mb_ptr_adv(p))
+                   for (p = items[2]; *p != NUL; MB_PTR_ADV(p))
                        if (*p == '_')
                            *p = ' ';
                    add_fromto(spin, items[0][3] == 'S'
@@ -3624,7 +3624,7 @@ spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
        /* Truncate the word at the "/", set "afflist" to what follows.
         * Replace "\/" by "/" and "\\" by "\". */
        afflist = NULL;
-       for (p = w; *p != NUL; mb_ptr_adv(p))
+       for (p = w; *p != NUL; MB_PTR_ADV(p))
        {
            if (*p == '\\' && (p[1] == '\\' || p[1] == '/'))
                STRMOVE(p, p + 1);
@@ -3947,7 +3947,7 @@ store_aff_word(
                                {
                                    i = mb_charlen(ae->ae_chop);
                                    for ( ; i > 0; --i)
-                                       mb_ptr_adv(p);
+                                       MB_PTR_ADV(p);
                                }
                                else
 #endif
@@ -3965,7 +3965,7 @@ store_aff_word(
                                p = newword + STRLEN(newword);
                                i = (int)MB_CHARLEN(ae->ae_chop);
                                for ( ; i > 0; --i)
-                                   mb_ptr_back(newword, p);
+                                   MB_PTR_BACK(newword, p);
                                *p = NUL;
                            }
                            if (ae->ae_add != NULL)
index b13bd93a2aa846f0b4bcd1ea2cba3acce685c427..12de24459f30578e0111c23d006ee6d59496eb7f 100644 (file)
@@ -3211,12 +3211,12 @@ syn_add_end_off(
        if (off > 0)
        {
            while (off-- > 0 && *p != NUL)
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
        }
        else if (off < 0)
        {
            while (off++ < 0 && base < p)
-               mb_ptr_back(base, p);
+               MB_PTR_BACK(base, p);
        }
        col = (int)(p - base);
     }
@@ -3265,12 +3265,12 @@ syn_add_start_off(
        if (off > 0)
        {
            while (off-- && *p != NUL)
-               mb_ptr_adv(p);
+               MB_PTR_ADV(p);
        }
        else if (off < 0)
        {
            while (off++ && base < p)
-               mb_ptr_back(base, p);
+               MB_PTR_BACK(base, p);
        }
        col = (int)(p - base);
     }
index 1dfe0a117bcd0eeeeffbfdf539d9ae6ce784d178..b92ab93bbe59801f16ed86e594b5ce05cf68f2b1 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -3544,7 +3544,7 @@ simplify_filename(char_u *filename)
                tail = p + 1;
                if (p[1] != NUL)
                    while (vim_ispathsep(*tail))
-                       mb_ptr_adv(tail);
+                       MB_PTR_ADV(tail);
                else if (p > start)
                    --p;                /* strip preceding path separator */
                STRMOVE(p, tail);
@@ -3556,7 +3556,7 @@ simplify_filename(char_u *filename)
            /* Skip to after ".." or "../" or "..///". */
            tail = p + 2;
            while (vim_ispathsep(*tail))
-               mb_ptr_adv(tail);
+               MB_PTR_ADV(tail);
 
            if (components > 0)         /* strip one preceding component */
            {
@@ -3583,7 +3583,7 @@ simplify_filename(char_u *filename)
                    --p;
                    /* Skip back to after previous '/'. */
                    while (p > start && !after_pathsep(start, p))
-                       mb_ptr_back(start, p);
+                       MB_PTR_BACK(start, p);
 
                    if (!do_strip)
                    {
index d89c500ae34fd41388c42cd9bd8750b90e053272..cc1ef18bb2cfde519a831001e4f68a15d84477fd 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -3192,7 +3192,7 @@ vcol2col(win_T *wp, linenr_T lnum, int vcol)
     while (count < vcol && *ptr != NUL)
     {
        count += win_lbr_chartabsize(wp, line, ptr, count, NULL);
-       mb_ptr_adv(ptr);
+       MB_PTR_ADV(ptr);
     }
     return (int)(ptr - line);
 }
index 833deca87de5bf604fcca9563b1b95e69c862368..039321c171983bbf4f12e48b0e61495120edaf3a 100644 (file)
@@ -833,7 +833,7 @@ u_get_undo_file_name(char_u *buf_ffname, int reading)
                    munged_name = vim_strsave(ffname);
                    if (munged_name == NULL)
                        return NULL;
-                   for (p = munged_name; *p != NUL; mb_ptr_adv(p))
+                   for (p = munged_name; *p != NUL; MB_PTR_ADV(p))
                        if (vim_ispathsep(*p))
                            *p = '%';
                }
index 257cba121133cdd8e6c778b44a5272bf47616a92..2c40f30b8579f9ebff1a813fd6a6f08432d51fe9 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    451,
 /**/
     450,
 /**/
index c9771af58f71737555a0ddefc9852f2176936db1..43c9ed2c07688431f8238209cbfa2983f38af4b1 100644 (file)
@@ -6127,7 +6127,7 @@ file_name_in_line(
      */
     ptr = line + col;
     while (*ptr != NUL && !vim_isfilec(*ptr))
-       mb_ptr_adv(ptr);
+       MB_PTR_ADV(ptr);
     if (*ptr == NUL)           /* nothing found */
     {
        if (options & FNAME_MESS)