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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [libiberty/] [bcopy.c] - Blame information for rev 1767

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

Line No. Rev Author Line
1 1181 sfurman
/* bcopy -- copy memory regions of arbitary length
2
 
3
@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
4
 
5
Copies @var{length} bytes from memory region @var{in} to region
6
@var{out}.  The use of @code{bcopy} is deprecated in new programs.
7
 
8
@end deftypefn
9
 
10
*/
11
 
12
void
13
bcopy (src, dest, len)
14
  register char *src, *dest;
15
  int len;
16
{
17
  if (dest < src)
18
    while (len--)
19
      *dest++ = *src++;
20
  else
21
    {
22
      char *lasts = src + (len-1);
23
      char *lastd = dest + (len-1);
24
      while (len--)
25
        *(char *)lastd-- = *(char *)lasts--;
26
    }
27
}

powered by: WebSVN 2.1.0

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