From fe5a32734ee65862bd30b9c8f477c243ea35c666 Mon Sep 17 00:00:00 2001 From: otto <> Date: Sat, 30 Apr 2011 15:46:46 +0000 Subject: [PATCH] Now that we use an array of u_short for the chunk bitmap change a few 1UL to 1U. --- src/lib/libc/stdlib/malloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 010cb7fa..84ca2be7 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.128 2011/04/30 14:56:20 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.129 2011/04/30 15:46:46 otto Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek * @@ -946,7 +946,7 @@ omalloc_make_chunks(struct dir_info *d, int bits) return NULL; } } else { - bp->size = (1UL << bits); + bp->size = 1U << bits; bp->shift = bits; bp->total = bp->free = MALLOC_PAGESIZE >> bits; bp->page = pp; @@ -1081,16 +1081,16 @@ free_bytes(struct dir_info *d, struct region_info *r, void *ptr) /* Find the chunk number on the page */ i = ((uintptr_t)ptr & MALLOC_PAGEMASK) >> info->shift; - if ((uintptr_t)ptr & ((1UL << (info->shift)) - 1)) { + if ((uintptr_t)ptr & ((1U << (info->shift)) - 1)) { wrterror("modified chunk-pointer", ptr); return; } - if (info->bits[i / MALLOC_BITS] & (1UL << (i % MALLOC_BITS))) { + if (info->bits[i / MALLOC_BITS] & (1U << (i % MALLOC_BITS))) { wrterror("chunk is already free", ptr); return; } - info->bits[i / MALLOC_BITS] |= 1UL << (i % MALLOC_BITS); + info->bits[i / MALLOC_BITS] |= 1U << (i % MALLOC_BITS); info->free++; if (info->size != 0)