--- mem_align.c 2002/06/13 22:05:09 1.7 +++ mem_align.c 2003/02/15 15:22:19 1.15 @@ -33,7 +33,7 @@ * * - Thu Jun 13 23:50:07 2002 Added legal header * - * $Id: mem_align.c,v 1.7 2002/06/13 22:05:09 edgomez Exp $ + * $Id: mem_align.c,v 1.15 2003/02/15 15:22:19 edgomez Exp $ * ****************************************************************************/ @@ -71,7 +71,7 @@ if ((mem_ptr = (uint8_t *) malloc(size + 1)) != NULL) { /* Store (mem_ptr - "real allocated memory") in *(mem_ptr-1) */ - *mem_ptr = 0; + *mem_ptr = 1; /* Return the mem_ptr pointer */ return (void *) mem_ptr++; @@ -90,8 +90,8 @@ /* Align the tmp pointer */ mem_ptr = - (uint8_t *) ((uint32_t) (tmp + alignment - 1) & - (~(uint32_t) (alignment - 1))); + (uint8_t *) ((ptr_t) (tmp + alignment - 1) & + (~(ptr_t) (alignment - 1))); /* * Special case where malloc have already satisfied the alignment