aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-04 07:54:34 +0800
committerGitHub <noreply@github.com>2022-04-04 07:54:34 +0800
commit4e0a825262ffb2857def79fe1db5c7830c484b5b (patch)
tree363e9a7044ab99000c9efeefe026d467f4ab3512 /src/nvim/quickfix.c
parenta93b55273f76e5fe23f614e691536435999f4452 (diff)
parent33909b65640a9884f7716bb2d6d73cb75931135b (diff)
downloadrneovim-4e0a825262ffb2857def79fe1db5c7830c484b5b.tar.gz
rneovim-4e0a825262ffb2857def79fe1db5c7830c484b5b.tar.bz2
rneovim-4e0a825262ffb2857def79fe1db5c7830c484b5b.zip
Merge pull request #17987 from leungbk/vim-patch-4402
vim-patch:8.2.{4639,4402}: missing parenthesis may cause unexpected problems
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index c8d9e91fb5..1d589e8ca0 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -229,28 +229,28 @@ typedef struct vgr_args_S {
static char_u *e_no_more_items = (char_u *)N_("E553: No more items");
// 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; /* NOLINT(readability/braces) */ \
- !got_int && i <= qfl->qf_count && qfp != NULL; \
- i++, qfp = qfp->qf_next)
+ for ((i) = 1, (qfp) = (qfl)->qf_start; /* NOLINT(readability/braces) */ \
+ !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