Module Name:    src
Committed By:   pgoyette
Date:           Tue Jun 28 05:18:11 UTC 2016

Modified Files:
        src/common/lib/libprop: Makefile.inc prop_dictionary.c prop_number.c
Removed Files:
        src/common/lib/libprop: prop_rb.c prop_rb_impl.h

Log Message:
The local copy of rb_tree code has been unused for quite some time.  So
we can just remove it, and adjust callers to use the "real" rbtree
function names.

Addresses PR lib/44090


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/Makefile.inc
cvs rdiff -u -r1.39 -r1.40 src/common/lib/libprop/prop_dictionary.c
cvs rdiff -u -r1.27 -r1.28 src/common/lib/libprop/prop_number.c
cvs rdiff -u -r1.10 -r0 src/common/lib/libprop/prop_rb.c
cvs rdiff -u -r1.9 -r0 src/common/lib/libprop/prop_rb_impl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libprop/Makefile.inc
diff -u src/common/lib/libprop/Makefile.inc:1.9 src/common/lib/libprop/Makefile.inc:1.10
--- src/common/lib/libprop/Makefile.inc:1.9	Fri Jul 27 09:10:59 2012
+++ src/common/lib/libprop/Makefile.inc	Tue Jun 28 05:18:11 2016
@@ -1,11 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.9 2012/07/27 09:10:59 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.10 2016/06/28 05:18:11 pgoyette Exp $
 
 .PATH:	${.PARSEDIR}
 
 SRCS+=	prop_array.c prop_array_util.c prop_bool.c prop_data.c \
         prop_dictionary.c prop_dictionary_util.c prop_ingest.c \
         prop_kern.c prop_number.c prop_object.c prop_stack.c prop_string.c
-
-.ifdef (PROPLIB_WANT_RB)
-SRCS+=	prop_rb.c
-.endif

Index: src/common/lib/libprop/prop_dictionary.c
diff -u src/common/lib/libprop/prop_dictionary.c:1.39 src/common/lib/libprop/prop_dictionary.c:1.40
--- src/common/lib/libprop/prop_dictionary.c:1.39	Fri Oct 18 18:26:20 2013
+++ src/common/lib/libprop/prop_dictionary.c	Tue Jun 28 05:18:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_dictionary.c,v 1.39 2013/10/18 18:26:20 martin Exp $	*/
+/*	$NetBSD: prop_dictionary.c,v 1.40 2016/06/28 05:18:11 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -33,7 +33,8 @@
 #include <prop/prop_array.h>
 #include <prop/prop_dictionary.h>
 #include <prop/prop_string.h>
-#include "prop_rb_impl.h"
+
+#include <sys/rbtree.h>
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include <errno.h>
@@ -210,7 +211,7 @@ _prop_dict_init(void)
 {
 
 	_PROP_MUTEX_INIT(_prop_dict_keysym_tree_mutex);
-	_prop_rb_tree_init(&_prop_dict_keysym_tree,
+	rb_tree_init(&_prop_dict_keysym_tree,
 			   &_prop_dict_keysym_rb_tree_ops);
 	return 0;
 }
@@ -235,7 +236,7 @@ _prop_dict_keysym_free(prop_stack_t stac
 {
 	prop_dictionary_keysym_t pdk = *obj;
 
-	_prop_rb_tree_remove_node(&_prop_dict_keysym_tree, pdk);
+	rb_tree_remove_node(&_prop_dict_keysym_tree, pdk);
 	_prop_dict_keysym_put(pdk);
 
 	return _PROP_OBJECT_FREE_DONE;
@@ -292,7 +293,7 @@ _prop_dict_keysym_alloc(const char *key)
 	 * we just retain it and return it.
 	 */
 	_PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex);
-	opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key);
+	opdk = rb_tree_find(&_prop_dict_keysym_tree, key);
 	if (opdk != NULL) {
 		prop_object_retain(opdk);
 		_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
@@ -328,14 +329,14 @@ _prop_dict_keysym_alloc(const char *key)
 	 * we have to check again if it is in the tree.
 	 */
 	_PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex);
-	opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key);
+	opdk = rb_tree_find(&_prop_dict_keysym_tree, key);
 	if (opdk != NULL) {
 		prop_object_retain(opdk);
 		_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
 		_prop_dict_keysym_put(pdk);
 		return (opdk);
 	}
-	rpdk = _prop_rb_tree_insert_node(&_prop_dict_keysym_tree, pdk);
+	rpdk = rb_tree_insert_node(&_prop_dict_keysym_tree, pdk);
 	_PROP_ASSERT(rpdk == pdk);
 	_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
 	return (rpdk);

Index: src/common/lib/libprop/prop_number.c
diff -u src/common/lib/libprop/prop_number.c:1.27 src/common/lib/libprop/prop_number.c:1.28
--- src/common/lib/libprop/prop_number.c:1.27	Fri Sep  5 05:19:24 2014
+++ src/common/lib/libprop/prop_number.c	Tue Jun 28 05:18:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_number.c,v 1.27 2014/09/05 05:19:24 matt Exp $	*/
+/*	$NetBSD: prop_number.c,v 1.28 2016/06/28 05:18:11 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,9 +29,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <sys/rbtree.h>
 #include <prop/prop_number.h>
 #include "prop_object_impl.h"
-#include "prop_rb_impl.h"
 
 #if defined(_KERNEL)
 #include <sys/systm.h>
@@ -157,7 +157,7 @@ _prop_number_free(prop_stack_t stack, pr
 {
 	prop_number_t pn = *obj;
 
-	_prop_rb_tree_remove_node(&_prop_number_tree, pn);
+	rb_tree_remove_node(&_prop_number_tree, pn);
 
 	_PROP_POOL_PUT(_prop_number_pool, pn);
 
@@ -171,7 +171,7 @@ _prop_number_init(void)
 {
 
 	_PROP_MUTEX_INIT(_prop_number_tree_mutex);
-	_prop_rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops);
+	rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops);
 	return 0;
 }
 
@@ -283,7 +283,7 @@ _prop_number_alloc(const struct _prop_nu
 	 * we just retain it and return it.
 	 */
 	_PROP_MUTEX_LOCK(_prop_number_tree_mutex);
-	opn = _prop_rb_tree_find(&_prop_number_tree, pnv);
+	opn = rb_tree_find(&_prop_number_tree, pnv);
 	if (opn != NULL) {
 		prop_object_retain(opn);
 		_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
@@ -308,14 +308,14 @@ _prop_number_alloc(const struct _prop_nu
 	 * we have to check again if it is in the tree.
 	 */
 	_PROP_MUTEX_LOCK(_prop_number_tree_mutex);
-	opn = _prop_rb_tree_find(&_prop_number_tree, pnv);
+	opn = rb_tree_find_node(&_prop_number_tree, pnv);
 	if (opn != NULL) {
 		prop_object_retain(opn);
 		_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
 		_PROP_POOL_PUT(_prop_number_pool, pn);
 		return (opn);
 	}
-	rpn = _prop_rb_tree_insert_node(&_prop_number_tree, pn);
+	rpn = rb_tree_insert_node(&_prop_number_tree, pn);
 	_PROP_ASSERT(rpn == pn);
 	_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
 	return (rpn);

Reply via email to