From 5d01ebab89cee8a3499ee00729c048068d5b719d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 25 Oct 2017 18:41:10 +0200 Subject: [PATCH] rbtree: Clarify the loop conditions to avoid confusing older gcc. Signed-off-by: Alexandre Julliard --- include/wine/rbtree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wine/rbtree.h b/include/wine/rbtree.h index bb4edf5577c..dc50b5e712f 100644 --- a/include/wine/rbtree.h +++ b/include/wine/rbtree.h @@ -147,7 +147,7 @@ static inline struct wine_rb_entry *wine_rb_postorder_next(struct wine_rb_entry /* iterate through the tree using a tree entry */ #define WINE_RB_FOR_EACH_ENTRY(elem, tree, type, field) \ for ((elem) = WINE_RB_ENTRY_VALUE(wine_rb_head((tree)->root), type, field); \ - &(elem)->field; \ + (elem) != WINE_RB_ENTRY_VALUE(0, type, field); \ (elem) = WINE_RB_ENTRY_VALUE(wine_rb_next(&elem->field), type, field)) /* iterate through the tree using using postorder, making it safe to free the entry */ @@ -159,7 +159,7 @@ static inline struct wine_rb_entry *wine_rb_postorder_next(struct wine_rb_entry /* iterate through the tree using a tree entry and postorder, making it safe to free the entry */ #define WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR(elem, elem2, tree, type, field) \ for ((elem) = WINE_RB_ENTRY_VALUE(wine_rb_postorder_head((tree)->root), type, field); \ - &(elem)->field \ + (elem) != WINE_RB_ENTRY_VALUE(0, type, field) \ && (((elem2) = WINE_RB_ENTRY_VALUE(wine_rb_postorder_next(&(elem)->field), type, field)) || 1); \ (elem) = (elem2))