Fix compiling with LWIP_NOASSERT defined

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2018-06-24 18:18:35 +08:00
parent d80e84864e
commit a56e61c942
2 changed files with 6 additions and 1 deletions

View File

@ -152,6 +152,7 @@ static err_t
altcp_mbedtls_lower_connected(void *arg, struct altcp_pcb *inner_conn, err_t err)
{
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
if (conn && conn->state) {
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
/* upper connected is called when handshake is done */
@ -437,6 +438,7 @@ altcp_mbedtls_bio_recv(void *ctx, unsigned char *buf, size_t len)
u16_t copy_len;
err_t err;
LWIP_UNUSED_ARG(err); /* for LWIP_NOASSERT */
if ((conn == NULL) || (conn->state == NULL)) {
return MBEDTLS_ERR_NET_INVALID_CONTEXT;
}
@ -484,6 +486,7 @@ static err_t
altcp_mbedtls_lower_sent(void *arg, struct altcp_pcb *inner_conn, u16_t len)
{
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
LWIP_UNUSED_ARG(len);
if (conn) {
altcp_mbedtls_state_t *state = (altcp_mbedtls_state_t *)conn->state;
@ -510,6 +513,7 @@ static err_t
altcp_mbedtls_lower_poll(void *arg, struct altcp_pcb *inner_conn)
{
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
if (conn) {
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
/* check if there's unreceived rx data */

View File

@ -536,6 +536,7 @@ static u8_t *get_file_data(const char *filename, int *file_size, int can_be_comp
u8_t *buf;
size_t r;
int rs;
LWIP_UNUSED_ARG(r); /* for LWIP_NOASSERT */
inFile = fopen(filename, "rb");
if (inFile == NULL) {
printf("Failed to open file \"%s\"\n", filename);
@ -629,8 +630,8 @@ static u8_t *get_file_data(const char *filename, int *file_size, int can_be_comp
static void process_file_data(FILE *data_file, u8_t *file_data, size_t file_size)
{
size_t written, i, src_off = 0;
size_t off = 0;
LWIP_UNUSED_ARG(written); /* for LWIP_NOASSERT */
for (i = 0; i < file_size; i++) {
LWIP_ASSERT("file_buffer_c overflow", off < sizeof(file_buffer_c) - 5);
sprintf(&file_buffer_c[off], "0x%02x,", file_data[i]);