From fddae5ef07fc0e9a018e56a9843e059a737e4db7 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 12 Mar 2023 22:06:56 +0100 Subject: Minor fix in coroutine.h --- include/stc/algo/coroutine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/stc/algo/coroutine.h b/include/stc/algo/coroutine.h index 1dd82720..3592b968 100644 --- a/include/stc/algo/coroutine.h +++ b/include/stc/algo/coroutine.h @@ -68,11 +68,11 @@ enum { #define cco_begin(ctx) \ int *_state = &(ctx)->cco_state; \ switch (*_state) { \ - case 0: + case 0: case cco_state_done: #define cco_end(retval) \ *_state = cco_state_done; break; \ - default: assert(0); goto _cco_final_; \ + case -99: goto _cco_final_; \ } \ return retval @@ -111,7 +111,7 @@ enum { #define cco_reset(ctx) \ do { \ int* _state = &(ctx)->cco_state; \ - if (*_state == cco_state_final) *_state = 0; \ + if (*_state == cco_state_done) *_state = 0; \ } while (0) #endif -- cgit v1.2.3