Skip to content

Commit 91acfff

Browse files
committed
patch 8.0.0451: some macros are in lower case
Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice.
1 parent 47ffb90 commit 91acfff

39 files changed

+207
-194
lines changed

src/charset.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ win_linetabsize(win_T *wp, char_u *line, colnr_T len)
870870
char_u *s;
871871

872872
for (s = line; *s != NUL && (len == MAXCOL || s < line + len);
873-
mb_ptr_adv(s))
873+
MB_PTR_ADV(s))
874874
col += win_lbr_chartabsize(wp, line, s, col, NULL);
875875
return (int)col;
876876
}
@@ -1026,7 +1026,7 @@ lbr_chartabsize_adv(
10261026
int retval;
10271027

10281028
retval = lbr_chartabsize(line, *s, col);
1029-
mb_ptr_adv(*s);
1029+
MB_PTR_ADV(*s);
10301030
return retval;
10311031
}
10321032

@@ -1089,8 +1089,8 @@ win_lbr_chartabsize(
10891089
* needs a break here
10901090
*/
10911091
if (wp->w_p_lbr
1092-
&& vim_isbreak(c)
1093-
&& !vim_isbreak(s[1])
1092+
&& VIM_ISBREAK(c)
1093+
&& !VIM_ISBREAK(s[1])
10941094
&& wp->w_p_wrap
10951095
# ifdef FEAT_WINDOWS
10961096
&& wp->w_width != 0
@@ -1115,12 +1115,12 @@ win_lbr_chartabsize(
11151115
for (;;)
11161116
{
11171117
ps = s;
1118-
mb_ptr_adv(s);
1118+
MB_PTR_ADV(s);
11191119
c = *s;
11201120
if (!(c != NUL
1121-
&& (vim_isbreak(c)
1122-
|| (!vim_isbreak(c)
1123-
&& (col2 == col || !vim_isbreak(*ps))))))
1121+
&& (VIM_ISBREAK(c)
1122+
|| (!VIM_ISBREAK(c)
1123+
&& (col2 == col || !VIM_ISBREAK(*ps))))))
11241124
break;
11251125

11261126
col2 += win_chartabsize(wp, s, col2);
@@ -1369,7 +1369,7 @@ getvcol(
13691369
break;
13701370

13711371
vcol += incr;
1372-
mb_ptr_adv(ptr);
1372+
MB_PTR_ADV(ptr);
13731373
}
13741374
}
13751375
else
@@ -1390,7 +1390,7 @@ getvcol(
13901390
break;
13911391

13921392
vcol += incr;
1393-
mb_ptr_adv(ptr);
1393+
MB_PTR_ADV(ptr);
13941394
}
13951395
}
13961396
if (start != NULL)

