]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Re-arrange so to reduce diff to upsteam.
authorRoy Marples <roy@marples.name>
Mon, 4 Mar 2019 16:07:05 +0000 (16:07 +0000)
committerRoy Marples <roy@marples.name>
Mon, 4 Mar 2019 16:07:05 +0000 (16:07 +0000)
compat/rb.c
configure
src/common.h

index 9b5491eed50e1e7e86ca1220f143720d35053f50..3b1c3e5fd10ab5863572db631577385983634402 100644 (file)
 #else
 #define KASSERT(s)     do { } while (/*CONSTCOND*/ 0)
 #endif
-// __RCSID("$NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $");
+//__RCSID("$NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $");
 #else
 #include <lib/libkern/libkern.h>
-// __KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.13 2014/08/22 17:19:48 matt Exp $");
 #endif
 
 #ifdef _LIBC
@@ -61,22 +61,14 @@ __weak_alias(rb_tree_depths, _rb_tree_depths)
 #include "namespace.h"
 #endif
 
-//#ifdef RBTEST
+#ifdef RBTEST
 #include "rbtree.h"
-//#else
-//#include <sys/rbtree.h>
-//#endif
-
-#if !defined(__predict_false)
-#if __GNUC__ > 2
-#define        __predict_true(exp)     __builtin_expect((exp) != 0, 1)
-#define        __predict_false(exp)    __builtin_expect((exp) != 0, 0)
 #else
-#define        __predict_true(exp)     (exp)
-#define        __predict_false(exp)    (exp)
-#endif
+#include <sys/rbtree.h>
 #endif
 
+#include "common.h"
+
 static void rb_tree_insert_rebalance(struct rb_tree *, struct rb_node *);
 static void rb_tree_removal_rebalance(struct rb_tree *, struct rb_node *,
        unsigned int);
@@ -334,6 +326,10 @@ rb_tree_reparent_nodes(struct rb_tree *rbt, struct rb_node *old_father,
        struct rb_node * const new_father = old_child;
        struct rb_node * const new_child = old_father;
 
+#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(RBDEBUG)
+       UNUSED(rbt);
+#endif
+
        KASSERT(which == RB_DIR_LEFT || which == RB_DIR_RIGHT);
 
        KASSERT(!RB_SENTINEL_P(old_child));
index 04c7fb4c3027a8a85d34ab092894913397fb66e4..acf671c327c9155258cc10cf4de7927414afd864 100755 (executable)
--- a/configure
+++ b/configure
@@ -965,6 +965,7 @@ EOF
        rm -f _rbtree.c _rbtree
 fi
 if [ "$RBTREE" = no ]; then
+       echo "CPPFLAGS+=        -DRBTEST" >>$CONFIG_MK
        echo "COMPAT_SRCS+=     compat/rb.c" >>$CONFIG_MK
        echo "#include                  \"compat/rbtree.h\"" >>$CONFIG_H
 else
index 8dfd251cc46a7d4b73c79203410b99aa5adfc83c..3f8f66e1ee09a452a65e2609f28c4257b33cee30 100644 (file)
 # endif
 #endif
 
+#ifndef __predict_false
+# if __GNUC__ > 2
+#  define      __predict_true(exp)     __builtin_expect((exp) != 0, 1)
+#  define      __predict_false(exp)    __builtin_expect((exp) != 0, 0)
+#else
+#  define      __predict_true(exp)     (exp)
+#  define      __predict_false(exp)    (exp)
+# endif
+#endif
+
 #ifndef __fallthrough
 # if __GNUC__ >= 7
 #  define __fallthrough __attribute__((fallthrough))