summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1994-10-19 03:07:18 +0000
committercgd <cgd@NetBSD.org>1994-10-19 03:07:18 +0000
commitd2b0e8d86d349530c12682da89fc6a65ab26f7fb (patch)
tree6ec4e30d6d6e22ceef3de38610662b58ea54018f /lib/libc/string
parentce7850d53d1b1e6ea97dbf714347c8ad137ca0f5 (diff)
be a bit more careful with types.
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/bcopy.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c
index ce0cc2dc4a5..e1f708b6cf7 100644
--- a/lib/libc/string/bcopy.c
+++ b/lib/libc/string/bcopy.c
@@ -36,7 +36,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)bcopy.c 5.11 (Berkeley) 6/21/91";*/
-static char *rcsid = "$Id: bcopy.c,v 1.3 1993/08/26 00:51:36 jtc Exp $";
+static char *rcsid = "$Id: bcopy.c,v 1.4 1994/10/19 03:08:23 cgd Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
@@ -46,7 +46,7 @@ static char *rcsid = "$Id: bcopy.c,v 1.3 1993/08/26 00:51:36 jtc Exp $";
* sizeof(word) MUST BE A POWER OF TWO
* SO THAT wmask BELOW IS ALL ONES
*/
-typedef int word; /* "word" used for optimal copy speed */
+typedef long word; /* "word" used for optimal copy speed */
#define wsize sizeof(word)
#define wmask (wsize - 1)
@@ -89,13 +89,13 @@ bcopy(src0, dst0, length)
/*
* Copy forward.
*/
- t = (int)src; /* only need low bits */
- if ((t | (int)dst) & wmask) {
+ t = (long)src; /* only need low bits */
+ if ((t | (long)dst) & wmask) {
/*
* Try to align operands. This cannot be done
* unless the low bits match.
*/
- if ((t ^ (int)dst) & wmask || length < wsize)
+ if ((t ^ (long)dst) & wmask || length < wsize)
t = length;
else
t = wsize - (t & wmask);
@@ -117,9 +117,9 @@ bcopy(src0, dst0, length)
*/
src += length;
dst += length;
- t = (int)src;
- if ((t | (int)dst) & wmask) {
- if ((t ^ (int)dst) & wmask || length <= wsize)
+ t = (long)src;
+ if ((t | (long)dst) & wmask) {
+ if ((t ^ (long)dst) & wmask || length <= wsize)
t = length;
else
t &= wmask;