mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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)
|
||||
{
|
||||
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)
|
||||
|
@ -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:
|
||||
|
@ -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…
Reference in New Issue
Block a user