summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-08-16 01:21:52 +0000
committerbde <bde@FreeBSD.org>1998-08-16 01:21:52 +0000
commit9e27b29fba08158ea646560dc2c0f671e17923cf (patch)
treeca50bac0920c7e526393546681e1b22c87541004 /sys/kern/kern_malloc.c
parente14b44bbf30df0b2ba5a4750b2c2806bcae489eb (diff)
downloadFreeBSD-src-9e27b29fba08158ea646560dc2c0f671e17923cf.zip
FreeBSD-src-9e27b29fba08158ea646560dc2c0f671e17923cf.tar.gz
Use [u]intptr_t instead of [u_]long for casts between pointers and
integers. Don't forget to cast to (void *) as well.
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index c7a25d9..618b726 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.45 1998/03/08 09:56:49 julian Exp $
+ * $Id: kern_malloc.c,v 1.46 1998/07/29 17:38:14 bde Exp $
*/
#include "opt_vm.h"
@@ -205,7 +205,7 @@ malloc(size, type, flags)
#if BYTE_ORDER == LITTLE_ENDIAN
freep->type = (struct malloc_type *)WEIRD_ADDR;
#endif
- if (((long)(&freep->next)) & 0x2)
+ if ((intptr_t)(void *)&freep->next & 0x2)
freep->next = (caddr_t)((WEIRD_ADDR >> 16)|(WEIRD_ADDR << 16));
else
freep->next = (caddr_t)WEIRD_ADDR;
@@ -279,7 +279,7 @@ free(addr, type)
alloc = addrmask[BUCKETINDX(PAGE_SIZE)];
else
alloc = addrmask[kup->ku_indx];
- if (((u_long)addr & alloc) != 0)
+ if (((uintptr_t)(void *)addr & alloc) != 0)
panic("free: unaligned addr %p, size %ld, type %s, mask %ld",
(void *)addr, size, type->ks_shortdesc, alloc);
#endif /* DIAGNOSTIC */
OpenPOWER on IntegriCloud