-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add a generic list and make lowpan.c use that list #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can we not just use |
|
Queue has to much extra data in it (namely data and priority). But using list as a superclass of queue (and moving it to core) could be something considered |
|
But doxygen documentation is missing and some coding conventions are not uphold. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want multi line defines, so all of these functions should go as normal c functions.
The rule of thumb:use define for function aliases, but if you have more than one command use a normal function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but they operate directly on the variables inside the loop, the defines are there to make the functions easier to use and write.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, complex Macros make code really hard to debug. That was the intention behind the last point in:
https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions#wiki-functions
So, I'm with @mehlis here.
Use a generic list instead of the buggy custom one
|
Needs rebase and review. |
|
I think it would be great if someone could maintain this PR. |
|
Well if there is still interest in this list, what should be done to integrate it better with riot? |
|
|
btw for sake of discussion: what was again wrong with clist in core? |
It only has add and remove, no search or for each functions, and it's double linked which wastes the a pointer for each element if not needed ;) But really, I just wrote that list to match the requirements of my application, when I discovered an issue in RIOT allegedly originating in lowpan.c, I wanted to see what happened when I replaced the strange intermingled 'list' there with the one I already had, but not much changed except for that the code got more readable imho. |
|
I'm with @Kijewski , so no need in this code. And I'm with @authmillenon : document all problems in clist, try to create test cases. Fix the problem. As far as I know, no problems are known with clist. The problem is probably in the sixlowpan stack using it. (or there is no problem at all...) |
|
@mehlis As far as I know sixlowpan is not using clist. |
|
@authmillenon ah I see. |
|
just to have it here: another possible candidate for a list implementation: https://github.com/jpfender/riot-gossip/blob/master/src/list.c (has other problems regarding malloc/free....) |
|
sixlowpan uses static arrays currently, but will change for the most things (addresses and prefixes mainly) next week. |
|
partially implemented in #644, code not ready |
lowpan.c uses a custom list implementation and intermingles list handling with application logic.
This leads to errors like #299.
I had already implemented a very simple and tested generic list for olsr2, so add that to RIOT and make lowpan.c use it.
It's still missing documentation and RIOT coding style, I'll add that later if you agree with the general approach.
My application runs a lot more stable with it, so I guess this fixes #299