sys: ringbuffer: rb_add_elements() don't overwrite existing content#933
sys: ringbuffer: rb_add_elements() don't overwrite existing content#933Kijewski wants to merge 3 commits intoRIOT-OS:masterfrom Kijewski:issue-933
rb_add_elements() don't overwrite existing content#933Conversation
|
Added commits. |
sys/include/ringbuffer.h
Outdated
There was a problem hiding this comment.
you change this to the worse, @file FILENAME.[c|h] is the preferred style here...
There was a problem hiding this comment.
The name is filled in automatically. Declaring the name makes finding the source of the definition more difficult in the generated HTML.
|
+1 for the changes! Just seems to me the implementation is not yet complete?! |
|
It is complete. I only changed |
sys/include/ringbuffer.h
Outdated
|
Also +1 for the changes! |
sys/include/ringbuffer.h
Outdated
There was a problem hiding this comment.
Maybe, while you're at it: rename ringbuffer_add_element
|
@authmillenon really, ringbuffer_*? Why write out everything? I prefer the short names. |
|
Because rb_* could refer to anything and thus can lead to problems in readability (and portability). |
|
I like longer names, too. Even my smallish editor Geany supports autocompletion, and every major editor (vim, emacs, Eclipse, …) does, too. |
|
Do we like longer names because our editor supports autocompletion? I like shorter names because they IMHO increase readability. Guess you would state the opposite? |
|
I'm even for renaming |
|
It's more a "where does this come from" readability, than a "This code line is shorter then 50 chars" readability I meant. |
|
If we call the module |
|
why not call the module
|
|
Let's prefer practical inconsistency over academic consistency. |
sys/include/ringbuffer.h
Outdated
? ;-) |
|
Can you rebase please? :D I'd like to use this PR for my packet buffer but am not able to write unittests. |
rb_add_elements() don't overwrite existing contentrb_add_elements() don't overwrite existing content
|
@authmillenon, rebased. |
|
This PR was superseded by #1101. |
|
Close? |
|
I wanted to wait if someone has some final comment, or if there is a strong opposition against the other PR. Right now there is not much comment on #1101. : ) |
|
Replaced by #1101. I'm closing this PR as I won't rebase this branch. |

rb_add_elements()is undocumented and currently unused. I'd like to use it. My problem is that the function overwrites existing content. Hence it doesn't return how many elements were added.The corresponding get function
rb_get_elements()only reads as many elements as there are stored, and returns the number of actually read elements.Are there objections to change the behavior of
rb_add_elements()not to overwrite existing elements?