Patch - Add restrict to search.h
Joel Sherrill
joel.sherrill@oarcorp.com
Wed Nov 20 16:25:00 GMT 2013
Hi
Another patch in the restrict series from Google Code-In.
OK to commit?
2013-11-20 Daniel Ramirez <javamonn@gmail.com>
* libc/include/search.h, libc/search/tdelete.c: Add restrict
keyword.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
-------------- next part --------------
? cscope.out
Index: newlib/libc/include/search.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/search.h,v
retrieving revision 1.2
diff -u -r1.2 search.h
--- newlib/libc/include/search.h 8 Sep 2013 07:11:32 -0000 1.2
+++ newlib/libc/include/search.h 20 Nov 2013 02:44:25 -0000
@@ -54,7 +54,7 @@
int hcreate_r(size_t, struct hsearch_data *);
void hdestroy_r(struct hsearch_data *);
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
-void *tdelete(const void *, void **, __compar_fn_t);
+void *tdelete(const void *__restrict, void **__restrict, __compar_fn_t);
void tdestroy (void *, void (*)(void *));
void *tfind(const void *, void **, __compar_fn_t);
void *tsearch(const void *, void **, __compar_fn_t);
Index: newlib/libc/search/tdelete.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/search/tdelete.c,v
retrieving revision 1.2
diff -u -r1.2 tdelete.c
--- newlib/libc/search/tdelete.c 6 Jun 2003 19:57:51 -0000 1.2
+++ newlib/libc/search/tdelete.c 20 Nov 2013 02:44:26 -0000
@@ -27,8 +27,8 @@
/* delete node with given key */
void *
_DEFUN(tdelete, (vkey, vrootp, compar),
- const void *vkey _AND /* key to be deleted */
- void **vrootp _AND /* address of the root of tree */
+ const void *__restrict vkey _AND /* key to be deleted */
+ void **__restrict vrootp _AND /* address of the root of tree */
int (*compar)(const void *, const void *))
{
node_t **rootp = (node_t **)vrootp;
More information about the Newlib
mailing list