diff -u libaal-1.0.4.old/src/malloc.c libaal-1.0.4/src/malloc.c --- libaal-1.0.4.old/src/malloc.c 2004-09-22 14:27:23.000000000 +0200 +++ libaal-1.0.4/src/malloc.c 2005-04-04 20:52:24.957801102 +0200 @@ -2,7 +2,7 @@ libaal/COPYING. malloc.c -- hanlders for memory allocation functions. */ - +#include <stdint.h> #include <aal/libaal.h> /* Checking whether allone mode is in use. If so, initializes memory working @@ -105,8 +105,8 @@ s = chunk->len - size - sizeof(chunk_t); new = forw ? - (void *)((int)chunk + sizeof(chunk_t) + size) : - (void *)((int)chunk + sizeof(chunk_t) + s); + (void *)((intptr_t)chunk + sizeof(chunk_t) + size) : + (void *)((intptr_t)chunk + sizeof(chunk_t) + s); /* Okay, we have found chunk good enough. And now we split it onto two chunks. */ @@ -121,8 +121,8 @@ area_free -= (size + sizeof(chunk_t)); return forw ? - (void *)((int)chunk + sizeof(chunk_t)): - (void *)((int)new + sizeof(chunk_t)); + (void *)((intptr_t)chunk + sizeof(chunk_t)): + (void *)((intptr_t)new + sizeof(chunk_t)); } /* Makes search for proper memory chunk in list of chunks. If found, split it in @@ -157,7 +157,7 @@ } #define ptr2chunk(ptr) \ - ((chunk_t *)((int)ptr - sizeof(chunk_t))) + ((chunk_t *)((intptr_t)ptr - sizeof(chunk_t))) /* Frees passed memory pointer */ static void __chunk_free(void *ptr) { diff -u libaal-1.0.4.old/src/string.c libaal-1.0.4/src/string.c --- libaal-1.0.4.old/src/string.c 2005-02-08 17:51:59.000000000 +0100 +++ libaal-1.0.4/src/string.c 2005-04-04 20:59:29.715689578 +0200 @@ -3,6 +3,7 @@ string.c -- memory-working and string-working functions. */ +#include <stdint.h> #include <aal/libaal.h> #ifdef ENABLE_MINIMAL @@ -12,7 +13,7 @@ void *aal_memset(void *dest, int c, uint32_t n) { char *dest_p = (char *)dest; - for (; (int)dest_p - (int)dest < (int)n; dest_p++) + for (; (intptr_t)dest_p - (intptr_t)dest < (int)n; dest_p++) *dest_p = c; return dest; @@ -26,14 +27,14 @@ src_p = (char *)src; dest_p = (char *)dest; - for (; (int)src_p - (int)src < (int)n; src_p++, dest_p++) + for (; (intptr_t)src_p - (intptr_t)src < (int)n; src_p++, dest_p++) *dest_p = *src_p; } else { src_p = (char *)src + n - 1; dest_p = (char *)dest + n - 1; - for (; (int)src_p - (int)src >= 0; src_p--, dest_p--) + for (; (intptr_t)src_p - (intptr_t)src >= 0; src_p--, dest_p--) *dest_p = *src_p; } @@ -48,7 +49,7 @@ const char *p_s1 = (const char *)s1; const char *p_s2 = (const char *)s2; - for (; (uint32_t)(p_s1 - (int)s1) < n; p_s1++, p_s2++) { + for (; (uint32_t)((intptr_t)p_s1 - (intptr_t)s1) < n; p_s1++, p_s2++) { if (*p_s1 < *p_s2) return -1;