mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 08:43:17 +00:00
Use NULL instead of 0 as a pointer
Recommended by 'sparse' tool
This commit is contained in:
parent
f3300731be
commit
089697bb1c
@ -73,7 +73,7 @@ struct charcb {
|
|||||||
char nextchar;
|
char nextchar;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct charcb *charcb_list = 0;
|
static struct charcb *charcb_list = NULL;
|
||||||
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
* void close_chargen(struct charcb *p_charcb)
|
* void close_chargen(struct charcb *p_charcb)
|
||||||
@ -190,7 +190,7 @@ chargen_thread(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for data or a new connection */
|
/* Wait for data or a new connection */
|
||||||
i = lwip_select(maxfdp1, &readset, &writeset, 0, 0);
|
i = lwip_select(maxfdp1, &readset, &writeset, NULL, NULL);
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -268,7 +268,7 @@ chargen_thread(void *arg)
|
|||||||
void
|
void
|
||||||
chargen_init(void)
|
chargen_init(void)
|
||||||
{
|
{
|
||||||
sys_thread_new(CHARGEN_THREAD_NAME, chargen_thread, 0, CHARGEN_THREAD_STACKSIZE, CHARGEN_PRIORITY);
|
sys_thread_new(CHARGEN_THREAD_NAME, chargen_thread, NULL, CHARGEN_THREAD_STACKSIZE, CHARGEN_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LWIP_SOCKET && LWIP_SOCKET_SELECT */
|
#endif /* LWIP_SOCKET && LWIP_SOCKET_SELECT */
|
||||||
|
@ -610,7 +610,7 @@ test_init(void * arg)
|
|||||||
#endif /* NO_SYS */
|
#endif /* NO_SYS */
|
||||||
|
|
||||||
/* init randomizer again (seed per thread) */
|
/* init randomizer again (seed per thread) */
|
||||||
srand((unsigned int)time(0));
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
/* init network interfaces */
|
/* init network interfaces */
|
||||||
test_netif_init();
|
test_netif_init();
|
||||||
|
@ -2115,7 +2115,7 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
|||||||
set_errno(EBADF);
|
set_errno(EBADF);
|
||||||
} else if (!nready) {
|
} else if (!nready) {
|
||||||
/* Still none ready, just wait to be woken */
|
/* Still none ready, just wait to be woken */
|
||||||
if (timeout == 0) {
|
if (timeout == NULL) {
|
||||||
/* Wait forever */
|
/* Wait forever */
|
||||||
msectimeout = 0;
|
msectimeout = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2079,7 +2079,7 @@ http_parse_request(struct pbuf *inp, struct http_state *hs, struct altcp_pcb *pc
|
|||||||
}
|
}
|
||||||
#endif /* LWIP_HTTPD_SUPPORT_V09 */
|
#endif /* LWIP_HTTPD_SUPPORT_V09 */
|
||||||
uri_len = (u16_t)(sp2 - (sp1 + 1));
|
uri_len = (u16_t)(sp2 - (sp1 + 1));
|
||||||
if ((sp2 != 0) && (sp2 > sp1)) {
|
if ((sp2 != NULL) && (sp2 > sp1)) {
|
||||||
/* wait for CRLFCRLF (indicating end of HTTP headers) before parsing anything */
|
/* wait for CRLFCRLF (indicating end of HTTP headers) before parsing anything */
|
||||||
if (lwip_strnstr(data, CRLF CRLF, data_len) != NULL) {
|
if (lwip_strnstr(data, CRLF CRLF, data_len) != NULL) {
|
||||||
char *uri = sp1 + 1;
|
char *uri = sp1 + 1;
|
||||||
|
@ -695,7 +695,7 @@ mqtt_message_received(mqtt_client_t *client, u8_t fixed_hdr_len, u16_t length, u
|
|||||||
client->cyclic_tick = 0;
|
client->cyclic_tick = 0;
|
||||||
client->conn_state = MQTT_CONNECTED;
|
client->conn_state = MQTT_CONNECTED;
|
||||||
/* Notify upper layer */
|
/* Notify upper layer */
|
||||||
if (client->connect_cb != 0) {
|
if (client->connect_cb != NULL) {
|
||||||
client->connect_cb(client, client->connect_arg, res);
|
client->connect_cb(client, client->connect_arg, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1020,7 +1020,7 @@ mqtt_tcp_err_cb(void *arg, err_t err)
|
|||||||
LWIP_DEBUGF(MQTT_DEBUG_TRACE, ("mqtt_tcp_err_cb: TCP error callback: error %d, arg: %p\n", err, arg));
|
LWIP_DEBUGF(MQTT_DEBUG_TRACE, ("mqtt_tcp_err_cb: TCP error callback: error %d, arg: %p\n", err, arg));
|
||||||
LWIP_ASSERT("mqtt_tcp_err_cb: client != NULL", client != NULL);
|
LWIP_ASSERT("mqtt_tcp_err_cb: client != NULL", client != NULL);
|
||||||
/* Set conn to null before calling close as pcb is already deallocated*/
|
/* Set conn to null before calling close as pcb is already deallocated*/
|
||||||
client->conn = 0;
|
client->conn = NULL;
|
||||||
mqtt_close(client, MQTT_CONNECT_DISCONNECTED);
|
mqtt_close(client, MQTT_CONNECT_DISCONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1421,7 +1421,7 @@ dns_enqueue(const char *name, size_t hostnamelen, dns_found_callback found,
|
|||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||||
/* this is a duplicate entry, find a free request entry */
|
/* this is a duplicate entry, find a free request entry */
|
||||||
for (r = 0; r < DNS_MAX_REQUESTS; r++) {
|
for (r = 0; r < DNS_MAX_REQUESTS; r++) {
|
||||||
if (dns_requests[r].found == 0) {
|
if (dns_requests[r].found == NULL) {
|
||||||
dns_requests[r].found = found;
|
dns_requests[r].found = found;
|
||||||
dns_requests[r].arg = callback_arg;
|
dns_requests[r].arg = callback_arg;
|
||||||
dns_requests[r].dns_table_idx = i;
|
dns_requests[r].dns_table_idx = i;
|
||||||
|
@ -1015,7 +1015,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
|
|||||||
* new PBUF_RAM. See the definition of PBUF_NEEDS_COPY for details. */
|
* new PBUF_RAM. See the definition of PBUF_NEEDS_COPY for details. */
|
||||||
p = q;
|
p = q;
|
||||||
while (p) {
|
while (p) {
|
||||||
LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));
|
LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == NULL));
|
||||||
if (PBUF_NEEDS_COPY(p)) {
|
if (PBUF_NEEDS_COPY(p)) {
|
||||||
copy_needed = 1;
|
copy_needed = 1;
|
||||||
break;
|
break;
|
||||||
@ -1039,7 +1039,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
|
|||||||
new_entry = (struct etharp_q_entry *)memp_malloc(MEMP_ARP_QUEUE);
|
new_entry = (struct etharp_q_entry *)memp_malloc(MEMP_ARP_QUEUE);
|
||||||
if (new_entry != NULL) {
|
if (new_entry != NULL) {
|
||||||
unsigned int qlen = 0;
|
unsigned int qlen = 0;
|
||||||
new_entry->next = 0;
|
new_entry->next = NULL;
|
||||||
new_entry->p = p;
|
new_entry->p = p;
|
||||||
if (arp_table[i].q != NULL) {
|
if (arp_table[i].q != NULL) {
|
||||||
/* queue was already existent, append the new entry to the end */
|
/* queue was already existent, append the new entry to the end */
|
||||||
|
@ -680,7 +680,7 @@ pbuf_free_header(struct pbuf *q, u16_t size)
|
|||||||
struct pbuf *f = p;
|
struct pbuf *f = p;
|
||||||
free_left = (u16_t)(free_left - p->len);
|
free_left = (u16_t)(free_left - p->len);
|
||||||
p = p->next;
|
p = p->next;
|
||||||
f->next = 0;
|
f->next = NULL;
|
||||||
pbuf_free(f);
|
pbuf_free(f);
|
||||||
} else {
|
} else {
|
||||||
pbuf_remove_header(p, free_left);
|
pbuf_remove_header(p, free_left);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user