Add restrict keyword to string functions.

Reviewed by:	bde
This commit is contained in:
Jeffrey Hsu 2003-02-10 00:36:27 +00:00
parent ffb37f33f8
commit 93eb73aa48
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110605
4 changed files with 6 additions and 13 deletions

View File

@ -36,9 +36,7 @@
#include <sys/libkern.h>
char *
strcat(s, append)
register char *s;
register const char *append;
strcat(char * __restrict s, const char * __restrict append)
{
char *save = s;

View File

@ -36,9 +36,7 @@
#include <sys/libkern.h>
char *
strcpy(to, from)
register char *to;
register const char *from;
strcpy(char * __restrict to, const char * __restrict from)
{
char *save = to;

View File

@ -43,10 +43,7 @@
* Return dst.
*/
char *
strncpy(dst, src, n)
char *dst;
const char *src;
register size_t n;
strncpy(char * __restrict dst, const char * __restrict src, size_t n)
{
if (n != 0) {
register char *d = dst;

View File

@ -89,14 +89,14 @@ char *rindex(const char *, int);
int scanc(u_int, const u_char *, const u_char *, int);
int skpc(int, int, char *);
void srandom(u_long);
char *strcat(char *, const char *);
char *strcat(char * __restrict, const char * __restrict);
int strcmp(const char *, const char *);
char *strcpy(char *, const char *);
char *strcpy(char * __restrict, const char * __restrict);
size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
size_t strlen(const char *);
int strncmp(const char *, const char *, size_t);
char *strncpy(char *, const char *, size_t);
char *strncpy(char * __restrict, const char * __restrict, size_t);
char *strsep(char **, const char *delim);
int strvalid(const char *, size_t);