[Bug 1641] Red Black Tree data structure

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Sat Sep 18 16:14:14 UTC 2010


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

--- Comment #11 from Gedare <giddyup44 at yahoo.com> 2010-09-18 11:14:12 CDT ---
(In reply to comment #10)
> I have been taking a close look at this code and have a few questions. I like
> the idea of a standard tree being in RTEMS and have started some documentation.
> 
> You seem to define local variables in the middle of blocks like C++ allows. I
> know GCC allows this but I thought this is an extension and currently not
> standard ? Do we allow local declarations in the middle of blocks in score code
> ? I did not think this was allowed.
> 
I see there are a few places where this is done, I can clean this up -- I don't
recall ever seeing this explicitly stated, although I do typically avoid
declaring variables after the start of a block.

> The code only supports an unsigned integer. Would it be possible to support a
> string as well ? Maybe the value could be a union and control structure can
> have a flag that indicates the union field. I could use a string based tree.
Do you mean that you want to have a tree that sorts based on a string rather
than an unsigned integer?  This can be done, we would have to replace direct
comparisons of the value field with a function call that implements a compare
operator, e.g. a default function that uses the < operator, and one with strcmp
if the field is a string.

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