Correctly cast pointers when assigning from void*

This commit is contained in:
goldsimon 2010-03-26 14:05:56 +00:00
parent 25f59761b3
commit 8bbe3d2fe0
2 changed files with 5 additions and 5 deletions

View File

@ -393,7 +393,7 @@ ip_input(struct pbuf *p, struct netif *inp)
if (p == NULL) {
return ERR_OK;
}
iphdr = p->payload;
iphdr = (struct ip_hdr *)p->payload;
#else /* IP_REASSEMBLY == 0, no packet fragment reassembly code present */
pbuf_free(p);
LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("IP packet dropped since it was fragmented (0x%"X16_F") (while IP_REASSEMBLY == 0).\n",
@ -721,7 +721,7 @@ ip_output_hinted(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
void
ip_debug_print(struct pbuf *p)
{
struct ip_hdr *iphdr = p->payload;
struct ip_hdr *iphdr = (struct ip_hdr *)p->payload;
u8_t *payload;
payload = (u8_t *)iphdr + IP_HLEN;

View File

@ -267,11 +267,11 @@ ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen)
{
struct ip_reassdata* ipr;
/* No matching previous fragment found, allocate a new reassdata struct */
ipr = memp_malloc(MEMP_REASSDATA);
ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
if (ipr == NULL) {
#if IP_REASS_FREE_OLDEST
if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
ipr = memp_malloc(MEMP_REASSDATA);
ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
}
if (ipr == NULL)
#endif /* IP_REASS_FREE_OLDEST */
@ -666,7 +666,7 @@ ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
rambuf->payload = LWIP_MEM_ALIGN((void *)buf);
/* Copy the IP header in it */
iphdr = rambuf->payload;
iphdr = (struct ip_hdr *)rambuf->payload;
SMEMCPY(iphdr, p->payload, IP_HLEN);
#else /* IP_FRAG_USES_STATIC_BUF */
original_iphdr = p->payload;