]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/memset.c
floatformat.h (struct floatformat): Add field "is_valid".
[thirdparty/gcc.git] / libiberty / memset.c
CommitLineData
6599da04
JM
1/* memset
2 This implementation is in the public domain. */
3
aaa5f039
DD
4/*
5
6@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count})
7
8Sets the first @var{count} bytes of @var{s} to the constant byte
9@var{c}, returning a pointer to @var{s}.
10
11@end deftypefn
12
13*/
14
6599da04 15#include <ansidecl.h>
0ae0f1b0 16#ifdef ANSI_PROTOTYPES
6599da04
JM
17#include <stddef.h>
18#else
19#define size_t unsigned long
20#endif
21
22PTR
0ae0f1b0
RS
23memset (dest, val, len)
24 PTR dest;
25 register int val;
26 register size_t len;
6599da04
JM
27{
28 register unsigned char *ptr = (unsigned char*)dest;
29 while (len-- > 0)
30 *ptr++ = val;
31 return dest;
32}