Module Name: src
Committed By: rmind
Date: Sun Jul 15 00:16:28 UTC 2012
Modified Files:
src/common/lib/libc/gen: ptree.c
src/sys/sys: ptree.h
Log Message:
ptree_find_filtered_node: make key argument const.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/gen/ptree.c
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/ptree.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/libc/gen/ptree.c
diff -u src/common/lib/libc/gen/ptree.c:1.8 src/common/lib/libc/gen/ptree.c:1.9
--- src/common/lib/libc/gen/ptree.c:1.8 Sat Jul 14 18:16:54 2012
+++ src/common/lib/libc/gen/ptree.c Sun Jul 15 00:16:28 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ptree.c,v 1.8 2012/07/14 18:16:54 matt Exp $ */
+/* $NetBSD: ptree.c,v 1.9 2012/07/15 00:16:28 rmind Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
#include <sys/types.h>
#include <sys/systm.h>
#include <lib/libkern/libkern.h>
-__KERNEL_RCSID(0, "$NetBSD: ptree.c,v 1.8 2012/07/14 18:16:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptree.c,v 1.9 2012/07/15 00:16:28 rmind Exp $");
#else
#include <stddef.h>
#include <stdint.h>
@@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: ptree.c,v 1.
#else
#define KASSERT(e) do { } while (/*CONSTCOND*/ 0)
#endif
-__RCSID("$NetBSD: ptree.c,v 1.8 2012/07/14 18:16:54 matt Exp $");
+__RCSID("$NetBSD: ptree.c,v 1.9 2012/07/15 00:16:28 rmind Exp $");
#endif /* _KERNEL || _STANDALONE */
#ifdef _LIBC
@@ -67,7 +67,7 @@ __RCSID("$NetBSD: ptree.c,v 1.8 2012/07/
#endif
/*
- * This is an implementation of a radix / PATRICIA tree. As in a traditional
+ * This is an implementation of a radix / PATRICIA tree. As in a traditional
* patricia tree, all the data is at the leaves of the tree. An N-value
* tree would have N leaves, N-1 branching nodes, and a root pointer. Each
* branching node would have left(0) and right(1) pointers that either point
@@ -76,15 +76,15 @@ __RCSID("$NetBSD: ptree.c,v 1.8 2012/07/
* have no need for pointers.
*
* However, allocation for these branching nodes is problematic since the
- * allocation could fail. This would cause insertions to fail for reasons
- * beyond the users control. So to prevent this, in this implementation
+ * allocation could fail. This would cause insertions to fail for reasons
+ * beyond the user's control. So to prevent this, in this implementation
* each node has two identities: its leaf identity and its branch identity.
* Each is separate from the other. Every branch is tagged as to whether
* it points to a leaf or a branch. This is not an attribute of the object
* but of the pointer to the object. The low bit of the pointer is used as
* the tag to determine whether it points to a leaf or branch identity, with
* branch identities having the low bit set.
- *
+ *
* A node's branch identity has one rule: when traversing the tree from the
* root to the node's leaf identity, one of the branches traversed will be via
* the node's branch identity. Of course, that has an exception: since to
@@ -93,7 +93,7 @@ __RCSID("$NetBSD: ptree.c,v 1.8 2012/07/
*
* Branching nodes also has a bit offset and a bit length which determines
* which branch slot is used. The bit length can be zero resulting in a
- * one-way branch. This is happens in two special cases: the root and
+ * one-way branch. This happens in two special cases: the root and
* interior mask nodes.
*
* To support longest match first lookups, when a mask node (one that only
@@ -628,7 +628,7 @@ ptree_insert_mask_node(pt_tree_t *pt, vo
#endif /* !PTNOMASH */
void *
-ptree_find_filtered_node(pt_tree_t *pt, void *key, pt_filter_t filter,
+ptree_find_filtered_node(pt_tree_t *pt, const void *key, pt_filter_t filter,
void *filter_arg)
{
#ifndef PTNOMASK
Index: src/sys/sys/ptree.h
diff -u src/sys/sys/ptree.h:1.6 src/sys/sys/ptree.h:1.7
--- src/sys/sys/ptree.h:1.6 Wed Jul 11 00:19:28 2012
+++ src/sys/sys/ptree.h Sun Jul 15 00:16:28 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ptree.h,v 1.6 2012/07/11 00:19:28 rmind Exp $ */
+/* $NetBSD: ptree.h,v 1.7 2012/07/15 00:16:28 rmind Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -184,7 +184,7 @@ typedef bool (*pt_filter_t)(void *, cons
void ptree_init(pt_tree_t *, const pt_tree_ops_t *, void *, size_t, size_t);
bool ptree_insert_node(pt_tree_t *, void *);
bool ptree_insert_mask_node(pt_tree_t *, void *, pt_bitlen_t);
-void * ptree_find_filtered_node(pt_tree_t *, void *, pt_filter_t, void *);
+void * ptree_find_filtered_node(pt_tree_t *, const void *, pt_filter_t, void *);
#define ptree_find_node(pt,key) \
ptree_find_filtered_node((pt), (key), NULL, NULL)
void ptree_remove_node(pt_tree_t *, void *);