events=(schedule **)malloc(INITSCHEDSIZE*sizeof(schedule *));
}
+void finischedule() {
+ deregisterhook(HOOK_CORE_STATSREQUEST, &schedulestats);
+ free(events);
+}
+
void schedule_heapify(int index) {
int firstindex=index;
schedule *ep;
insertschedule(sp);
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"scheduleoneshot: (%ld, %x, %x) = %x",when, callback, arg, sp);
+ Error("schedule",ERR_DEBUG,"scheduleoneshot: (%ld, %x, %x) = %x",when, (unsigned int)callback, (unsigned int)arg, (unsigned int)sp);
#endif
return (void *)sp;
* pass it in here for an O(1) *cough* O(lg n) delete */
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"deleteschedule(%x,%x,%x)",sch,callback, arg);
+ Error("schedule",ERR_DEBUG,"deleteschedule(%x,%x,%x)",(unsigned int)sch,(unsigned int)callback, (unsigned int)arg);
#endif
if (sch) {
schedule_heapify(0);
if (sp->callback==NULL) {
- Error("core",ERR_ERROR,"Tried to call NULL function in doscheduledevents(): (%x, %x, %x)",sp,sp->callback,sp->callbackparam);
+ Error("core",ERR_ERROR,"Tried to call NULL function in doscheduledevents(): (%p, %p, %p)",sp,sp->callback,sp->callbackparam);
continue;
}
break;
}
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"exec schedule:(%x, %x, %x)", sp, sc, arg);
+ Error("schedule",ERR_DEBUG,"exec schedule:(%x, %x, %x)", (unsigned int)sp, (unsigned int)sc, (unsigned int)arg);
#endif
(sc)(arg);
#ifdef SCHEDDEBUG