NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/47144 (rbtree itteration is broken)



The following reply was made to PR lib/47144; it has been noted by GNATS.

From: Jeremy Huddleston Sequoia <jeremyhu%apple.com@localhost>
To: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%NetBSD.org@localhost>
Cc: "lib-bug-people%netbsd.org@localhost" <lib-bug-people%netbsd.org@localhost>,
 "gnats-admin%netbsd.org@localhost" <gnats-admin%netbsd.org@localhost>,
 "netbsd-bugs%netbsd.org@localhost" <netbsd-bugs%netbsd.org@localhost>
Subject: Re: lib/47144 (rbtree itteration is broken)
Date: Tue, 30 Oct 2012 18:46:19 -0700

 yes, you need *BOTH* patches.  One to fix the function, and one to update rhe 
macro to use the correct function call.  Please see my example code.
 
 Sent from my iPhone...
 
 On Oct 30, 2012, at 16:35, Mindaugas Rasiukevicius 
<rmind%netbsd.org@localhost> wrote:
 
 > The following reply was made to PR lib/47144; it has been noted by GNATS.
 > 
 > From: Mindaugas Rasiukevicius <rmind%netbsd.org@localhost>
 > To: Jeremy Huddleston Sequoia <jeremyhu%apple.com@localhost>
 > Cc: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost,
 > netbsd-bugs%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
 > rmind%NetBSD.org@localhost
 > Subject: Re: lib/47144 (rbtree itteration is broken)
 > Date: Tue, 30 Oct 2012 23:31:44 +0000
 > 
 > Jeremy Huddleston Sequoia <jeremyhu%apple.com@localhost> wrote:
 >> RB_TREE_MIN and RB_TREE_MAX also need to be fixed:
 >> 
 >> Index: rbtree.h
 >> ===================================================================
 >> --- rbtree.h    (revision 84264)
 >> +++ rbtree.h    (working copy)
 >> @@ -95,8 +95,8 @@
 >>   } while (/*CONSTCOND*/ 0)
 >> } rb_node_t;
 >> 
 >> -#define RB_TREE_MIN(T) rb_tree_iterate((T), NULL, RB_DIR_LEFT)
 >> -#define RB_TREE_MAX(T) rb_tree_iterate((T), NULL, RB_DIR_RIGHT)
 >> +#define RB_TREE_MIN(T) rb_tree_iterate((T), NULL, RB_DIR_RIGHT)
 >> +#define RB_TREE_MAX(T) rb_tree_iterate((T), NULL, RB_DIR_LEFT)
 >> #define RB_TREE_FOREACH(N, T) \
 >>     for ((N) = RB_TREE_MIN(T); (N); \
 >>    (N) = rb_tree_iterate((T), (N), RB_DIR_RIGHT))
 > 
 > Well, it does not.. the current behaviour of rb_tree_iterate() returns
 > the left-most node, which *is* the minimum.
 > 
 > -- 
 > Mindaugas
 > 
 


Home | Main Index | Thread Index | Old Index