aboutsummaryrefslogtreecommitdiff
path: root/libiberty/bcopy.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-04-03 04:41:10 +0000
committerDJ Delorie <dj@redhat.com>2005-04-03 04:41:10 +0000
commit14a88c496bef288d66f245d1d07c7bfa7f6062fb (patch)
treead4d2c6176db68eb7d06ff8fb67d55395c581e49 /libiberty/bcopy.c
parent26dae57f146e8b7d546a90c4317389281eb879e7 (diff)
downloadgdb-14a88c496bef288d66f245d1d07c7bfa7f6062fb.zip
gdb-14a88c496bef288d66f245d1d07c7bfa7f6062fb.tar.gz
gdb-14a88c496bef288d66f245d1d07c7bfa7f6062fb.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/bcopy.c')
-rw-r--r--libiberty/bcopy.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libiberty/bcopy.c b/libiberty/bcopy.c
index 0944247..1e2eca9 100644
--- a/libiberty/bcopy.c
+++ b/libiberty/bcopy.c
@@ -9,17 +9,23 @@ Copies @var{length} bytes from memory region @var{in} to region
*/
+#include <stddef.h>
+
void
-bcopy (register char *src, register char *dest, int len)
+bcopy (const void *src, void *dest, size_t len)
{
if (dest < src)
- while (len--)
- *dest++ = *src++;
+ {
+ const char *firsts = src;
+ char *firstd = dest;
+ while (len--)
+ *firstd++ = *firsts++;
+ }
else
{
- char *lasts = src + (len-1);
- char *lastd = dest + (len-1);
+ const char *lasts = (const char *)src + (len-1);
+ char *lastd = (char *)dest + (len-1);
while (len--)
- *(char *)lastd-- = *(char *)lasts--;
+ *lastd-- = *lasts--;
}
}