diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-20 20:25:50 +0400 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-20 20:25:50 +0400 |
commit | ea9d80921f04e6f4f2f97f0984f002a98acd92b0 (patch) | |
tree | 5258d827c2b2459da08583d6489b18c3323d8e13 /newlib/libc/posix | |
parent | a2c4eac5d02f3d35dc6c450b9f0bb6e71ce916cc (diff) |
2013-11-20 Chirayu Desai <chirayudesai1@gmail.com>
* libc/include/regex.h, libc/posix/regcomp.c,
libc/posix/regerror.c, libc/posix/regex.3
libc/posix/regexec.c: Add restrict keyword.
Diffstat (limited to 'newlib/libc/posix')
-rw-r--r-- | newlib/libc/posix/regcomp.c | 6 | ||||
-rw-r--r-- | newlib/libc/posix/regerror.c | 7 | ||||
-rw-r--r-- | newlib/libc/posix/regex.3 | 10 | ||||
-rw-r--r-- | newlib/libc/posix/regexec.c | 10 |
4 files changed, 17 insertions, 16 deletions
diff --git a/newlib/libc/posix/regcomp.c b/newlib/libc/posix/regcomp.c index bd90d2cdf..002f978cd 100644 --- a/newlib/libc/posix/regcomp.c +++ b/newlib/libc/posix/regcomp.c @@ -174,7 +174,7 @@ static int never = 0; /* for use in asserts; shuts lint up */ /* - regcomp - interface for parser and compilation - = extern int regcomp(regex_t *, const char *, int); + = extern int regcomp(regex_t *__restrict, const char *__restrict, int); = #define REG_BASIC 0000 = #define REG_EXTENDED 0001 = #define REG_ICASE 0002 @@ -186,8 +186,8 @@ static int never = 0; /* for use in asserts; shuts lint up */ */ int /* 0 success, otherwise REG_something */ regcomp(preg, pattern, cflags) -regex_t *preg; -const char *pattern; +regex_t *__restrict preg; +const char *__restrict pattern; int cflags; { struct parse pa; diff --git a/newlib/libc/posix/regerror.c b/newlib/libc/posix/regerror.c index 3ae1c2586..a48d37c72 100644 --- a/newlib/libc/posix/regerror.c +++ b/newlib/libc/posix/regerror.c @@ -107,14 +107,15 @@ static struct rerr { /* - regerror - the interface to error numbers - = extern size_t regerror(int, const regex_t *, char *, size_t); + = extern size_t regerror(int, const regex_t *__restrict, + = char *__restrict, size_t); */ /* ARGSUSED */ size_t regerror(errcode, preg, errbuf, errbuf_size) int errcode; -const regex_t *preg; -char *errbuf; +const regex_t *__restrict preg; +char *__restrict errbuf; size_t errbuf_size; { struct rerr *r; diff --git a/newlib/libc/posix/regex.3 b/newlib/libc/posix/regex.3 index d87164177..d0b45a8e7 100644 --- a/newlib/libc/posix/regex.3 +++ b/newlib/libc/posix/regex.3 @@ -51,16 +51,16 @@ .In sys/types.h .In regex.h .Ft int -.Fn regcomp "regex_t *preg" "const char *pattern" "int cflags" +.Fn regcomp "regex_t *restrict preg" "const char *_restrictpattern" "int cflags" .Ft int .Fo regexec -.Fa "const regex_t *preg" "const char *string" -.Fa "size_t nmatch" "regmatch_t pmatch[]" "int eflags" +.Fa "const regex_t *_restrict preg" "const char *_restrict string" +.Fa "size_t nmatch" "regmatch_t pmatch[_restrict]" "int eflags" .Fc .Ft size_t .Fo regerror -.Fa "int errcode" "const regex_t *preg" -.Fa "char *errbuf" "size_t errbuf_size" +.Fa "int errcode" "const regex_t *_restrict preg" +.Fa "char *_restrict errbuf" "size_t errbuf_size" .Fc .Ft void .Fn regfree "regex_t *preg" diff --git a/newlib/libc/posix/regexec.c b/newlib/libc/posix/regexec.c index 98f5ef611..6e39e9ead 100644 --- a/newlib/libc/posix/regexec.c +++ b/newlib/libc/posix/regexec.c @@ -140,8 +140,8 @@ static int nope = 0; /* for use in asserts; shuts lint up */ /* - regexec - interface for matching - = extern int regexec(const regex_t *, const char *, size_t, \ - = regmatch_t [], int); + = extern int regexec(const regex_t *__restrict, const char *__restrict, + = size_t, regmatch_t [__restrict], int); = #define REG_NOTBOL 00001 = #define REG_NOTEOL 00002 = #define REG_STARTEND 00004 @@ -155,10 +155,10 @@ static int nope = 0; /* for use in asserts; shuts lint up */ */ int /* 0 success, REG_NOMATCH failure */ regexec(preg, string, nmatch, pmatch, eflags) -const regex_t *preg; -const char *string; +const regex_t *__restrict preg; +const char *__restrict string; size_t nmatch; -regmatch_t pmatch[]; +regmatch_t pmatch[__restrict]; int eflags; { struct re_guts *g = preg->re_g; |