summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/mempcpy.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2010-09-22 03:15:07 +0000
committerJeff Johnston <jjohnstn@redhat.com>2010-09-22 03:15:07 +0000
commit60376287eb7a9ca1118b6a0cb30fe749beda7f48 (patch)
treee7a7d70f6e1253b9eaf5d51f2a487f910f7b60bf /newlib/libc/string/mempcpy.c
parent5c22068f7f118a76430365d89433ab8bd392343d (diff)
downloadcygnal-60376287eb7a9ca1118b6a0cb30fe749beda7f48.tar.gz
cygnal-60376287eb7a9ca1118b6a0cb30fe749beda7f48.tar.bz2
cygnal-60376287eb7a9ca1118b6a0cb30fe749beda7f48.zip
2010-09-21 Craig Howland <howland@LGSInnovations.com>
* libc/string/memcpy.c: Do not assign size_t parameter to int. Use parameter directly, instead. * libc/string/memccpy.c: Likewise. * libc/string/mempcpy.c: Likewise. * libc/string/memmove.c: Likewise.
Diffstat (limited to 'newlib/libc/string/mempcpy.c')
-rw-r--r--newlib/libc/string/mempcpy.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/newlib/libc/string/mempcpy.c b/newlib/libc/string/mempcpy.c
index 284cbea79..5c6738f22 100644
--- a/newlib/libc/string/mempcpy.c
+++ b/newlib/libc/string/mempcpy.c
@@ -69,30 +69,29 @@ _DEFUN (mempcpy, (dst0, src0, len0),
_CONST char *src = src0;
long *aligned_dst;
_CONST long *aligned_src;
- int len = len0;
/* If the size is small, or either SRC or DST is unaligned,
then punt into the byte copy loop. This should be rare. */
- if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
+ if (!TOO_SMALL(len0) && !UNALIGNED (src, dst))
{
aligned_dst = (long*)dst;
aligned_src = (long*)src;
/* Copy 4X long words at a time if possible. */
- while (len >= BIGBLOCKSIZE)
+ while (len0 >= BIGBLOCKSIZE)
{
*aligned_dst++ = *aligned_src++;
*aligned_dst++ = *aligned_src++;
*aligned_dst++ = *aligned_src++;
*aligned_dst++ = *aligned_src++;
- len -= BIGBLOCKSIZE;
+ len0 -= BIGBLOCKSIZE;
}
/* Copy one long word at a time if possible. */
- while (len >= LITTLEBLOCKSIZE)
+ while (len0 >= LITTLEBLOCKSIZE)
{
*aligned_dst++ = *aligned_src++;
- len -= LITTLEBLOCKSIZE;
+ len0 -= LITTLEBLOCKSIZE;
}
/* Pick up any residual with a byte copier. */
@@ -100,7 +99,7 @@ _DEFUN (mempcpy, (dst0, src0, len0),
src = (char*)aligned_src;
}
- while (len--)
+ while (len0--)
*dst++ = *src++;
return dst;