]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/bcopy.c
pex-common.c: New file.
[thirdparty/gcc.git] / libiberty / bcopy.c
CommitLineData
6599da04
JM
1/* bcopy -- copy memory regions of arbitary length
2
aaa5f039 3@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
6599da04 4
aaa5f039
DD
5Copies @var{length} bytes from memory region @var{in} to region
6@var{out}. The use of @code{bcopy} is deprecated in new programs.
6599da04 7
aaa5f039 8@end deftypefn
6599da04
JM
9
10*/
11
12void
9486db4f 13bcopy (register char *src, register char *dest, int len)
6599da04
JM
14{
15 if (dest < src)
16 while (len--)
17 *dest++ = *src++;
18 else
19 {
20 char *lasts = src + (len-1);
21 char *lastd = dest + (len-1);
22 while (len--)
23 *(char *)lastd-- = *(char *)lasts--;
24 }
25}