From cb29a24d260607a76677a4763c1bd66820daed06 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 26 Oct 2003 03:55:58 +0000 Subject: Pacify gcc about casting pointers to integers (for the lowest few bits). --- lib/libc/string/bcopy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/libc/string/bcopy.c') 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 __FBSDID("$FreeBSD$"); +#include + /* * 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; -- cgit v1.1