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: 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