aatree: make NIL node const.
authorMarko Kreen <markokr@gmail.com>
Sat, 11 Sep 2010 07:44:15 +0000 (10:44 +0300)
committerMarko Kreen <markokr@gmail.com>
Sat, 11 Sep 2010 08:30:47 +0000 (11:30 +0300)
It really should not be modified.

usual/aatree.c

index 0378facbd953449c44a0905d3a842e8704fb90d3..29570a3e58d54fadb62b98aaf865b5198c1992ce 100644 (file)
@@ -53,8 +53,8 @@ typedef struct AANode Node;
 /*
  * NIL node
  */
-#define NIL (&_nil)
-static struct AANode _nil = { &_nil, &_nil, 0 };
+#define NIL ((struct AANode *)&_nil)
+static const struct AANode _nil = { NIL, NIL, 0 };
 
 /*
  * Rebalancing.  AA-tree needs only 2 operations