[riot-notifications] [RIOT-OS/RIOT] tsrb: change input type to `uint8_t` (#11634)

Sebastian Meiling notifications at github.com
Wed Jun 5 14:29:49 CEST 2019


smlng commented on this pull request.



>  {
     rb->buf[rb->writes++ & (rb->size - 1)] = c;
 }
 
-static char _pop(tsrb_t *rb)
+static uint8_t _pop(tsrb_t *rb)
 {
     return rb->buf[rb->reads++ & (rb->size - 1)];
 }
 
 int tsrb_get_one(tsrb_t *rb)

@kaspar030: oversaw the increment of `reads` so one MUST check if ring buffer not empty before any `get` operation. But then we could actually simplify the API by removing `tsrb_empty` and `tsrb_full` because they have no value to the user as s/he can just call `tsrb_get*` or `tsrb_add*` and check for errors.

-- 
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/11634#discussion_r290712584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190605/0dc964a9/attachment.html>


More information about the notifications mailing list