From 384c8f8fcd9e7fdacef20400c61698f841c5056a Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 2 Oct 2002 07:49:35 +0000 Subject: Add restrict type-qualifier. --- lib/libc/regex/regcomp.c | 4 ++-- lib/libc/regex/regerror.c | 4 ++-- lib/libc/regex/regex.3 | 15 ++++++++------- lib/libc/regex/regexec.c | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'lib/libc/regex') diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 91de8d7..07c3955 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -189,8 +189,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/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c index eb233d9..9888202 100644 --- a/lib/libc/regex/regerror.c +++ b/lib/libc/regex/regerror.c @@ -116,8 +116,8 @@ static struct rerr { 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/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3 index 857f552..dc0bac8 100644 --- a/lib/libc/regex/regex.3 +++ b/lib/libc/regex/regex.3 @@ -36,7 +36,7 @@ .\" @(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd March 20, 1994 +.Dd October 2, 2002 .Dt REGEX 3 .Os .Sh NAME @@ -48,19 +48,20 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In regex.h .Ft int -.Fn regcomp "regex_t *preg" "const char *pattern" "int cflags" +.Fo regcomp +.Fa "regex_t * restrict preg" "const char * restrict pattern" "int cflags" +.Fc .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/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c index a23c61c..abbd9ba 100644 --- a/lib/libc/regex/regexec.c +++ b/lib/libc/regex/regexec.c @@ -156,10 +156,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; -- cgit v1.1