Fixed unused variable warnings produced with the last commit

This commit is contained in:
goldsimon 2012-03-01 19:10:52 +01:00
parent 4fca628d36
commit c6605766e7
2 changed files with 8 additions and 5 deletions

View File

@ -329,7 +329,7 @@ netconn_accept(struct netconn *conn, struct netconn **new_conn)
/* Let the stack know that we have accepted the connection. */ /* Let the stack know that we have accepted the connection. */
msg.msg.conn = conn; msg.msg.conn = conn;
/* don't care for the return value of do_recv */ /* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg, do_recv, err); TCPIP_APIMSG_NOERR(&msg, do_recv);
#endif /* TCP_LISTEN_BACKLOG */ #endif /* TCP_LISTEN_BACKLOG */
*new_conn = newconn; *new_conn = newconn;
@ -400,7 +400,7 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
msg.msg.msg.r.len = 1; msg.msg.msg.r.len = 1;
} }
/* don't care for the return value of do_recv */ /* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg, do_recv, err); TCPIP_APIMSG_NOERR(&msg, do_recv);
} }
/* If we are closed, we indicate that we no longer wish to use the socket */ /* If we are closed, we indicate that we no longer wish to use the socket */
@ -532,14 +532,13 @@ netconn_recved(struct netconn *conn, u32_t length)
if ((conn != NULL) && (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) && if ((conn != NULL) && (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) &&
(netconn_get_noautorecved(conn))) { (netconn_get_noautorecved(conn))) {
struct api_msg msg; struct api_msg msg;
err_t err;
/* Let the stack know that we have taken the data. */ /* Let the stack know that we have taken the data. */
/* TODO: Speedup: Don't block and wait for the answer here /* TODO: Speedup: Don't block and wait for the answer here
(to prevent multiple thread-switches). */ (to prevent multiple thread-switches). */
msg.msg.conn = conn; msg.msg.conn = conn;
msg.msg.msg.r.len = length; msg.msg.msg.r.len = length;
/* don't care for the return value of do_recv */ /* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg, do_recv, err); TCPIP_APIMSG_NOERR(&msg, do_recv);
} }
#else /* LWIP_TCP */ #else /* LWIP_TCP */
LWIP_UNUSED_ARG(conn); LWIP_UNUSED_ARG(conn);

View File

@ -64,11 +64,14 @@ extern sys_mutex_t lock_tcpip_core;
#else #else
#define TCIP_APIMSG_SET_ERR(m, e) #define TCIP_APIMSG_SET_ERR(m, e)
#endif #endif
#define TCPIP_APIMSG(m,f,e) do { \ #define TCPIP_APIMSG_NOERR(m,f) do { \
TCIP_APIMSG_SET_ERR(m, ERR_VAL); \ TCIP_APIMSG_SET_ERR(m, ERR_VAL); \
LOCK_TCPIP_CORE(); \ LOCK_TCPIP_CORE(); \
f(&((m)->msg)); \ f(&((m)->msg)); \
UNLOCK_TCPIP_CORE(); \ UNLOCK_TCPIP_CORE(); \
} while(0)
#define TCPIP_APIMSG(m,f,e) do { \
TCPIP_APIMSG_NOERR(m,f); \
(e) = (m)->msg.err; \ (e) = (m)->msg.err; \
} while(0) } while(0)
#define TCPIP_APIMSG_ACK(m) #define TCPIP_APIMSG_ACK(m)
@ -77,6 +80,7 @@ extern sys_mutex_t lock_tcpip_core;
#else /* LWIP_TCPIP_CORE_LOCKING */ #else /* LWIP_TCPIP_CORE_LOCKING */
#define LOCK_TCPIP_CORE() #define LOCK_TCPIP_CORE()
#define UNLOCK_TCPIP_CORE() #define UNLOCK_TCPIP_CORE()
#define TCPIP_APIMSG_NOERR(m,f) do { (m)->function = f; tcpip_apimsg(m); } while(0)
#define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0) #define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0)
#define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed) #define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed)
#define TCPIP_NETIFAPI(m) tcpip_netifapi(m) #define TCPIP_NETIFAPI(m) tcpip_netifapi(m)