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
Cc: 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 15:17:11 -0700

 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))
 
 
 On Oct 30, 2012, at 3:12 PM, rmind%NetBSD.org@localhost wrote:
 
 > Synopsis: rbtree itteration is broken
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: rmind%NetBSD.org@localhost
 > State-Changed-When: Tue, 30 Oct 2012 22:12:28 +0000
 > State-Changed-Why:
 > It is perhaps a bit confusing and unintuitive API behaviour, but the 
 > iteration
 > is not broken.  The problem is wrong documentation, which ought to be fixed.
 > 
 > See PR/46034.  Closing this as a duplicate.
 > 
 > 
 > 
 


Home | Main Index | Thread Index | Old Index