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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [libiberty/] [memset.c] - Blame information for rev 196

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

Line No. Rev Author Line
1 21 khays
/* memset
2
   This implementation is in the public domain.  */
3
 
4
/*
5
 
6
@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
7
  size_t @var{count})
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
}

powered by: WebSVN 2.1.0

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