diff options
author | kylo252 <59826753+kylo252@users.noreply.github.com> | 2022-02-16 19:24:07 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-16 19:24:07 +0000 |
commit | ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83 (patch) | |
tree | 4982335c2afa3ef8515860dabea038acbc2af406 /src/quickfix.c | |
parent | d288eaad846f0e07e0141226f97d858dcf96cb78 (diff) | |
download | vim-git-ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83.tar.gz |
patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402
Problem: Missing parenthesis may cause unexpected problems.
Solution: Add more parenthesis is macros. (closes #9788)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 132d99216..998ec6ec3 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -189,28 +189,28 @@ static void unload_dummy_buffer(buf_T *buf, char_u *dirname_start); static qf_info_T *ll_get_or_alloc_list(win_T *); // Quickfix window check helper macro -#define IS_QF_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL) +#define IS_QF_WINDOW(wp) (bt_quickfix((wp)->w_buffer) && (wp)->w_llist_ref == NULL) // Location list window check helper macro -#define IS_LL_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) +#define IS_LL_WINDOW(wp) (bt_quickfix((wp)->w_buffer) && (wp)->w_llist_ref != NULL) // Quickfix and location list stack check helper macros -#define IS_QF_STACK(qi) (qi->qfl_type == QFLT_QUICKFIX) -#define IS_LL_STACK(qi) (qi->qfl_type == QFLT_LOCATION) -#define IS_QF_LIST(qfl) (qfl->qfl_type == QFLT_QUICKFIX) -#define IS_LL_LIST(qfl) (qfl->qfl_type == QFLT_LOCATION) +#define IS_QF_STACK(qi) ((qi)->qfl_type == QFLT_QUICKFIX) +#define IS_LL_STACK(qi) ((qi)->qfl_type == QFLT_LOCATION) +#define IS_QF_LIST(qfl) ((qfl)->qfl_type == QFLT_QUICKFIX) +#define IS_LL_LIST(qfl) ((qfl)->qfl_type == QFLT_LOCATION) /* * Return location list for window 'wp' * For location list window, return the referenced location list */ -#define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist) +#define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? (wp)->w_llist_ref : (wp)->w_llist) // Macro to loop through all the items in a quickfix list // Quickfix item index starts from 1, so i below starts at 1 #define FOR_ALL_QFL_ITEMS(qfl, qfp, i) \ - for (i = 1, qfp = qfl->qf_start; \ - !got_int && i <= qfl->qf_count && qfp != NULL; \ - ++i, qfp = qfp->qf_next) + for ((i) = 1, (qfp) = (qfl)->qf_start; \ + !got_int && (i) <= (qfl)->qf_count && (qfp) != NULL; \ + ++(i), (qfp) = (qfp)->qf_next) /* * Looking up a buffer can be slow if there are many. Remember the last one |