summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorotto <>2011-04-30 15:46:46 +0000
committerotto <>2011-04-30 15:46:46 +0000
commit695926aaa04b7001b939cc859c10383e7e6d5e42 (patch)
tree1162bedafe245481d3e0b055ba17db95707cd490 /src
parent9d3549427fb1b5b7e4751c18927defcca9b4e9c5 (diff)
downloadopenbsd-695926aaa04b7001b939cc859c10383e7e6d5e42.tar.gz
openbsd-695926aaa04b7001b939cc859c10383e7e6d5e42.tar.bz2
openbsd-695926aaa04b7001b939cc859c10383e7e6d5e42.zip
Now that we use an array of u_short for the chunk bitmap change a few
1UL to 1U.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/malloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index 010cb7fafc..84ca2be718 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: malloc.c,v 1.128 2011/04/30 14:56:20 otto Exp $ */ 1/* $OpenBSD: malloc.c,v 1.129 2011/04/30 15:46:46 otto Exp $ */
2/* 2/*
3 * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> 3 * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
4 * 4 *
@@ -946,7 +946,7 @@ omalloc_make_chunks(struct dir_info *d, int bits)
946 return NULL; 946 return NULL;
947 } 947 }
948 } else { 948 } else {
949 bp->size = (1UL << bits); 949 bp->size = 1U << bits;
950 bp->shift = bits; 950 bp->shift = bits;
951 bp->total = bp->free = MALLOC_PAGESIZE >> bits; 951 bp->total = bp->free = MALLOC_PAGESIZE >> bits;
952 bp->page = pp; 952 bp->page = pp;
@@ -1081,16 +1081,16 @@ free_bytes(struct dir_info *d, struct region_info *r, void *ptr)
1081 /* Find the chunk number on the page */ 1081 /* Find the chunk number on the page */
1082 i = ((uintptr_t)ptr & MALLOC_PAGEMASK) >> info->shift; 1082 i = ((uintptr_t)ptr & MALLOC_PAGEMASK) >> info->shift;
1083 1083
1084 if ((uintptr_t)ptr & ((1UL << (info->shift)) - 1)) { 1084 if ((uintptr_t)ptr & ((1U << (info->shift)) - 1)) {
1085 wrterror("modified chunk-pointer", ptr); 1085 wrterror("modified chunk-pointer", ptr);
1086 return; 1086 return;
1087 } 1087 }
1088 if (info->bits[i / MALLOC_BITS] & (1UL << (i % MALLOC_BITS))) { 1088 if (info->bits[i / MALLOC_BITS] & (1U << (i % MALLOC_BITS))) {
1089 wrterror("chunk is already free", ptr); 1089 wrterror("chunk is already free", ptr);
1090 return; 1090 return;
1091 } 1091 }
1092 1092
1093 info->bits[i / MALLOC_BITS] |= 1UL << (i % MALLOC_BITS); 1093 info->bits[i / MALLOC_BITS] |= 1U << (i % MALLOC_BITS);
1094 info->free++; 1094 info->free++;
1095 1095
1096 if (info->size != 0) 1096 if (info->size != 0)