shithub: scc

Download patch

ref: e74d7631c72644f14aec7b55e6bf69ad7a51a6fd
parent: 7d02b4c1db8aa0f5b311f01714ef84d7f16888cc
author: Quentin Rameau <[email protected]>
date: Wed Feb 22 16:48:55 EST 2017

[libc] Sync src definitions to headers declarations

--- a/libc/src/memcpy.c
+++ b/libc/src/memcpy.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 void *
-memcpy(void *dst, const void *src, size_t n)
+memcpy(void * restrict dst, const void * restrict src, size_t n)
 {
 	char *s1 = dst;
 	const char *s2 = src;
--- a/libc/src/strcat.c
+++ b/libc/src/strcat.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 char *
-strcat(char *dst, const char *src)
+strcat(char * restrict dst, const char * restrict src)
 {
 	char *ret = dst;
 
--- a/libc/src/strcpy.c
+++ b/libc/src/strcpy.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 char *
-strcpy(char *dst, const char *src)
+strcpy(char * restrict dst, const char * restrict src)
 {
 	char *ret = dst;
 
--- a/libc/src/strncat.c
+++ b/libc/src/strncat.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 char *
-strncat(char *dst, const char *src, size_t n)
+strncat(char * restrict dst, const char * restrict src, size_t n)
 {
 	char *ret = dst;
 
--- a/libc/src/strncpy.c
+++ b/libc/src/strncpy.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 char *
-strncpy(char *dst, const char *src, size_t n)
+strncpy(char * restrict dst, const char * restrict src, size_t n)
 {
 	char *ret = dst;
 
--- a/libc/src/strtok.c
+++ b/libc/src/strtok.c
@@ -3,11 +3,11 @@
 #include <string.h>
 
 char *
-strtok(const char *s, const char *delim)
+strtok(char * restrict s, const char * restrict delim)
 {
 	static char *line;
 
-	if (s) 
+	if (s)
 		line = s;
 	if (!s && !line)
 		return NULL;
--- a/libc/src/strxfrm.c
+++ b/libc/src/strxfrm.c
@@ -3,7 +3,7 @@
 #include <string.h>
 
 size_t
-strxfrm(char *dst, const char *src, size_t n)
+strxfrm(char * restrict dst, const char * restrict src, size_t n)
 {
 	size_t len = strlen(src);