Browse Source

some (ptr == 0) -> (ptr == NULL) fixes (found by coccinelle)

master
Kaspar Schleiser 6 years ago
parent
commit
185c7ac11b
  1. 2
      cpu/mips_pic32_common/periph/gpio.c
  2. 4
      sys/posix/sockets/posix_sockets.c
  3. 3
      sys/xtimer/xtimer_core.c

2
cpu/mips_pic32_common/periph/gpio.c

@ -106,7 +106,7 @@ static PIC32_GPIO_T base_address[] = {
static inline int check_valid_port(uint8_t port)
{
return port < (sizeof(base_address)/sizeof(base_address[0]))
&& base_address[port].gpio != 0;
&& base_address[port].gpio != NULL;
}
int gpio_init(gpio_t pin, gpio_mode_t mode)

4
sys/posix/sockets/posix_sockets.c

@ -265,7 +265,7 @@ static int socket_close(vfs_file_t *filp)
#endif
#ifdef MODULE_SOCK_TCP
case SOCK_STREAM:
if (s->queue_array == 0) {
if (s->queue_array == NULL) {
sock_tcp_disconnect(&s->sock->tcp.sock);
}
else {
@ -863,7 +863,7 @@ static ssize_t socket_recvfrom(socket_t *s, void *restrict buffer,
res = -EOPNOTSUPP;
break;
}
if ((res >= 0) && (address != NULL) && (address_len != 0)) {
if ((res >= 0) && (address != NULL) && (address_len != NULL)) {
switch (s->type) {
#ifdef MODULE_SOCK_TCP
case SOCK_STREAM:

3
sys/xtimer/xtimer_core.c

@ -487,7 +487,8 @@ overflow:
* next timer period and check again for expired
* timers.*/
if (reference > _xtimer_lltimer_now()) {
DEBUG("_timer_callback: overflowed while executing callbacks. %i\n", timer_list_head != 0);
DEBUG("_timer_callback: overflowed while executing callbacks. %i\n",
timer_list_head != NULL);
_next_period();
reference = 0;
goto overflow;

Loading…
Cancel
Save