]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/memset.c
AArch64: Cleanup memset expansion
[thirdparty/gcc.git] / libiberty / memset.c
CommitLineData
6599da04
JM
1/* memset
2 This implementation is in the public domain. */
3
aaa5f039
DD
4/*
5
996c0cb0
RW
6@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
7 size_t @var{count})
aaa5f039
DD
8
9Sets the first @var{count} bytes of @var{s} to the constant byte
10@var{c}, returning a pointer to @var{s}.
11
12@end deftypefn
13
14*/
15
6599da04 16#include <ansidecl.h>
6599da04 17#include <stddef.h>
6599da04 18
50b009c5
ML
19void *
20memset (void *dest, register int val, register size_t len)
6599da04
JM
21{
22 register unsigned char *ptr = (unsigned char*)dest;
23 while (len-- > 0)
24 *ptr++ = val;
25 return dest;
26}