Skip to content
Permalink
Browse files

patch 8.0.0448: some macros are in lower case

Problem:    Some macros are in lower case, which can be confusing.
Solution:   Make a few lower case macros upper case.
  • Loading branch information...
brammool committed Mar 12, 2017
1 parent 8774845 commit b5aedf3e228d35821591da9ae8501b61cf2e264c
Showing with 194 additions and 166 deletions.
  1. +4 −4 src/buffer.c
  2. +3 −2 src/charset.c
  3. +1 −1 src/diff.c
  4. +6 −6 src/edit.c
  5. +4 −4 src/evalfunc.c
  6. +24 −7 src/ex_cmds.c
  7. +4 −4 src/ex_getln.c
  8. +2 −2 src/fileio.c
  9. +1 −1 src/fold.c
  10. +2 −2 src/gui.c
  11. +2 −2 src/gui_beval.c
  12. +1 −1 src/if_perl.xs
  13. +15 −15 src/macros.h
  14. +4 −1 src/main.c
  15. +9 −8 src/mark.c
  16. +5 −3 src/misc1.c
  17. +1 −1 src/move.c
  18. +34 −37 src/normal.c
  19. +11 −11 src/ops.c
  20. +1 −1 src/option.c
  21. +1 −1 src/popupmnu.c
  22. +2 −2 src/regexp.c
  23. +2 −2 src/screen.c
  24. +42 −37 src/search.c
  25. +2 −2 src/spell.c
  26. +1 −1 src/tag.c
  27. +3 −3 src/ui.c
  28. +3 −3 src/undo.c
  29. +3 −1 src/version.c
  30. +1 −1 src/workshop.c
