Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-22 19:02:23 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-01-22 19:02:23 +0300
commit63cea8dcb79be7bf2bd32b7c05ac289a473192a5 (patch)
tree1e1312312fecee2f342f9ced8297931ddb7b3ff1
parent6370c3e6365d938dc3ff6f85aead5c0dc4151f52 (diff)
update avl implementation from packetbb
-rw-r--r--avl.c8
-rw-r--r--avl.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/avl.c b/avl.c
index bde40b7..fa23b03 100644
--- a/avl.c
+++ b/avl.c
@@ -111,7 +111,7 @@ avl_init(struct avl_tree *tree, avl_tree_comp comp, bool allow_dups, void *ptr)
* @param pointer to elemen, NULL if no fitting one was found
*/
void *
-__avl_find_element(struct avl_tree *tree, const void *key, size_t offset, enum avl_find_mode mode) {
+__avl_find_element(const struct avl_tree *tree, const void *key, size_t offset, enum avl_find_mode mode) {
void *node = NULL;
switch (mode) {
@@ -136,7 +136,7 @@ __avl_find_element(struct avl_tree *tree, const void *key, size_t offset, enum a
* this key exists.
*/
struct avl_node *
-avl_find(struct avl_tree *tree, const void *key)
+avl_find(const struct avl_tree *tree, const void *key)
{
struct avl_node *node;
int diff;
@@ -158,7 +158,7 @@ avl_find(struct avl_tree *tree, const void *key)
* key less or equal specified key exists.
*/
struct avl_node *
-avl_find_lessequal(struct avl_tree *tree, const void *key) {
+avl_find_lessequal(const struct avl_tree *tree, const void *key) {
struct avl_node *node, *next;
int diff;
@@ -200,7 +200,7 @@ avl_find_lessequal(struct avl_tree *tree, const void *key) {
* key greater or equal specified key exists.
*/
struct avl_node *
-avl_find_greaterequal(struct avl_tree *tree, const void *key) {
+avl_find_greaterequal(const struct avl_tree *tree, const void *key) {
struct avl_node *node, *next;
int diff;
diff --git a/avl.h b/avl.h
index 1c57604..80a29b7 100644
--- a/avl.h
+++ b/avl.h
@@ -155,12 +155,12 @@ enum avl_find_mode {
};
void EXPORT(avl_init)(struct avl_tree *, avl_tree_comp, bool, void *);
-struct avl_node *EXPORT(avl_find)(struct avl_tree *, const void *);
-struct avl_node *EXPORT(avl_find_greaterequal)(struct avl_tree *tree, const void *key);
-struct avl_node *EXPORT(avl_find_lessequal)(struct avl_tree *tree, const void *key);
+struct avl_node *EXPORT(avl_find)(const struct avl_tree *, const void *);
+struct avl_node *EXPORT(avl_find_greaterequal)(const struct avl_tree *tree, const void *key);
+struct avl_node *EXPORT(avl_find_lessequal)(const struct avl_tree *tree, const void *key);
int EXPORT(avl_insert)(struct avl_tree *, struct avl_node *);
void EXPORT(avl_delete)(struct avl_tree *, struct avl_node *);
-void *EXPORT(__avl_find_element)(struct avl_tree *tree, const void *key,
+void *EXPORT(__avl_find_element)(const struct avl_tree *tree, const void *key,
size_t offset, enum avl_find_mode mode);
/**