From 6fb0f6f4c6c5e17b9485fc666823feede35723b9 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 5 Apr 2011 01:50:23 +0200 Subject: Compare pointers to "NULL" instead of "0". "bad_zero.cocci" spatch from http://coccinelle.lip6.fr/impact_linux.php. Signed-off-by: Lukas Fleischer --- src/apoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index 4b562f7..f612071 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -141,7 +141,7 @@ apoint_new (char *mesg, char *note, long start, long dur, char state) i = &alist_p->root; for (;;) { - if (*i == 0 || (*i)->start > start) + if (*i == NULL || (*i)->start > start) { o->next = *i; *i = o; @@ -509,7 +509,7 @@ apoint_delete_bynum (long start, unsigned num, enum eraseflg flag) n = 0; pthread_mutex_lock (&(alist_p->mutex)); iptr = &alist_p->root; - for (i = alist_p->root; i != 0; i = i->next) + for (i = alist_p->root; i != NULL; i = i->next) { if (apoint_inday (i, start)) { @@ -616,7 +616,7 @@ apoint_check_next (struct notify_app *app, long start) struct apoint *i; pthread_mutex_lock (&(alist_p->mutex)); - for (i = alist_p->root; i != 0; i = i->next) + for (i = alist_p->root; i != NULL; i = i->next) { if (i->start > app->time) { @@ -684,7 +684,7 @@ apoint_switch_notify (void) need_chk_notify = 0; pthread_mutex_lock (&(alist_p->mutex)); - for (apoint = alist_p->root; apoint != 0; apoint = apoint->next) + for (apoint = alist_p->root; apoint != NULL; apoint = apoint->next) { if (apoint_inday (apoint, date)) { -- cgit v1.2.3-54-g00ecf