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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [libiberty/] [bcopy.c] - Blame information for rev 817

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

Line No. Rev Author Line
1 38 julius
/* 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
#include <stddef.h>
13
 
14
void
15
bcopy (const void *src, void *dest, size_t len)
16
{
17
  if (dest < src)
18
    {
19
      const char *firsts = (const char *) src;
20
      char *firstd = (char *) dest;
21
      while (len--)
22
        *firstd++ = *firsts++;
23
    }
24
  else
25
    {
26
      const char *lasts = (const char *)src + (len-1);
27
      char *lastd = (char *)dest + (len-1);
28
      while (len--)
29
        *lastd-- = *lasts--;
30
    }
31
}

powered by: WebSVN 2.1.0

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