From 69ed661a488c0e02bf5fee3dc21e6a31a99a8d85 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Oct 2015 00:58:39 +0200 Subject: fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/malloc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/malloc.c') diff --git a/src/malloc.c b/src/malloc.c index 6219fce..528c49f 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -18,9 +18,16 @@ #include #include #include -#include +/* TODO #include */ #include #include +/* TODO temporary constants from other headers { */ +#define PROT_READ 0 +#define PROT_WRITE 0 +#define MAP_PRIVATE 0 +#define MAP_ANONYMOUS 0 +#define _SC_PAGESIZE 0 +/* } */ @@ -203,7 +210,8 @@ void* memalign(size_t boundary, size_t size) size_t address; size_t shift = 0; - if (!boundary || (__builtin_ffsl(boundary) != boundary)) + if (!boundary || (__builtin_ffsl((long int)boundary) != boundary)) + /* `size_t` mat not be wider than `long int`. */ return errno = EINVAL, NULL; if (__builtin_uaddl_overflow(boundary - 1, size, &full_size)) return errno = ENOMEM, NULL; -- cgit v1.2.3-70-g09d2