Fix a few incorrect uses of err_t. Found by converting lwip error codes to an enum, but I'm not sure wether I want to commit the actual enum conversion.

This commit is contained in:
Dirk Ziegelmeier 2016-08-08 22:15:01 +02:00
parent e5284ec616
commit 85ab39985a
4 changed files with 11 additions and 10 deletions

View File

@ -405,6 +405,7 @@ lwiperf_tx_start(lwiperf_state_tcp_t* conn)
static err_t static err_t
lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
{ {
u8_t tmp;
u16_t tot_len; u16_t tot_len;
u32_t packet_idx; u32_t packet_idx;
struct pbuf* q; struct pbuf* q;
@ -470,8 +471,8 @@ lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
return ERR_OK; return ERR_OK;
} }
conn->next_num = 4; /* 24 bytes received... */ conn->next_num = 4; /* 24 bytes received... */
err = pbuf_header(p, -24); tmp = pbuf_header(p, -24);
LWIP_ASSERT("pbuf_header failed", err == ERR_OK); LWIP_ASSERT("pbuf_header failed", tmp == 0);
} }
packet_idx = 0; packet_idx = 0;

View File

@ -94,7 +94,7 @@
#define SNTP_DEBUG_WARN_STATE (SNTP_DEBUG | LWIP_DBG_LEVEL_WARNING | LWIP_DBG_STATE) #define SNTP_DEBUG_WARN_STATE (SNTP_DEBUG | LWIP_DBG_LEVEL_WARNING | LWIP_DBG_STATE)
#define SNTP_DEBUG_SERIOUS (SNTP_DEBUG | LWIP_DBG_LEVEL_SERIOUS) #define SNTP_DEBUG_SERIOUS (SNTP_DEBUG | LWIP_DBG_LEVEL_SERIOUS)
#define SNTP_ERR_KOD 1 #define SNTP_ERR_KOD ERR_CLSD
/* SNTP protocol defines */ /* SNTP protocol defines */
#define SNTP_MSG_LEN 48 #define SNTP_MSG_LEN 48

View File

@ -377,8 +377,8 @@ ip6_reass(struct pbuf *p)
if (IPV6_FRAG_REQROOM > 0) { if (IPV6_FRAG_REQROOM > 0) {
/* Make room for struct ip6_reass_helper (only required if sizeof(void*) > 4). /* Make room for struct ip6_reass_helper (only required if sizeof(void*) > 4).
This cannot fail since we already checked when receiving this fragment. */ This cannot fail since we already checked when receiving this fragment. */
err_t hdrerr = pbuf_header_force(p, IPV6_FRAG_REQROOM); u8_t hdrerr = pbuf_header_force(p, IPV6_FRAG_REQROOM);
LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == ERR_OK); LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0);
} }
#else /* IPV6_FRAG_COPYHEADER */ #else /* IPV6_FRAG_COPYHEADER */
LWIP_ASSERT("sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN, set IPV6_FRAG_COPYHEADER to 1", LWIP_ASSERT("sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN, set IPV6_FRAG_COPYHEADER to 1",
@ -528,8 +528,8 @@ ip6_reass(struct pbuf *p)
#if IPV6_FRAG_COPYHEADER #if IPV6_FRAG_COPYHEADER
if (IPV6_FRAG_REQROOM > 0) { if (IPV6_FRAG_REQROOM > 0) {
/* hide the extra bytes borrowed from ip6_hdr for struct ip6_reass_helper */ /* hide the extra bytes borrowed from ip6_hdr for struct ip6_reass_helper */
err_t hdrerr = pbuf_header(next_pbuf, -(s16_t)(IPV6_FRAG_REQROOM)); u8_t hdrerr = pbuf_header(next_pbuf, -(s16_t)(IPV6_FRAG_REQROOM));
LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == ERR_OK); LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0);
} }
#endif #endif
pbuf_cat(ipr->p, next_pbuf); pbuf_cat(ipr->p, next_pbuf);
@ -544,8 +544,8 @@ ip6_reass(struct pbuf *p)
#if IPV6_FRAG_COPYHEADER #if IPV6_FRAG_COPYHEADER
if (IPV6_FRAG_REQROOM > 0) { if (IPV6_FRAG_REQROOM > 0) {
/* get back room for struct ip6_reass_helper (only required if sizeof(void*) > 4) */ /* get back room for struct ip6_reass_helper (only required if sizeof(void*) > 4) */
err_t hdrerr = pbuf_header(ipr->p, -(s16_t)(IPV6_FRAG_REQROOM)); u8_t hdrerr = pbuf_header(ipr->p, -(s16_t)(IPV6_FRAG_REQROOM));
LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == ERR_OK); LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0);
} }
iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->p->payload - IP6_HLEN); iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->p->payload - IP6_HLEN);
MEMCPY(iphdr_ptr, &ipr->iphdr, IP6_HLEN); MEMCPY(iphdr_ptr, &ipr->iphdr, IP6_HLEN);

View File

@ -881,7 +881,7 @@ pppoe_timeout(void *arg)
static err_t static err_t
pppoe_connect(ppp_pcb *ppp, void *ctx) pppoe_connect(ppp_pcb *ppp, void *ctx)
{ {
int err; err_t err;
struct pppoe_softc *sc = (struct pppoe_softc *)ctx; struct pppoe_softc *sc = (struct pppoe_softc *)ctx;
lcp_options *lcp_wo; lcp_options *lcp_wo;
lcp_options *lcp_ao; lcp_options *lcp_ao;