From d080bbfa45ca390f4beec7985f963fd2dbb10327 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 2 Aug 1999 05:54:50 +0000 Subject: [PATCH] * splay-tree.h (splay_tree_insert): Return the new node. From-SVN: r28389 --- include/ChangeLog | 4 ++++ include/splay-tree.h | 3 ++- libiberty/ChangeLog | 4 ++++ libiberty/splay-tree.c | 6 ++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/ChangeLog b/include/ChangeLog index 6ec3b0b963d..5d213d52993 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +1999-08-01 Mark Mitchell + + * splay-tree.h (splay_tree_insert): Return the new node. + 1999-07-11 Ian Lance Taylor * ansidecl.h: Copy attribute support macros from egcs. diff --git a/include/splay-tree.h b/include/splay-tree.h index e828fe7e907..307cf054e12 100644 --- a/include/splay-tree.h +++ b/include/splay-tree.h @@ -95,7 +95,8 @@ extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn, splay_tree_delete_key_fn, splay_tree_delete_value_fn)); extern void splay_tree_delete PARAMS((splay_tree)); -extern void splay_tree_insert PARAMS((splay_tree, +extern splay_tree_node splay_tree_insert + PARAMS((splay_tree, splay_tree_key, splay_tree_value)); extern splay_tree_node splay_tree_lookup diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index ac75bc7431a..4ad72e5d1ca 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +1999-08-01 Mark Mitchell + + * splay-tree.c (splay_tree_insert): Return the new node. + 1999-07-14 Richard Henderson * argv.c: Include stdlib.h and string.h instead of diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c index 1cb6bd91f22..a17d0a1176a 100644 --- a/libiberty/splay-tree.c +++ b/libiberty/splay-tree.c @@ -256,9 +256,9 @@ splay_tree_delete (sp) /* Insert a new node (associating KEY with DATA) into SP. If a previous node with the indicated KEY exists, its data is replaced - with the new value. */ + with the new value. Returns the new node. */ -void +splay_tree_node splay_tree_insert (sp, key, value) splay_tree sp; splay_tree_key key; @@ -305,6 +305,8 @@ splay_tree_insert (sp, key, value) sp->root = node; } + + return sp->root; } /* Lookup KEY in SP, returning VALUE if present, and NULL