Patch - Add restrict to wordexp.h

Joel Sherrill joel.sherrill@oarcorp.com
Sat Nov 23 18:10:00 GMT 2013


Hi

We are nearly at the end of the add restrict patches from
Google Code-In.

OK to commit?

2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com>

        * libc/include/wordexp.h (wordexp): Add restrict keyword.
        * libc/posix/wordexp.c (wordexp): Ditto.


-- 
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 --------------
Index: newlib/libc/include/wordexp.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/wordexp.h,v
retrieving revision 1.2
diff -u -r1.2 wordexp.h
--- newlib/libc/include/wordexp.h	8 Jun 2010 21:47:57 -0000	1.2
+++ newlib/libc/include/wordexp.h	22 Nov 2013 00:55:55 -0000
@@ -43,7 +43,7 @@
 /* Note: This implementation of wordexp requires a version of bash
    that supports the --wordexp and --protected arguments to be present
    on the system.  It does not support the WRDE_UNDEF flag. */
-int wordexp(const char *, wordexp_t *, int);
+int wordexp(const char *__restrict, wordexp_t *__restrict, int);
 void wordfree(wordexp_t *);
 
 #ifdef __cplusplus
Index: newlib/libc/posix/wordexp.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/posix/wordexp.c,v
retrieving revision 1.6
diff -u -r1.6 wordexp.c
--- newlib/libc/posix/wordexp.c	9 Oct 2012 12:05:51 -0000	1.6
+++ newlib/libc/posix/wordexp.c	22 Nov 2013 00:55:55 -0000
@@ -29,7 +29,7 @@
    that supports the --wordexp and --protected arguments to be present
    on the system.  It does not support the WRDE_UNDEF flag. */
 int
-wordexp(const char *words, wordexp_t *pwordexp, int flags)
+wordexp(const char *__restrict words, wordexp_t *__restrict pwordexp, int flags)
 {
   FILE *f = NULL;
   FILE *f_err = NULL;


More information about the Newlib mailing list