diff --git a/src/core/mem.c b/src/core/mem.c index 43f48853..8f79a8d0 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -292,7 +292,7 @@ mem_malloc(mem_size_t size) } sys_sem_signal(mem_sem); LWIP_ASSERT("mem_malloc: allocated memory not above ram_end.", - (u32_t)mem + SIZEOF_STRUCT_MEM + size <= (u32_t)ram_end); + (mem_ptr_t)mem + SIZEOF_STRUCT_MEM + size <= (mem_ptr_t)ram_end); LWIP_ASSERT("mem_malloc: allocated memory properly aligned.", (unsigned long)((u8_t *)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0); return (u8_t *)mem + SIZEOF_STRUCT_MEM; diff --git a/src/core/memp.c b/src/core/memp.c index a68e7ca9..739bce43 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -217,7 +217,7 @@ memp_malloc(memp_t type) sys_sem_signal(mutex); #endif /* SYS_LIGHTWEIGHT_PROT */ LWIP_ASSERT("memp_malloc: memp properly aligned", - ((u32_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); + ((mem_ptr_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); mem = MEM_ALIGN((u8_t *)memp + sizeof(struct memp)); return mem; diff --git a/src/core/pbuf.c b/src/core/pbuf.c index f1718257..a04c617d 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -100,7 +100,7 @@ pbuf_init(void) u16_t i; pbuf_pool = (struct pbuf *)&pbuf_pool_memory[0]; - LWIP_ASSERT("pbuf_init: pool aligned", (long)pbuf_pool % MEM_ALIGNMENT == 0); + LWIP_ASSERT("pbuf_init: pool aligned", (mem_ptr_t)pbuf_pool % MEM_ALIGNMENT == 0); #if PBUF_STATS lwip_stats.pbuf.avail = PBUF_POOL_SIZE; @@ -254,7 +254,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) /* make the payload pointer point 'offset' bytes into pbuf data memory */ p->payload = MEM_ALIGN((void *)((u8_t *)p + (sizeof(struct pbuf) + offset))); LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned", - ((u32_t)p->payload % MEM_ALIGNMENT) == 0); + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); /* the total length of the pbuf chain is the requested size */ p->tot_len = length; /* set the length of the first pbuf in the chain */ @@ -290,7 +290,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) q->len = rem_len > PBUF_POOL_BUFSIZE? PBUF_POOL_BUFSIZE: rem_len; q->payload = (void *)((u8_t *)q + sizeof(struct pbuf)); LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned", - ((u32_t)q->payload % MEM_ALIGNMENT) == 0); + ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0); q->ref = 1; /* calculate remaining length to be allocated */ rem_len -= q->len; @@ -314,7 +314,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) p->flags = PBUF_FLAG_RAM; LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned", - ((u32_t)p->payload % MEM_ALIGNMENT) == 0); + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); break; /* pbuf references existing (static constant) ROM payload? */ case PBUF_ROM: