diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2003-10-26 03:55:58 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2003-10-26 03:55:58 +0000 |
| commit | a3524212153b8b525b9a854c9d737e27f1419722 (patch) | |
| tree | 91f0b5d282a66d7aa63b47a08c605f642150eae3 /lib/libc/string/bcopy.c | |
| parent | 05bcd1d0988e7d3c1e445a850762969b0d6adfeb (diff) | |
Notes
Diffstat (limited to 'lib/libc/string/bcopy.c')
| -rw-r--r-- | lib/libc/string/bcopy.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index 8f8a8cf51ef9..0c2ec94fc43a 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -40,6 +40,8 @@ static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <sys/types.h> + /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -88,13 +90,13 @@ bcopy(const void *src0, void *dst0, size_t length) /* * Copy forward. */ - t = (int)src; /* only need low bits */ - if ((t | (int)dst) & wmask) { + t = (uintptr_t)src; /* only need low bits */ + if ((t | (uintptr_t)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ - if ((t ^ (int)dst) & wmask || length < wsize) + if ((t ^ (uintptr_t)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); @@ -116,9 +118,9 @@ bcopy(const void *src0, void *dst0, size_t length) */ src += length; dst += length; - t = (int)src; - if ((t | (int)dst) & wmask) { - if ((t ^ (int)dst) & wmask || length <= wsize) + t = (uintptr_t)src; + if ((t | (uintptr_t)dst) & wmask) { + if ((t ^ (uintptr_t)dst) & wmask || length <= wsize) t = length; else t &= wmask; |
