OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [gdb-5.3/] [libiberty/] [memset.c] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
/* memset
2
   This implementation is in the public domain.  */
3
 
4
/*
5
 
6
@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count})
7
 
8
Sets 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
 
15
#include <ansidecl.h>
16
#ifdef __STDC__
17
#include <stddef.h>
18
#else
19
#define size_t unsigned long
20
#endif
21
 
22
PTR
23
DEFUN(memset, (dest, val, len),
24
      PTR dest AND register int val AND register size_t len)
25
{
26
  register unsigned char *ptr = (unsigned char*)dest;
27
  while (len-- > 0)
28
    *ptr++ = val;
29
  return dest;
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.