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

Martine Lenders notifications at github.com
Wed Jun 5 13:53:01 CEST 2019


miri64 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)

Because instead of checking it once in the function, every use of `tsrb_get_one()` needs to add a check (so adding ROM for every call). This makes `tsrb_get_one()` maybe type-safe (which is due to the new typing arguable, as values and error codes are now two distinct value-spaces), but inherently error-prone in its usage.

-- 
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_r290699892
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190605/560e5d15/attachment.html>


More information about the notifications mailing list