[riot-notifications] [RIOT] core/priority_queue: cast of root to priority_queue_node_t* is wrong (#3228)

Kaspar Schleiser 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:
https://github.com/RIOT-OS/RIOT/pull/3228#issuecomment-114100098
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150622/8c03c343/attachment.html>


More information about the notifications mailing list