[02/17] tsearch.3: SYNOPSIS: Use 'restrict' in prototypes

Message ID 20210311223330.722437-3-alx.manpages@gmail.com
State New
Headers show
Series
  • man3: SYNOPSIS: Use 'restrict' in prototypes
Related show

Commit Message

H.J. Lu via Libc-alpha March 11, 2021, 10:33 p.m.
Both POSIX and glibc use 'restrict' in tdelete().
Let's use it here too.

.../glibc$ grep_glibc_prototype tdelete
misc/search.h:138:
extern void *tdelete (const void *__restrict __key,
		      void **__restrict __rootp,
		      __compar_fn_t __compar);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man3/tsearch.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.30.1

Patch

diff --git a/man3/tsearch.3 b/man3/tsearch.3
index 1c771ef4a..ab4a2b767 100644
--- a/man3/tsearch.3
+++ b/man3/tsearch.3
@@ -35,11 +35,11 @@  tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary search tree
 .BI "                int (*" compar ")(const void *, const void *));"
 .BI "void *tfind(const void *" key ", void *const *" rootp ,
 .BI "                int (*" compar ")(const void *, const void *));"
-.BI "void *tdelete(const void *" key ", void **" rootp ,
+.BI "void *tdelete(const void *restrict " key ", void **restrict " rootp ,
 .BI "                int (*" compar ")(const void *, const void *));"
 .BI "void twalk(const void *" root ,
 .BI "                void (*" action ")(const void *" nodep ", VISIT " which ,
-.BI "                               int " depth "));"
+.BI "                               int " depth ));
 .PP
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
 .B #include <search.h>