[riot-notifications] [RIOT-OS/RIOT] Refactor evtimer add del (#10717)

Kees Bakker notifications at github.com
Wed Jun 26 22:13:09 CEST 2019


keestux commented on this pull request.



>  {
     DEBUG("evtimer: new event offset %" PRIu32 " ms\n", event->offset);
-    /* we want list->next to point to the first list element. thus we take the
-     * *address* of evtimer->events, then cast it from (evtimer_event_t **) to
-     * (evtimer_event_t*). After that, list->next actually equals
-     * evtimer->events. */
-    evtimer_event_t *list = (evtimer_event_t *)&evtimer->events;
-
-    while (list->next) {
-        evtimer_event_t *list_entry = list->next;
+    evtimer_event_t **list = &evtimer->events;

Well, it is quite essential to have `evtimer_event_t **list = &evtimer->events` !!
Take a look at the last line in the function
```
    *list = event;
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10717#discussion_r297846676
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190626/07df056f/attachment.html>


More information about the notifications mailing list