diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-09-01 21:07:54 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-09-01 21:07:54 +0200 |
commit | ac044784a6ce64ff15610d4b70750065a7f01b80 (patch) | |
tree | 8ac8629c0089099f21be9107a5d3779963d33ca0 /src/string/memcpy.c | |
parent | add memfrob (diff) | |
download | slibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.gz slibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.bz2 slibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.xz |
start on makefile and fixing warnings and errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/string/memcpy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/string/memcpy.c b/src/string/memcpy.c index 4582544..02479cd 100644 --- a/src/string/memcpy.c +++ b/src/string/memcpy.c @@ -18,6 +18,9 @@ #include <string.h> +# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" + + /** * Copy a memory segment to another, non-overlapping, segment. @@ -30,10 +33,11 @@ void* memcpy(void* restrict whither, const void* restrict whence, size_t size) { /* TODO improve implementation of memcpy */ - void* r = whither; + char* d = whither; + char* s = whence; while (size--) - *whither++ = *whence++; - return r; + *d++ = *s++; + return whither; } |