Hi,

I've had this patch in my tree for a while.  It's just a consistency
fix so that cmp can be a plain macro for rb-trees, too.


Regards,
Franco

Index: tree.h
===================================================================
RCS file: /OpenBSD/src/sys/sys/tree.h,v
retrieving revision 1.13
diff -u -r1.13 tree.h
--- tree.h      9 Jul 2011 00:19:45 -0000       1.13
+++ tree.h      9 Jun 2013 19:02:37 -0000
@@ -622,7 +622,7 @@
        struct type *tmp = RB_ROOT(head);                               \
        int comp;                                                       \
        while (tmp) {                                                   \
-               comp = cmp(elm, tmp);                                   \
+               comp = (cmp)(elm, tmp);                                 \
                if (comp < 0)                                           \
                        tmp = RB_LEFT(tmp, field);                      \
                else if (comp > 0)                                      \
@@ -641,7 +641,7 @@
        struct type *res = NULL;                                        \
        int comp;                                                       \
        while (tmp) {                                                   \
-               comp = cmp(elm, tmp);                                   \
+               comp = (cmp)(elm, tmp);                                 \
                if (comp < 0) {                                         \
                        res = tmp;                                      \
                        tmp = RB_LEFT(tmp, field);                      \

Reply via email to