Merge pull request #6947 from kaspar030/fix_NULL_zero_checks
some (ptr == 0) -> (ptr == NULL) fixes (found by coccinelle)
This commit is contained in:
commit
993ed203b5
@ -106,7 +106,7 @@ static PIC32_GPIO_T base_address[] = {
|
|||||||
static inline int check_valid_port(uint8_t port)
|
static inline int check_valid_port(uint8_t port)
|
||||||
{
|
{
|
||||||
return port < (sizeof(base_address)/sizeof(base_address[0]))
|
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)
|
int gpio_init(gpio_t pin, gpio_mode_t mode)
|
||||||
|
|||||||
@ -265,7 +265,7 @@ static int socket_close(vfs_file_t *filp)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef MODULE_SOCK_TCP
|
#ifdef MODULE_SOCK_TCP
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
if (s->queue_array == 0) {
|
if (s->queue_array == NULL) {
|
||||||
sock_tcp_disconnect(&s->sock->tcp.sock);
|
sock_tcp_disconnect(&s->sock->tcp.sock);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -863,7 +863,7 @@ static ssize_t socket_recvfrom(socket_t *s, void *restrict buffer,
|
|||||||
res = -EOPNOTSUPP;
|
res = -EOPNOTSUPP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((res >= 0) && (address != NULL) && (address_len != 0)) {
|
if ((res >= 0) && (address != NULL) && (address_len != NULL)) {
|
||||||
switch (s->type) {
|
switch (s->type) {
|
||||||
#ifdef MODULE_SOCK_TCP
|
#ifdef MODULE_SOCK_TCP
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
|
|||||||
@ -487,7 +487,8 @@ overflow:
|
|||||||
* next timer period and check again for expired
|
* next timer period and check again for expired
|
||||||
* timers.*/
|
* timers.*/
|
||||||
if (reference > _xtimer_lltimer_now()) {
|
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();
|
_next_period();
|
||||||
reference = 0;
|
reference = 0;
|
||||||
goto overflow;
|
goto overflow;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user