src/edit.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ edit(
857857

858858
if (str != NULL)
859859
{
860-
for (p = str; *p != NUL; mb_ptr_adv(p))
860+
for (p = str; *p != NUL; MB_PTR_ADV(p))
861861
ins_compl_addleader(PTR2CHAR(p));
862862
vim_free(str);
863863
}
@@ -1492,7 +1492,7 @@ edit(
14921492
if (*str != NUL && stop_arrow() != FAIL)
14931493
{
14941494
/* Insert the new value of v:char literally. */
1495-
for (p = str; *p != NUL; mb_ptr_adv(p))
1495+
for (p = str; *p != NUL; MB_PTR_ADV(p))
14961496
{
14971497
c = PTR2CHAR(p);
14981498
if (c == CAR || c == K_KENTER || c == NL)
@@ -2403,7 +2403,7 @@ ins_compl_add_infercase(
24032403
actual_len = 0;
24042404
while (*p != NUL)
24052405
{
2406-
mb_ptr_adv(p);
2406+
MB_PTR_ADV(p);
24072407
++actual_len;
24082408
}
24092409
}
@@ -2419,7 +2419,7 @@ ins_compl_add_infercase(
24192419
actual_compl_length = 0;
24202420
while (*p != NUL)
24212421
{
2422-
mb_ptr_adv(p);
2422+
MB_PTR_ADV(p);
24232423
++actual_compl_length;
24242424
}
24252425
}
@@ -2722,8 +2722,8 @@ ins_compl_longest_match(compl_T *match)
27222722
#ifdef FEAT_MBYTE
27232723
if (has_mbyte)
27242724
{
2725-
mb_ptr_adv(p);
2726-
mb_ptr_adv(s);
2725+
MB_PTR_ADV(p);
2726+
MB_PTR_ADV(s);
27272727
}
27282728
else
27292729
#endif
@@ -3474,7 +3474,7 @@ ins_compl_bs(void)
34743474

34753475
line = ml_get_curline();
34763476
p = line + curwin->w_cursor.col;
3477-
mb_ptr_back(line, p);
3477+
MB_PTR_BACK(line, p);
34783478

34793479
/* Stop completion when the whole word was deleted. For Omni completion
34803480
* allow the word to be deleted, we won't match everything.
@@ -4023,7 +4023,7 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
40234023
if (len > 0)
40244024
len -= (*mb_head_off)(p, p + len);
40254025
#endif
4026-
for (p += len; *p != NUL; mb_ptr_adv(p))
4026+
for (p += len; *p != NUL; MB_PTR_ADV(p))
40274027
AppendCharToRedobuff(K_BS);
40284028
}
40294029
else
@@ -5336,9 +5336,9 @@ ins_complete(int c, int enable_pum)
53365336
{
53375337
char_u *p = line + startcol;
53385338

5339-
mb_ptr_back(line, p);
5339+
MB_PTR_BACK(line, p);
53405340
while (p > line && vim_isfilec(PTR2CHAR(p)))
5341-
mb_ptr_back(line, p);
5341+
MB_PTR_BACK(line, p);
53425342
if (p == line && vim_isfilec(PTR2CHAR(p)))
53435343
startcol = 0;
53445344
else

src/eval.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ set_context_for_expression(
25512551
for (p = arg + STRLEN(arg); p >= arg; )
25522552
{
25532553
xp->xp_pattern = p;
2554-
mb_ptr_back(arg, p);
2554+
MB_PTR_BACK(arg, p);
25552555
if (vim_iswhite(*p))
25562556
break;
25572557
}
@@ -4814,7 +4814,7 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
48144814
/*
48154815
* Find the end of the string, skipping backslashed characters.
48164816
*/
4817-
for (p = *arg + 1; *p != NUL && *p != '"'; mb_ptr_adv(p))
4817+
for (p = *arg + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p))
48184818
{
48194819
if (*p == '\\' && p[1] != NUL)
48204820
{
@@ -4952,7 +4952,7 @@ get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate)
49524952
/*
49534953
* Find the end of the string, skipping ''.
49544954
*/
4955-
for (p = *arg + 1; *p != NUL; mb_ptr_adv(p))
4955+
for (p = *arg + 1; *p != NUL; MB_PTR_ADV(p))
49564956
{
49574957
if (*p == '\'')
49584958
{
@@ -5910,7 +5910,7 @@ string_quote(char_u *str, int function)
59105910
if (str != NULL)
59115911
{
59125912
len += (unsigned)STRLEN(str);
5913-
for (p = str; *p != NUL; mb_ptr_adv(p))
5913+
for (p = str; *p != NUL; MB_PTR_ADV(p))
59145914
if (*p == '\'')
59155915
++len;
59165916
}
@@ -6369,20 +6369,20 @@ find_name_end(
63696369
|| *p == '{'
63706370
|| ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.'))
63716371
|| mb_nest != 0
6372-
|| br_nest != 0); mb_ptr_adv(p))
6372+
|| br_nest != 0); MB_PTR_ADV(p))
63736373
{
63746374
if (*p == '\'')
63756375
{
63766376
/* skip over 'string' to avoid counting [ and ] inside it. */
6377-
for (p = p + 1; *p != NUL && *p != '\''; mb_ptr_adv(p))
6377+
for (p = p + 1; *p != NUL && *p != '\''; MB_PTR_ADV(p))
63786378
;
63796379
if (*p == NUL)
63806380
break;
63816381
}
63826382
else if (*p == '"')
63836383
{
63846384
/* skip over "str\"ing" to avoid counting [ and ] inside it. */
6385-
for (p = p + 1; *p != NUL && *p != '"'; mb_ptr_adv(p))
6385+
for (p = p + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p))
63866386
if (*p == '\\' && p[1] != NUL)
63876387
++p;
63886388
if (*p == NUL)
@@ -9410,7 +9410,7 @@ shortpath_for_partial(
94109410
/* Count up the path separators from the RHS.. so we know which part
94119411
* of the path to return. */
94129412
sepcount = 0;
9413-
for (p = *fnamep; p < *fnamep + *fnamelen; mb_ptr_adv(p))
9413+
for (p = *fnamep; p < *fnamep + *fnamelen; MB_PTR_ADV(p))
94149414
if (vim_ispathsep(*p))
94159415
++sepcount;
94169416

@@ -9528,7 +9528,7 @@ modify_fname(
95289528
}
95299529

95309530
/* When "/." or "/.." is used: force expansion to get rid of it. */
9531-
for (p = *fnamep; *p != NUL; mb_ptr_adv(p))
9531+
for (p = *fnamep; *p != NUL; MB_PTR_ADV(p))
95329532
{
95339533
if (vim_ispathsep(*p)
95349534
&& p[1] == '.'
@@ -9658,7 +9658,7 @@ modify_fname(
96589658
*usedlen += 2;
96599659
s = get_past_head(*fnamep);
96609660
while (tail > s && after_pathsep(s, tail))
9661-
mb_ptr_back(*fnamep, tail);
9661+
MB_PTR_BACK(*fnamep, tail);
96629662
*fnamelen = (int)(tail - *fnamep);
96639663
#ifdef VMS
96649664
if (*fnamelen > 0)
@@ -9677,7 +9677,7 @@ modify_fname(
96779677
else
96789678
{
96799679
while (tail > s && !after_pathsep(s, tail))
9680-
mb_ptr_back(*fnamep, tail);
9680+
MB_PTR_BACK(*fnamep, tail);
96819681
}
96829682
}
96839683

src/ex_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4863,7 +4863,7 @@ do_sub(exarg_T *eap)
48634863
}
48644864
if (cmd[0] == '\\' && cmd[1] != 0) /* skip escaped characters */
48654865
++cmd;
4866-
mb_ptr_adv(cmd);
4866+
MB_PTR_ADV(cmd);
48674867
}
48684868

48694869
if (!eap->skip)

src/ex_cmds2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3526,7 +3526,7 @@ add_pack_plugin(char_u *fname, void *cookie)
35263526
{
35273527
/* directory is not yet in 'runtimepath', add it */
35283528
p4 = p3 = p2 = p1 = get_past_head(ffname);
3529-
for (p = p1; *p; mb_ptr_adv(p))
3529+
for (p = p1; *p; MB_PTR_ADV(p))
35303530
if (vim_ispathsep_nocolon(*p))
35313531
{
35323532
p4 = p3; p3 = p2; p2 = p1; p1 = p;

src/ex_docmd.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,7 +3696,7 @@ set_one_cmd_context(
36963696
return NULL; /* It's a comment */
36973697
}
36983698
}
3699-
mb_ptr_adv(p);
3699+
MB_PTR_ADV(p);
37003700
}
37013701
}
37023702

@@ -3720,7 +3720,7 @@ set_one_cmd_context(
37203720
{
37213721
if (*p == '\\' && *(p + 1) != NUL)
37223722
++p; /* skip over escaped character */
3723-
mb_ptr_adv(p);
3723+
MB_PTR_ADV(p);
37243724
}
37253725
}
37263726

@@ -3780,15 +3780,15 @@ set_one_cmd_context(
37803780
else
37813781
#endif
37823782
len = 1;
3783-
mb_ptr_adv(p);
3783+
MB_PTR_ADV(p);
37843784
}
37853785
if (in_quote)
37863786
bow = p;
37873787
else
37883788
xp->xp_pattern = p;
37893789
p -= len;
37903790
}
3791-
mb_ptr_adv(p);
3791+
MB_PTR_ADV(p);
37923792
}
37933793

37943794
/*
@@ -4204,7 +4204,7 @@ set_one_cmd_context(
42044204
arg = p + 1;
42054205
else if (*p == '\\' && *(p + 1) != NUL)
42064206
++p; /* skip over escaped character */
4207-
mb_ptr_adv(p);
4207+
MB_PTR_ADV(p);
42084208
}
42094209
xp->xp_pattern = arg;
42104210
}
@@ -5280,7 +5280,7 @@ separate_nextcmd(exarg_T *eap)
52805280
p = eap->arg;
52815281
#endif
52825282

5283-
for ( ; *p; mb_ptr_adv(p))
5283+
for ( ; *p; MB_PTR_ADV(p))
52845284
{
52855285
if (*p == Ctrl_V)
52865286
{
@@ -5380,7 +5380,7 @@ skip_cmd_arg(
53805380
else
53815381
++p;
53825382
}
5383-
mb_ptr_adv(p);
5383+
MB_PTR_ADV(p);
53845384
}
53855385
return p;
53865386
}
@@ -11861,7 +11861,7 @@ ses_put_fname(FILE *fd, char_u *name, unsigned *flagp)
1186111861
if (*flagp & SSOP_SLASH)
1186211862
{
1186311863
/* change all backslashes to forward slashes */
11864-
for (p = sname; *p != NUL; mb_ptr_adv(p))
11864+
for (p = sname; *p != NUL; MB_PTR_ADV(p))
1186511865
if (*p == '\\')
1186611866
*p = '/';
1186711867
}

src/ex_getln.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4296,7 +4296,7 @@ sm_gettail(char_u *s)
42964296
t = p;
42974297
had_sep = FALSE;
42984298
}
4299-
mb_ptr_adv(p);
4299+
MB_PTR_ADV(p);
43004300
}
43014301
return t;
43024302
}
@@ -5370,7 +5370,7 @@ ExpandRTDir(
53705370
if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
53715371
{
53725372
e -= 4;
5373-
for (s = e; s > match; mb_ptr_back(match, s))
5373+
for (s = e; s > match; MB_PTR_BACK(match, s))
53745374
if (s < match || vim_ispathsep(*s))
53755375
break;
53765376
++s;

src/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6247,7 +6247,7 @@ buf_modname(
62476247
* Then truncate what is after the '/', '\' or ':' to 8 characters for
62486248
* MSDOS and 26 characters for AMIGA, a lot more for UNIX.
62496249
*/
6250-
for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr))
6250+
for (ptr = retval + fnamelen; ptr > retval; MB_PTR_BACK(retval, ptr))
62516251
{
62526252
if (*ext == '.'
62536253
#ifdef USE_LONG_FNAME

src/fold.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ foldtext_cleanup(char_u *str)
20642064
}
20652065
else
20662066
{
2067-
mb_ptr_adv(s);
2067+
MB_PTR_ADV(s);
20682068
}
20692069
}
20702070
}
@@ -3249,7 +3249,7 @@ foldlevelMarker(fline_T *flp)
32493249
--flp->lvl_next;
32503250
}
32513251
else
3252-
mb_ptr_adv(s);
3252+
MB_PTR_ADV(s);
32533253
}
32543254

32553255
/* The level can't go negative, must be missing a start marker. */

src/gui.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4500,7 +4500,7 @@ scroll_line_len(linenr_T lnum)
45004500
for (;;)
45014501
{
45024502
w = chartabsize(p, col);
4503-
mb_ptr_adv(p);
4503+
MB_PTR_ADV(p);
45044504
if (*p == NUL) /* don't count the last character */
45054505
break;
45064506
col += w;

0 commit comments

Comments
 (0)