|
|
1.1 root 1: /* memset
2: Copyright (C) 1991 Free Software Foundation, Inc.
3:
4: This file is part of the libiberty library.
5: Libiberty is free software; you can redistribute it and/or
6: modify it under the terms of the GNU Library General Public
7: License as published by the Free Software Foundation; either
8: version 2 of the License, or (at your option) any later version.
9:
10: Libiberty is distributed in the hope that it will be useful,
11: but WITHOUT ANY WARRANTY; without even the implied warranty of
12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: Library General Public License for more details.
14:
15: You should have received a copy of the GNU Library General Public
16: License along with libiberty; see the file COPYING.LIB. If
17: not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18: Cambridge, MA 02139, USA. */
19:
20: #include <ansidecl.h>
21: #ifdef __STDC__
22: #include <stddef.h>
23: #else
24: #define size_t unsigned long
25: #endif
26:
27: PTR
28: DEFUN(memset, (dest, val, len),
29: PTR dest AND register int val AND register size_t len)
30: {
31: register unsigned char *ptr = (unsigned char*)dest;
32: while (len-- > 0)
33: *ptr++ = val;
34: return dest;
35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.