[Bug 1995] RBTree Successor and Predecessor

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Mar 5 08:19:11 UTC 2012


https://www.rtems.org/bugzilla/show_bug.cgi?id=1995

--- Comment #4 from Sebastian Huber <sebastian.huber at embedded-brains.de> 2012-03-05 02:19:11 CST ---
I think the immutable versions are superfluous.  For the chain API we have
immutable versions since the chain control input parameter is const or
non-const.  Here

+const RBTree_Node *_RBTree_Next_immutable_unprotected(
+  const RBTree_Control *rbtree,
+  const RBTree_Node *node,
+  RBTree_Direction dir
+)
+{
+  return (const RBTree_Node *)_RBTree_Next_unprotected(rbtree, node, dir);
+}

we only have a cast of the return type (the rbtree input parameter is const in
both cases).  You should never use a cast to add the const-qualifier.  This
prevents a warning in case you change the _RBTree_Next_unprotected() return
type.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list