diff options
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/tst-obstack.c | 2 | ||||
-rw-r--r-- | malloc/tst-valloc.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/malloc/tst-obstack.c b/malloc/tst-obstack.c index cd19431..769697f 100644 --- a/malloc/tst-obstack.c +++ b/malloc/tst-obstack.c @@ -14,7 +14,7 @@ static void * verbose_malloc (size_t size) { void *buf = malloc (size); - printf ("malloc (%u) => %p\n", size, buf); + printf ("malloc (%zu) => %p\n", size, buf); return buf; } diff --git a/malloc/tst-valloc.c b/malloc/tst-valloc.c index 7958d51..643a0dd 100644 --- a/malloc/tst-valloc.c +++ b/malloc/tst-valloc.c @@ -3,19 +3,21 @@ #include <stdio.h> #include <stdlib.h> -int main(void) +int +main (void) { char *p; int pagesize = getpagesize (); int i; p = valloc (pagesize); - i = (int) p; + i = (long int) p; - if ((i & (pagesize-1)) != 0) { - fprintf (stderr, "Alignment problem: valloc returns %p\n", p); - exit(1); - } + if ((i & (pagesize-1)) != 0) + { + fprintf (stderr, "Alignment problem: valloc returns %p\n", p); + exit (1); + } return 0; } |