1: https://github.com/contiki-os/contiki/blob/master/core/net/i...
P.S. UIP doesn't use the coroutine stuff at all it seems.
1: https://github.com/contiki-os/contiki/blob/master/core/net/i...
P.S. UIP doesn't use the coroutine stuff at all it seems.
The uses of goto I saw compensate for C's lack of nested breaks and continues. Reasonable people may differ on this topic, but I'm perfectly fine with it. The real sin is obfuscating the natural control flow of a program by introducing dummy variables like try_again and keep_running, or being forced to split things into multiple functions just so you can use a return in lieu of a nested break. (There are single-exit zealots for whom an early-out return like that would be an equally grievous sin as the goto!)
In any case, my point was to demonstrate by example that serious software can be written this way. The point wasn't to hold up uIP or Contiki or anything else as impeccable exemplars of coding style.
> P.S. UIP doesn't use the coroutine stuff at all it seems.
It's not used in the core but in the protocol servers: https://github.com/adamdunkels/uip/blob/master/apps/webserve.... All the PT and PSOCK code is protothreads.