[riot-notifications] [RIOT] core/priority_queue: cast of root to priority_queue_node_t* is wrong (#3228)
notifications at github.com
Mon Jun 22 15:21:25 CEST 2015
> I use a priority_queue_t type variable in NDP which is added as a priority_queue_node_t
Well, it is one thing to assume certain things inside the implementation, another to do so from the outside. Don't use ```priority_queue_t``` as node. That type solely exists because linked lists are simpler in C when not using pointer to pointer variables, and using a ```priority_queue_node_t``` would waste memory.
```priority_queue_add()``` takes a pointer to the list type (```priority_queue_t```) as first parameter, and a node of type ```priority_queue_node_t``` that will be added. That is clearly documented.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications