Delete the itree_null sentinel node, use NULL everywhere.
This effort caught a few (already commited) places that were
dereferencing through ITREE_NULL in a confusing way. It makes some
functions have to check for NULL in more places, but in my experinece
this is worth it from a code clarity point of view.
In doing this I rewrote `interval_tree_remove` completely. There
there was one final bug in that function that I simply could not find
when I #define'd ITREE_NULL to NULL. I couldn't easily understand
that function, so instead I rewrote it completely with a focus on code
clarity. Bug went away.
I have left the ITREE_NULL #define in code, to reduce code review
noise. It is easily removed later, mechanically.
* src/itree.h: #define ITREE_NULL to NULL and leave a FIXME.
* src/itree.c (itree_null): Delete the itree_null static variable.
(null_is_sane): Delete (and all callers).
(interval_tree_insert): Insert the first node as black straight away.
(itree_newlimit): Handle NULL children.
(interval_tree_remove_fix): ditto.
(interval_tree_insert_fix): ditto.
(interval_tree_remove): Rewrite for clarity.
(null_safe_is_red): New function.
(null_safe_is_black): New function.
(interval_tree_replace_child): Renamed from interval_tree_transplant.
(interval_tree_transplant): New function that something I think is
more like a full transplantation. (names are hard)