1
0
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:
Kaspar Schleiser 2017-04-21 15:54:56 +02:00 committed by GitHub
commit 993ed203b5
3 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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;