mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 06:35:57 +00:00
Removed old debug variables from pbuf_copy()
This commit is contained in:
parent
bf176ed712
commit
8d2c8065eb
|
@ -686,18 +686,12 @@ err_t
|
||||||
pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
|
pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
|
||||||
{
|
{
|
||||||
u16_t offset_to=0, offset_from=0, len;
|
u16_t offset_to=0, offset_from=0, len;
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
u16_t copied=0, shouldbe;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_copy(%p, %p)\n", p_to, p_from));
|
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_copy(%p, %p)\n", p_to, p_from));
|
||||||
|
|
||||||
/* is the target big enough to hold the source? */
|
/* is the target big enough to hold the source? */
|
||||||
LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
|
LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
|
||||||
(p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
|
(p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
shouldbe = p_from->tot_len;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* iterate through pbuf chain */
|
/* iterate through pbuf chain */
|
||||||
do
|
do
|
||||||
|
@ -712,9 +706,6 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
|
||||||
len = p_to->len - offset_to;
|
len = p_to->len - offset_to;
|
||||||
}
|
}
|
||||||
MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
|
MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
copied += len;
|
|
||||||
#endif
|
|
||||||
offset_to += len;
|
offset_to += len;
|
||||||
offset_from += len;
|
offset_from += len;
|
||||||
LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
|
LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
|
||||||
|
@ -742,8 +733,5 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
|
||||||
}
|
}
|
||||||
} while (p_from);
|
} while (p_from);
|
||||||
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 1, ("pbuf_copy: end of chain reached.\n"));
|
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 1, ("pbuf_copy: end of chain reached.\n"));
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
LWIP_ASSERT("shouldbe == copied", shouldbe == copied);
|
|
||||||
#endif
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user