Mercurial > hg > CbC > CbC_gcc
annotate libiberty/memset.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | f6334be47118 |
children |
rev | line source |
---|---|
0 | 1 /* memset |
2 This implementation is in the public domain. */ | |
3 | |
4 /* | |
5 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
7 size_t @var{count}) |
0 | 8 |
9 Sets 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 | |
16 #include <ansidecl.h> | |
17 #include <stddef.h> | |
18 | |
19 PTR | |
20 memset (PTR dest, register int val, register size_t len) | |
21 { | |
22 register unsigned char *ptr = (unsigned char*)dest; | |
23 while (len-- > 0) | |
24 *ptr++ = val; | |
25 return dest; | |
26 } |