vim-patch:8.0.1688: some macros are used without a semicolon

Problem:    Some macros are used without a semicolon, causing auto-indent to be
            wrong.
Solution:   Use the do-while(0) trick. (Ozaki Kiichi, closes vim/vim#2729)
6f4700233f
This commit is contained in:
Jan Edmund Lazo
2019-06-25 22:38:13 -04:00
parent 62c7fcbdab
commit 2d6c91ab99
4 changed files with 81 additions and 58 deletions

View File

@@ -1709,7 +1709,6 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
int col;
int txtcol;
int off;
int ri;
/* Build the fold line:
* 1. Add the cmdwin_type for the command-line window
@@ -1753,15 +1752,18 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
col += fdc;
}
# define RL_MEMSET(p, v, l) if (wp->w_p_rl) { \
for (ri = 0; ri < l; ri++) { \
linebuf_attr[off + (wp->w_grid.Columns - (p) - (l)) + ri] = v; \
# define RL_MEMSET(p, v, l) \
do { \
if (wp->w_p_rl) { \
for (int ri = 0; ri < l; ri++) { \
linebuf_attr[off + (wp->w_grid.Columns - (p) - (l)) + ri] = v; \
} \
} else { \
for (int ri = 0; ri < l; ri++) { \
linebuf_attr[off + (p) + ri] = v; \
} \
} \
} else { \
for (ri = 0; ri < l; ri++) { \
linebuf_attr[off + (p) + ri] = v; \
} \
}
} while (0)
/* Set all attributes of the 'number' or 'relativenumber' column and the
* text */