Hi tech@, I noticed RB_GENERATE_INTERNAL in src/sys/sys/tree.h puts brackets around the compare function cmp in RB_INSERT just like SPLAY_GENERATE_INTERNAL does. However, RB_FIND and RB_NFIND don't do this. Is there any reason we need (cmp) expressions at all? It prevents macros from being used in those places, which may speed up the generated implementations. Or would it be better to fix the code in RB_FIND and RB_NFIND?
I've also thought about marking read-only elements const in *_FIND and similar functions. I've hit a warning in my code about stripping const off of the type there. Maybe that's paranoid, but I don't see a negative side effect. On a related note, the EXAMPLES section in src/share/man/man3/tree.3 is missing a semicolon at the end of RB_GENERATE. I can prepare a diff, but I wanted to ask first. Thanks, Franco
