Mercurial > vim
comparison src/charset.c @ 27752:c1d1639b52dd v8.2.4402
patch 8.2.4402: missing parenthesis may cause unexpected problems
Commit: https://github.com/vim/vim/commit/ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83
Author: kylo252 <59826753+kylo252@users.noreply.github.com>
Date: Wed Feb 16 19:24:07 2022 +0000
patch 8.2.4402: missing parenthesis may cause unexpected problems
Problem: Missing parenthesis may cause unexpected problems.
Solution: Add more parenthesis is macros. (closes https://github.com/vim/vim/issues/9788)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Feb 2022 20:30:03 +0100 |
parents | fb4c30606b4a |
children | bfce04a99561 |
comparison
equal
deleted
inserted
replaced
27751:c9330d10419b | 27752:c1d1639b52dd |
---|---|
384 garray_T ga; | 384 garray_T ga; |
385 int i; | 385 int i; |
386 int len = orglen; | 386 int len = orglen; |
387 | 387 |
388 #define GA_CHAR(i) ((char_u *)ga.ga_data)[i] | 388 #define GA_CHAR(i) ((char_u *)ga.ga_data)[i] |
389 #define GA_PTR(i) ((char_u *)ga.ga_data + i) | 389 #define GA_PTR(i) ((char_u *)ga.ga_data + (i)) |
390 #define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i]) | 390 #define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i]) |
391 #define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + i) | 391 #define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + (i)) |
392 | 392 |
393 // Copy "str" into "buf" or allocated memory, unmodified. | 393 // Copy "str" into "buf" or allocated memory, unmodified. |
394 if (buf == NULL) | 394 if (buf == NULL) |
395 { | 395 { |
396 ga_init2(&ga, 1, 10); | 396 ga_init2(&ga, 1, 10); |
704 * Also see getvcol() below. | 704 * Also see getvcol() below. |
705 */ | 705 */ |
706 | 706 |
707 #ifdef FEAT_VARTABS | 707 #ifdef FEAT_VARTABS |
708 # define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \ | 708 # define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \ |
709 if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \ | 709 if (*(p) == TAB && (!(wp)->w_p_list || (wp)->w_lcs_chars.tab1)) \ |
710 { \ | 710 { \ |
711 return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \ | 711 return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \ |
712 } \ | 712 } \ |
713 else \ | 713 else \ |
714 return ptr2cells(p); | 714 return ptr2cells(p); |