From b8b6830dfd75f6870b2171e7f31cb0cdb927532e Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 26 Jun 2012 11:22:08 +0200 Subject: Allow passing more complex data to list callbacks Change the data type of the "data" parameter from "long" to "void *" in llist_find_*() signatures to allow for passing more complex objects. Change all llist_find_*() invocations and callbacks accordingly. Signed-off-by: Lukas Fleischer --- src/event.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/event.c') diff --git a/src/event.c b/src/event.c index 6371b27..4af9f23 100644 --- a/src/event.c +++ b/src/event.c @@ -104,9 +104,9 @@ struct event *event_new(char *mesg, char *note, long day, int id) } /* Check if the event belongs to the selected day */ -unsigned event_inday(struct event *i, long start) +unsigned event_inday(struct event *i, long *start) { - return (i->day < start + DAYINSEC && i->day >= start); + return (i->day < *start + DAYINSEC && i->day >= *start); } /* Write to file the event in user-friendly format */ @@ -157,7 +157,7 @@ struct event *event_scan(FILE * f, struct tm start, int id, char *note) /* Delete an event from the list. */ void event_delete_bynum(long start, unsigned num, enum eraseflg flag) { - llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, start, event_inday); + llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, &start, event_inday); if (!i) EXIT(_("no such appointment")); -- cgit v1.2.3-54-g00ecf