summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-10-26 03:55:58 +0000
committerpeter <peter@FreeBSD.org>2003-10-26 03:55:58 +0000
commitcb29a24d260607a76677a4763c1bd66820daed06 (patch)
tree91f0b5d282a66d7aa63b47a08c605f642150eae3 /lib
parent79a9b01a78a1dda298745096596faded78c542a9 (diff)
downloadFreeBSD-src-cb29a24d260607a76677a4763c1bd66820daed06.zip
FreeBSD-src-cb29a24d260607a76677a4763c1bd66820daed06.tar.gz
Pacify gcc about casting pointers to integers (for the lowest few bits).
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/string/bcopy.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c
index 8f8a8cf..0c2ec94 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;
OpenPOWER on IntegriCloud