mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 17:13:49 +08:00
Minor changes in lwip folder: fix some warnings, coding style, and rename "internal" netconn_alloc function.
This commit is contained in:
@@ -71,7 +71,7 @@ netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
|
||||
struct netconn *conn;
|
||||
struct api_msg msg;
|
||||
|
||||
conn = netconn_alloc_with_proto_and_callback(t, proto, callback);
|
||||
conn = netconn_alloc(t, callback);
|
||||
if (conn != NULL ) {
|
||||
msg.function = do_newconn;
|
||||
msg.msg.msg.n.proto = proto;
|
||||
|
||||
@@ -338,7 +338,7 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
||||
|
||||
/* We have to set the callback here even though
|
||||
* the new socket is unknown. conn->socket is marked as -1. */
|
||||
newconn = netconn_alloc_with_proto_and_callback(conn->type, 0, conn->callback);
|
||||
newconn = netconn_alloc(conn->type, conn->callback);
|
||||
if (newconn == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
@@ -446,7 +446,7 @@ do_newconn(struct api_msg_msg *msg)
|
||||
* NULL on memory error
|
||||
*/
|
||||
struct netconn*
|
||||
netconn_alloc_with_proto_and_callback(enum netconn_type t, u8_t proto,
|
||||
netconn_alloc(enum netconn_type t,
|
||||
void (*callback)(struct netconn *, enum netconn_evt, u16_t len))
|
||||
{
|
||||
struct netconn *conn;
|
||||
@@ -469,7 +469,7 @@ netconn_alloc_with_proto_and_callback(enum netconn_type t, u8_t proto,
|
||||
memp_free(MEMP_NETCONN, conn);
|
||||
return NULL;
|
||||
}
|
||||
conn->acceptmbox = SYS_MBOX_NULL;
|
||||
conn->acceptmbox = SYS_MBOX_NULL;
|
||||
conn->state = NETCONN_NONE;
|
||||
/* initialize socket to -1 since 0 is a valid socket */
|
||||
conn->socket = -1;
|
||||
|
||||
@@ -269,7 +269,7 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
err_t err;
|
||||
struct ip_addr addr;
|
||||
struct addrinfo *ai;
|
||||
struct sockaddr_in *sa;
|
||||
struct sockaddr_in *sa = NULL;
|
||||
int port_nr = 0;
|
||||
|
||||
if (res == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user