diff options
author | robert <robert@FreeBSD.org> | 2002-08-14 21:16:41 +0000 |
---|---|---|
committer | robert <robert@FreeBSD.org> | 2002-08-14 21:16:41 +0000 |
commit | d02311a4f878ddd45c2e5b61ab57cd2201c8373c (patch) | |
tree | 983842569d2950080f5fc9748d651225ee9b21b4 /lib/libc/stdlib | |
parent | c892b9928158be63c8856eff5a33bbf7bba79c49 (diff) | |
download | FreeBSD-src-d02311a4f878ddd45c2e5b61ab57cd2201c8373c.zip FreeBSD-src-d02311a4f878ddd45c2e5b61ab57cd2201c8373c.tar.gz |
- Add the 'restrict' qualifier to match the IEEE Std 1003.1-2001
prototype of the tdelete(3) function.
- Remove duplicated space.
- Use an ANSI-C function definition for tdelete(3).
- Update the manual page.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/tdelete.c | 16 | ||||
-rw-r--r-- | lib/libc/stdlib/tsearch.3 | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/libc/stdlib/tdelete.c b/lib/libc/stdlib/tdelete.c index 32dc298..5729bd5 100644 --- a/lib/libc/stdlib/tdelete.c +++ b/lib/libc/stdlib/tdelete.c @@ -25,16 +25,20 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> -/* delete node with given key */ +/* + * delete node with given key + * + * vkey: key to be deleted + * vrootp: address of the root of the tree + * compar: function to carry out node comparisons + */ void * -tdelete(vkey, vrootp, compar) - const void *vkey; /* key to be deleted */ - void **vrootp; /* address of the root of tree */ - int (*compar)(const void *, const void *); +tdelete(const void *__restrict vkey, void **__restrict vrootp, + int (*compar)(const void *, const void *)) { node_t **rootp = (node_t **)vrootp; node_t *p, *q, *r; - int cmp; + int cmp; if (rootp == NULL || (p = *rootp) == NULL) return NULL; diff --git a/lib/libc/stdlib/tsearch.3 b/lib/libc/stdlib/tsearch.3 index 87a2571..06ff720 100644 --- a/lib/libc/stdlib/tsearch.3 +++ b/lib/libc/stdlib/tsearch.3 @@ -36,7 +36,7 @@ .Sh SYNOPSIS .In search.h .Ft void * -.Fn tdelete "const void *key" "void **rootp" "int (*compar) (const void *, const void *)" +.Fn tdelete "const void *restrict key" "void **restrict rootp" "int (*compar) (const void *, const void *)" .Ft void * .Fn tfind "const void *key" "void **rootp" "int (*compar) (const void *, const void *)" .Ft void * |