@@ -111,7 +111,7 @@ read_buffer(
{
/* Set or reset 'modified' before executing autocommands, so that
* it can be changed there. */
if (!readonlymode && !bufempty())
if (!readonlymode && !BUFEMPTY())
changed();
else if (retval == OK)
unchanged(curbuf, FALSE);
@@ -1959,7 +1959,7 @@ buflist_new(
&& curbuf != NULL
&& curbuf->b_ffname == NULL
&& curbuf->b_nwindows <= 1
&& (curbuf->b_ml.ml_mfp == NULL || bufempty()))
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY()))
{
buf = curbuf;
#ifdef FEAT_AUTOCMD
@@ -2334,7 +2334,7 @@ buflist_getfile(
/* If 'switchbuf' contains "split", "vsplit" or "newtab" and the
* current buffer isn't empty: open new tab or window */
if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB))
&& !bufempty())
&& !BUFEMPTY())
{
if (swb_flags & SWB_NEWTAB)
tabpage_new();
@@ -5017,7 +5017,7 @@ do_arg_all(
#ifdef FEAT_WINDOWS
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
* leaving an empty tab page when executed locally. */
if (keep_tabs && bufempty() && curbuf->b_nwindows == 1
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
use_firstwin = TRUE;
#endif
@@ -1403,7 +1403,8 @@ getvcol(
&& (State & NORMAL)
&& !wp->w_p_list
&& !virtual_active()
&& !(VIsual_active && (*p_sel == 'e' || ltoreq(*pos, VIsual)))
&& !(VIsual_active
&& (*p_sel == 'e' || LTOREQ_POS(*pos, VIsual)))
)
*cursor = vcol + incr - 1; /* cursor at end */
else
@@ -1496,7 +1497,7 @@ getvcols(
{
colnr_T from1, from2, to1, to2;

if (ltp(pos1, pos2))
if (LT_POSP(pos1, pos2))
{
getvvcol(wp, pos1, &from1, NULL, &to1);
getvvcol(wp, pos2, &from2, NULL, &to2);
@@ -2333,7 +2333,7 @@ ex_diffgetput(exarg_T *eap)
end_skip = 0;
}

buf_empty = bufempty();
buf_empty = BUFEMPTY();
added = 0;
for (i = 0; i < count; ++i)
{
@@ -408,7 +408,7 @@ edit(
* the "A" command, thus set State to avoid that. Also check that the
* line number is still valid (lines may have been deleted).
* Do not restore if v:char was set to a non-empty string. */
if (!equalpos(curwin->w_cursor, save_cursor)
if (!EQUAL_POS(curwin->w_cursor, save_cursor)
# ifdef FEAT_EVAL
&& *get_vim_var_str(VV_CHAR) == NUL
# endif
@@ -1631,7 +1631,7 @@ ins_redraw(
# endif
)
# ifdef FEAT_AUTOCMD
&& !equalpos(last_cursormoved, curwin->w_cursor)
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
# endif
# ifdef FEAT_INS_EXPAND
&& !pum_visible()
@@ -4130,7 +4130,7 @@ expand_by_function(
}
curwin->w_cursor = pos; /* restore the cursor position */
validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
if (!EQUAL_POS(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
goto theend;
@@ -5408,7 +5408,7 @@ ins_complete(int c, int enable_pum)
}
curwin->w_cursor = pos; /* restore the cursor position */
validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
if (!EQUAL_POS(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
return FAIL;
@@ -8947,7 +8947,7 @@ ins_bs(
* can't backup past starting point unless 'backspace' > 1
* can backup to a previous line if 'backspace' == 0
*/
if ( bufempty()
if ( BUFEMPTY()
|| (
#ifdef FEAT_RIGHTLEFT
!revins_on &&
@@ -9462,7 +9462,7 @@ ins_mousescroll(int dir)
}
# endif

if (!equalpos(curwin->w_cursor, tpos))
if (!EQUAL_POS(curwin->w_cursor, tpos))
{
start_arrow(&tpos);
# ifdef FEAT_CINDENT
@@ -9552,20 +9552,20 @@ do_searchpair(

save_cursor = curwin->w_cursor;
pos = curwin->w_cursor;
clearpos(&firstpos);
clearpos(&foundpos);
CLEAR_POS(&firstpos);
CLEAR_POS(&foundpos);
pat = pat3;
for (;;)
{
n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
options, RE_SEARCH, lnum_stop, &tm);
if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
if (n == FAIL || (firstpos.lnum != 0 && EQUAL_POS(pos, firstpos)))
/* didn't find it or found the first match again: FAIL */
break;

if (firstpos.lnum == 0)
firstpos = pos;
if (equalpos(pos, foundpos))
if (EQUAL_POS(pos, foundpos))
{
/* Found the same position again. Can happen with a pattern that
* has "\zs" at the end and searching backwards. Advance one
@@ -851,24 +851,41 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
* their final destination at the new text position -- webb
*/
last_line = curbuf->b_ml.ml_line_count;
mark_adjust(line1, line2, last_line - line2, 0L);
changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines);
mark_adjust_nofold(line1, line2, last_line - line2, 0L);
if (dest >= line2)
{
mark_adjust(line2 + 1, dest, -num_lines, 0L);
mark_adjust_nofold(line2 + 1, dest, -num_lines, 0L);
#ifdef FEAT_FOLDING
win_T *win;
tabpage_T *tp;

FOR_ALL_TAB_WINDOWS(tp, win) {
if (win->w_buffer == curbuf)
foldSwapRange(&win->w_folds, line1, line2, dest + 1,
dest + num_lines);
}
#endif
curbuf->b_op_start.lnum = dest - num_lines + 1;
curbuf->b_op_end.lnum = dest;
}
else
{
mark_adjust(dest + 1, line1 - 1, num_lines, 0L);
mark_adjust_nofold(dest + 1, line1 - 1, num_lines, 0L);
#ifdef FEAT_FOLDING
win_T *win;
tabpage_T *tp;

FOR_ALL_TAB_WINDOWS(tp, win) {
if (win->w_buffer == curbuf)
foldSwapRange(&win->w_folds, dest + 1, line1 - 1, line1, line2);
}
#endif
curbuf->b_op_start.lnum = dest + 1;
curbuf->b_op_end.lnum = dest + num_lines;
}
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
mark_adjust(last_line - num_lines + 1, last_line,
mark_adjust_nofold(last_line - num_lines + 1, last_line,
-(last_line - dest - extra), 0L);
changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra);

/*
* Now we delete the original text -- webb
@@ -4211,7 +4228,7 @@ do_ecmd(

/* If autocommands change the cursor position or topline, we should
* keep it. Also when it moves within a line. */
if (!equalpos(curwin->w_cursor, orig_pos))
if (!EQUAL_POS(curwin->w_cursor, orig_pos))
{
newlnum = curwin->w_cursor.lnum;
newcol = curwin->w_cursor.col;
@@ -234,7 +234,7 @@ getcmdline(

ccline.overstrike = FALSE; /* always start in insert mode */
#ifdef FEAT_SEARCH_EXTRA
clearpos(&match_end);
CLEAR_POS(&match_end);
save_cursor = curwin->w_cursor; /* may be restored later */
search_start = curwin->w_cursor;
old_curswant = curwin->w_curswant;
@@ -1479,7 +1479,7 @@ getcmdline(
if (did_incsearch)
{
curwin->w_cursor = match_end;
if (!equalpos(curwin->w_cursor, search_start))
if (!EQUAL_POS(curwin->w_cursor, search_start))
{
c = gchar_cursor();
/* If 'ignorecase' and 'smartcase' are set and the
@@ -1707,7 +1707,7 @@ getcmdline(
search_start = t;
(void)decl(&search_start);
}
if (lt(t, search_start) && c == Ctrl_G)
if (LT_POS(t, search_start) && c == Ctrl_G)
{
/* wrap around */
search_start = t;
@@ -2007,7 +2007,7 @@ getcmdline(
curwin->w_cursor = save_cursor;
else
{
if (!equalpos(save_cursor, search_start))
if (!EQUAL_POS(save_cursor, search_start))
{
/* put the '" mark at the original position */
curwin->w_cursor = save_cursor;
@@ -7118,7 +7118,7 @@ buf_reload(buf_T *buf, int orig_mode)
* the old contents. Can't use memory only, the file might be
* too big. Use a hidden buffer to move the buffer contents to.
*/
if (bufempty() || saved == FAIL)
if (BUFEMPTY() || saved == FAIL)
savebuf = NULL;
else
{
@@ -7161,7 +7161,7 @@ buf_reload(buf_T *buf, int orig_mode)
{
/* Put the text back from the save buffer. First
* delete any lines that readfile() added. */
while (!bufempty())
while (!BUFEMPTY())
if (ml_delete(buf->b_ml.ml_line_count, FALSE) == FAIL)
break;
(void)move_lines(savebuf, buf);
@@ -1039,7 +1039,7 @@ foldAdjustVisual(void)
if (!VIsual_active || !hasAnyFolding(curwin))
return;

if (ltoreq(VIsual, curwin->w_cursor))
if (LTOREQ_POS(VIsual, curwin->w_cursor))
{
start = &VIsual;
end = &curwin->w_cursor;
@@ -4476,7 +4476,7 @@ gui_do_scroll(void)
pum_redraw();
#endif

return (wp == curwin && !equalpos(curwin->w_cursor, old_cursor));
return (wp == curwin && !EQUAL_POS(curwin->w_cursor, old_cursor));
}


@@ -5118,7 +5118,7 @@ gui_update_screen(void)
curwin->w_p_cole > 0
# endif
)
&& !equalpos(last_cursormoved, curwin->w_cursor))
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
{
# ifdef FEAT_AUTOCMD
if (has_cursormoved())
@@ -84,7 +84,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
result = eval_to_string(bexpr, NULL, TRUE);

/* Remove one trailing newline, it is added when the result was a
* list and it's hardly every useful. If the user really wants a
* list and it's hardly ever useful. If the user really wants a
* trailing newline he can add two and one remains. */
if (result != NULL)
{
@@ -366,7 +366,7 @@ get_beval_info(

if (VIsual_active)
{
if (lt(VIsual, curwin->w_cursor))
if (LT_POS(VIsual, curwin->w_cursor))
{
spos = &VIsual;
epos = &curwin->w_cursor;
@@ -1288,7 +1288,7 @@ ex_perldo(exarg_T *eap)
linenr_T i;
buf_T *was_curbuf = curbuf;

if (bufempty())
if (BUFEMPTY())
return;

if (perl_interp == NULL)
@@ -11,46 +11,46 @@
*/

/*
* pchar(lp, c) - put character 'c' at position 'lp'
* PCHAR(lp, c) - put character 'c' at position 'lp'
*/
#define pchar(lp, c) (*(ml_get_buf(curbuf, (lp).lnum, TRUE) + (lp).col) = (c))
#define PCHAR(lp, c) (*(ml_get_buf(curbuf, (lp).lnum, TRUE) + (lp).col) = (c))

/*
* Position comparisons
*/
#ifdef FEAT_VIRTUALEDIT
# define lt(a, b) (((a).lnum != (b).lnum) \
# define LT_POS(a, b) (((a).lnum != (b).lnum) \
? (a).lnum < (b).lnum \
: (a).col != (b).col \
? (a).col < (b).col \
: (a).coladd < (b).coladd)
# define ltp(a, b) (((a)->lnum != (b)->lnum) \
# define LT_POSP(a, b) (((a)->lnum != (b)->lnum) \
? (a)->lnum < (b)->lnum \
: (a)->col != (b)->col \
? (a)->col < (b)->col \
: (a)->coladd < (b)->coladd)
# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd))
# define clearpos(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;}
# define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd))
# define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;}
#else
# define lt(a, b) (((a).lnum != (b).lnum) \
# define LT_POS(a, b) (((a).lnum != (b).lnum) \
? ((a).lnum < (b).lnum) : ((a).col < (b).col))
# define ltp(a, b) (((a)->lnum != (b)->lnum) \
# define LT_POSP(a, b) (((a)->lnum != (b)->lnum) \
? ((a)->lnum < (b)->lnum) : ((a)->col < (b)->col))
# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col))
# define clearpos(a) {(a)->lnum = 0; (a)->col = 0;}
# define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col))
# define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0;}
#endif

#define ltoreq(a, b) (lt(a, b) || equalpos(a, b))
#define LTOREQ_POS(a, b) (LT_POS(a, b) || EQUAL_POS(a, b))

/*
* lineempty() - return TRUE if the line is empty
* LINEEMPTY() - return TRUE if the line is empty
*/
#define lineempty(p) (*ml_get(p) == NUL)
#define LINEEMPTY(p) (*ml_get(p) == NUL)

/*
* bufempty() - return TRUE if the current buffer is empty
* BUFEMPTY() - return TRUE if the current buffer is empty
*/
#define bufempty() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == NUL)
#define BUFEMPTY() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == NUL)

/*
* toupper() and tolower() that use the current locale.
@@ -1144,7 +1144,7 @@ main_loop(
# endif
)
# ifdef FEAT_AUTOCMD
&& !equalpos(last_cursormoved, curwin->w_cursor)
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
# endif
)
{
@@ -3557,8 +3557,11 @@ set_progpath(char_u *argv0)
&& vim_FullName(argv0, buf, MAXPATHL, TRUE) != FAIL)
val = buf;
}
# endif
# endif

set_vim_var_string(VV_PROGPATH, val, -1);

# ifdef WIN32
vim_free(path);
# endif

0 comments on commit b5aedf3

Please sign in to comment.
You can’t perform that action at this time.