Patch - Add restrict for glob.h
Joel Sherrill
joel.sherrill@oarcorp.com
Wed Nov 20 22:54:00 GMT 2013
Hi
Another patch from Google Code-In.
Build OK for sparc-rtems and make info.
OK to commit?
2013-11-20 Julio Gutierrez <jgutleyva@gmail.com>
* libc/include/glob.h, libc/posix/glob.c, libc/posix/glob.3:
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 --------------
? libc/libc.info
? libm/libm.info
Index: libc/include/glob.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/glob.h,v
retrieving revision 1.1
diff -u -r1.1 glob.h
--- libc/include/glob.h 31 Oct 2008 21:03:41 -0000 1.1
+++ libc/include/glob.h 20 Nov 2013 22:49:07 -0000
@@ -82,7 +82,8 @@
#define GLOB_ABEND (-2) /* Unignored error. */
__BEGIN_DECLS
-int glob(const char *, int, int (*)(const char *, int), glob_t *);
+int glob(const char *__restrict, int, int (*)(const char *, int),
+ glob_t *__restrict);
void globfree(glob_t *);
__END_DECLS
Index: libc/posix/glob.3
===================================================================
RCS file: /cvs/src/src/newlib/libc/posix/glob.3,v
retrieving revision 1.1
diff -u -r1.1 glob.3
--- libc/posix/glob.3 31 Oct 2008 21:03:41 -0000 1.1
+++ libc/posix/glob.3 20 Nov 2013 22:49:07 -0000
@@ -46,7 +46,7 @@
.Sh SYNOPSIS
.In glob.h
.Ft int
-.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
+.Fn glob "const char *restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *restrict pglob"
.Ft void
.Fn globfree "glob_t *pglob"
.Sh DESCRIPTION
Index: libc/posix/glob.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/posix/glob.c,v
retrieving revision 1.2
diff -u -r1.2 glob.c
--- libc/posix/glob.c 8 Aug 2012 11:04:17 -0000 1.2
+++ libc/posix/glob.c 20 Nov 2013 22:49:08 -0000
@@ -158,9 +158,9 @@
int
glob(pattern, flags, errfunc, pglob)
- const char *pattern;
+ const char *__restrict pattern;
int flags, (*errfunc)(const char *, int);
- glob_t *pglob;
+ glob_t *__restrict pglob;
{
const u_char *patnext;
int c, limit;
More information about the Newlib
mailing list