diff --git a/src/event_dispatcher_register_handler.c b/src/event_dispatcher_register_handler.c index 6efb825..d9864da 100644 --- a/src/event_dispatcher_register_handler.c +++ b/src/event_dispatcher_register_handler.c @@ -41,8 +41,8 @@ doRegister(const void * _node, const void * data) if (handler_queue_hv) { handler_queue = *(TR_Queue *)handler_queue_hv->value; } else { - handler_queue = TR_new(TR_Queue); - handler_queue->free_msgs = 0; + handler_queue = TR_new(TR_Queue); + ((TR_List)handler_queue)->free_msgs = 0; // TODO change TR_Queue to TR_Dynarray as this is no queue. handler_queue_hv = TR_new( TR_HashValue, diff --git a/src/event_dispatcher_start.c b/src/event_dispatcher_start.c index ecb4416..95aae95 100644 --- a/src/event_dispatcher_start.c +++ b/src/event_dispatcher_start.c @@ -70,17 +70,17 @@ TR_eventDispatcherStart(TR_EventDispatcher this) : NULL; if (handler_queue) { - size_t idx = TR_queueFirst(handler_queue); + size_t idx = TR_listFirst((TR_List)handler_queue); TR_EventDone done = TR_EVENT_PENDING; - while (idx != TR_queueLast(handler_queue) + 1) { - TR_EventHandler handler = handler_queue->data[idx]; + while (idx != TR_listLast((TR_List)handler_queue) + 1) { + TR_EventHandler handler = ((TR_List)handler_queue)->data[idx]; TR_EventDone this_done; this_done = TR_eventHandlerHandleEvent(handler, event); done = TR_EVENT_DONE == done ? done : this_done; - idx = idx + 1 == TR_queueSize(handler_queue) ? 0 : idx + 1; + idx = idx + 1 == TR_queueSize((TR_List)handler_queue) ? 0 : idx + 1; } if (TR_EVENT_DONE == done) {