From owner-svn-src-head@FreeBSD.ORG Sat Feb 28 05:15:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C6C106564A; Sat, 28 Feb 2009 05:15:03 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45FA88FC14; Sat, 28 Feb 2009 05:15:03 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1S5F3wO095708; Sat, 28 Feb 2009 05:15:03 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1S5F32b095704; Sat, 28 Feb 2009 05:15:03 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200902280515.n1S5F32b095704@svn.freebsd.org> From: David Schultz Date: Sat, 28 Feb 2009 05:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189133 - in head: include lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2009 05:15:04 -0000 Author: das Date: Sat Feb 28 05:15:02 2009 New Revision: 189133 URL: http://svn.freebsd.org/changeset/base/189133 Log: Add restrict qualifiers to the parameters to strlcpy() and strlcat(). The annotation mainly just serves as a hint that they're not intended for use with overlapping strings. Modified: head/include/string.h head/lib/libc/string/strlcat.c head/lib/libc/string/strlcpy.3 head/lib/libc/string/strlcpy.c Modified: head/include/string.h ============================================================================== --- head/include/string.h Sat Feb 28 05:08:35 2009 (r189132) +++ head/include/string.h Sat Feb 28 05:15:02 2009 (r189133) @@ -85,8 +85,8 @@ char *strerror(int); int strerror_r(int, char *, size_t); #endif #if __BSD_VISIBLE -size_t strlcat(char *, const char *, size_t); -size_t strlcpy(char *, const char *, size_t); +size_t strlcat(char * __restrict, const char * __restrict, size_t); +size_t strlcpy(char * __restrict, const char * __restrict, size_t); #endif size_t strlen(const char *) __pure; #if __BSD_VISIBLE Modified: head/lib/libc/string/strlcat.c ============================================================================== --- head/lib/libc/string/strlcat.c Sat Feb 28 05:08:35 2009 (r189132) +++ head/lib/libc/string/strlcat.c Sat Feb 28 05:15:02 2009 (r189133) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); * If retval >= siz, truncation occurred. */ size_t -strlcat(char *dst, const char *src, size_t siz) +strlcat(char * __restrict dst, const char * __restrict src, size_t siz) { char *d = dst; const char *s = src; Modified: head/lib/libc/string/strlcpy.3 ============================================================================== --- head/lib/libc/string/strlcpy.3 Sat Feb 28 05:08:35 2009 (r189132) +++ head/lib/libc/string/strlcpy.3 Sat Feb 28 05:15:02 2009 (r189133) @@ -39,9 +39,9 @@ .Sh SYNOPSIS .In string.h .Ft size_t -.Fn strlcpy "char *dst" "const char *src" "size_t size" +.Fn strlcpy "char * restrict dst" "const char * restrict src" "size_t size" .Ft size_t -.Fn strlcat "char *dst" "const char *src" "size_t size" +.Fn strlcat "char * restrict dst" "const char * restrict src" "size_t size" .Sh DESCRIPTION The .Fn strlcpy Modified: head/lib/libc/string/strlcpy.c ============================================================================== --- head/lib/libc/string/strlcpy.c Sat Feb 28 05:08:35 2009 (r189132) +++ head/lib/libc/string/strlcpy.c Sat Feb 28 05:15:02 2009 (r189133) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -strlcpy(char *dst, const char *src, size_t siz) +strlcpy(char * __restrict dst, const char * __restrict src, size_t siz) { char *d = dst; const char *s = src;