fix compiling with LWIP_NOASSERT defined

See bug #54157
This commit is contained in:
Simon Goldschmidt 2018-06-20 20:56:20 +02:00
parent 824ebbe0e9
commit 9992b48e90
6 changed files with 12 additions and 1 deletions

View File

@ -300,6 +300,7 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
LWIP_ASSERT("recv_tcp must have a pcb argument", pcb != NULL);
LWIP_ASSERT("recv_tcp must have an argument", arg != NULL);
LWIP_ASSERT("err != ERR_OK unhandled", err == ERR_OK);
LWIP_UNUSED_ARG(err); /* for LWIP_NOASSERT */
conn = (struct netconn *)arg;
if (conn == NULL) {

View File

@ -161,6 +161,7 @@ altcp_proxyconnect_lower_connected(void *arg, struct altcp_pcb *inner_conn, err_
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
if (conn && conn->state) {
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
/* upper connected is called when handshake is done */
if (err != ERR_OK) {
if (conn->connected) {
@ -252,6 +253,7 @@ altcp_proxyconnect_lower_sent(void *arg, struct altcp_pcb *inner_conn, u16_t len
if (conn) {
altcp_proxyconnect_state_t *state = (altcp_proxyconnect_state_t *)conn->state;
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
if (!state || !(state->flags & ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE)) {
/* @todo: do something here? */
return ERR_OK;
@ -274,6 +276,7 @@ altcp_proxyconnect_lower_poll(void *arg, struct altcp_pcb *inner_conn)
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
if (conn) {
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
if (conn->poll) {
return conn->poll(conn->arg, conn);
}

View File

@ -522,6 +522,7 @@ lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
conn->next_num = 4; /* 24 bytes received... */
tmp = pbuf_remove_header(p, 24);
LWIP_ASSERT("pbuf_remove_header failed", tmp == 0);
LWIP_UNUSED_ARG(tmp); /* for LWIP_NOASSERT */
}
packet_idx = 0;

View File

@ -53,9 +53,12 @@
#include <string.h>
#define ALTCP_TCP_ASSERT_CONN(conn) LWIP_ASSERT("conn->inner_conn == NULL", (conn)->inner_conn == NULL)
#define ALTCP_TCP_ASSERT_CONN(conn) do { \
LWIP_ASSERT("conn->inner_conn == NULL", (conn)->inner_conn == NULL); \
LWIP_UNUSED_ARG(conn); /* for LWIP_NOASSERT */ } while(0)
#define ALTCP_TCP_ASSERT_CONN_PCB(conn, tpcb) do { \
LWIP_ASSERT("pcb mismatch", (conn)->state == tpcb); \
LWIP_UNUSED_ARG(tpcb); /* for LWIP_NOASSERT */ \
ALTCP_TCP_ASSERT_CONN(conn); } while(0)

View File

@ -1907,6 +1907,8 @@ tcp_output_fill_options(const struct tcp_pcb *pcb, struct pbuf *p, u8_t optflags
LWIP_UNUSED_ARG(pcb);
LWIP_UNUSED_ARG(sacks_len);
LWIP_ASSERT("options not filled", (u8_t *)opts == ((u8_t *)(tcphdr + 1)) + sacks_len * 4 + LWIP_TCP_OPT_LENGTH_SEGMENT(optflags, pcb));
LWIP_UNUSED_ARG(optflags); /* for LWIP_NOASSERT */
LWIP_UNUSED_ARG(opts); /* for LWIP_NOASSERT */
}
/** Output a control segment pbuf to IP.

View File

@ -114,6 +114,7 @@ zepif_udp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p,
LWIP_ASSERT("arg != NULL", arg != NULL);
LWIP_ASSERT("pcb != NULL", pcb != NULL);
LWIP_UNUSED_ARG(pcb); /* for LWIP_NOASSERT */
LWIP_UNUSED_ARG(addr);
LWIP_UNUSED_ARG(port);
if (p == NULL) {