aboutsummaryrefslogtreecommitdiffstats
path: root/src/apoint.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-26 11:22:08 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:35 +0200
commitb8b6830dfd75f6870b2171e7f31cb0cdb927532e (patch)
treecd3ad69b32150402de8b031f68705fb2f8e99600 /src/apoint.c
parent8a85aaafa5905297398605eb890b00d22416eeb5 (diff)
downloadcalcurse-b8b6830dfd75f6870b2171e7f31cb0cdb927532e.tar.gz
calcurse-b8b6830dfd75f6870b2171e7f31cb0cdb927532e.zip
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/apoint.c')
-rw-r--r--src/apoint.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/apoint.c b/src/apoint.c
index 8d7852b..61acc49 100644
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -186,9 +186,9 @@ void apoint_paste(unsigned *nb_events, unsigned *nb_apoints, int cut_item_type)
hilt++;
}
-unsigned apoint_inday(struct apoint *i, long start)
+unsigned apoint_inday(struct apoint *i, long *start)
{
- return (i->start <= start + DAYINSEC && i->start + i->dur > start);
+ return (i->start <= *start + DAYINSEC && i->start + i->dur > *start);
}
void apoint_sec2str(struct apoint *o, long day, char *start, char *end)
@@ -275,7 +275,7 @@ void apoint_delete_bynum(long start, unsigned num, enum eraseflg flag)
int need_check_notify = 0;
LLIST_TS_LOCK(&alist_p);
- i = LLIST_TS_FIND_NTH(&alist_p, num, start, apoint_inday);
+ i = LLIST_TS_FIND_NTH(&alist_p, num, &start, apoint_inday);
if (!i)
EXIT(_("no such appointment"));
@@ -356,9 +356,9 @@ void apoint_scroll_pad_up(int nb_events_inday)
apad.first_onscreen = item_first_line;
}
-static int apoint_starts_after(struct apoint *apt, long time)
+static int apoint_starts_after(struct apoint *apt, long *time)
{
- return apt->start > time;
+ return apt->start > *time;
}
/*
@@ -370,7 +370,7 @@ struct notify_app *apoint_check_next(struct notify_app *app, long start)
llist_item_t *i;
LLIST_TS_LOCK(&alist_p);
- i = LLIST_TS_FIND_FIRST(&alist_p, start, apoint_starts_after);
+ i = LLIST_TS_FIND_FIRST(&alist_p, &start, apoint_starts_after);
if (i) {
struct apoint *apt = LLIST_TS_GET_DATA(i);