Use NULL instead of 0 as a pointer

Recommended by 'sparse' tool
This commit is contained in:
Florian La Roche
2021-11-27 15:48:02 +01:00
committed by Erik Ekman
parent f3300731be
commit 089697bb1c
8 changed files with 12 additions and 12 deletions

View File

@@ -1421,7 +1421,7 @@ dns_enqueue(const char *name, size_t hostnamelen, dns_found_callback found,
#endif /* LWIP_IPV4 && LWIP_IPV6 */
/* this is a duplicate entry, find a free request entry */
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].arg = callback_arg;
dns_requests[r].dns_table_idx = i;

View File

@@ -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. */
p = q;
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)) {
copy_needed = 1;
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);
if (new_entry != NULL) {
unsigned int qlen = 0;
new_entry->next = 0;
new_entry->next = NULL;
new_entry->p = p;
if (arp_table[i].q != NULL) {
/* queue was already existent, append the new entry to the end */

View File

@@ -680,7 +680,7 @@ pbuf_free_header(struct pbuf *q, u16_t size)
struct pbuf *f = p;
free_left = (u16_t)(free_left - p->len);
p = p->next;
f->next = 0;
f->next = NULL;
pbuf_free(f);
} else {
pbuf_remove_header(p, free_left);