diff options
| author | Tyge Lovset <[email protected]> | 2023-05-09 04:40:24 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-05-09 04:40:24 +0200 |
| commit | 99d94309f31f082b505180d2cb7c1c6c2215e9f0 (patch) | |
| tree | b4dd5aec779eff711e5e3fea0d356301c3969cd2 /include | |
| parent | 2f11c7cf36690a1493344189b6a011c26ee58a9b (diff) | |
| download | STC-modified-99d94309f31f082b505180d2cb7c1c6c2215e9f0.tar.gz STC-modified-99d94309f31f082b505180d2cb7c1c6c2215e9f0.zip | |
reverted cco_await_done => cco_await_at.
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/algo/coroutine.h | 8 | ||||
| -rw-r--r-- | include/stc/cpque.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/stc/algo/coroutine.h b/include/stc/algo/coroutine.h index 979e05bb..2ea7122b 100644 --- a/include/stc/algo/coroutine.h +++ b/include/stc/algo/coroutine.h @@ -95,11 +95,11 @@ enum { case __LINE__: if (!(promise)) return ret; \ } while (0) -#define cco_await_done(...) c_MACRO_OVERLOAD(cco_await_done, __VA_ARGS__) -#define cco_await_done_2(co, call) cco_await_done_3(co, call, ) -#define cco_await_done_3(co, call, ret) cco_await_2((call, cco_done(co)), ret) +#define cco_await_at(...) c_MACRO_OVERLOAD(cco_await_at, __VA_ARGS__) +#define cco_await_at_2(co, call) cco_await_at_3(co, call, ) +#define cco_await_at_3(co, call, ret) cco_await_2((call, cco_done(co)), ret) -#define cco_run_blocked(co, call) while (call, !cco_done(co)) +#define cco_run(co, call) while (call, !cco_done(co)) #define cco_final \ case cco_state_final diff --git a/include/stc/cpque.h b/include/stc/cpque.h index c76621cd..85002c67 100644 --- a/include/stc/cpque.h +++ b/include/stc/cpque.h @@ -36,7 +36,7 @@ typedef i_keyraw _cx_raw; STC_API void _cx_memb(_make_heap)(_cx_self* self); STC_API void _cx_memb(_erase_at)(_cx_self* self, intptr_t idx); -STC_API void _cx_memb(_push)(_cx_self* self, _cx_value value); +STC_API _cx_value* _cx_memb(_push)(_cx_self* self, _cx_value value); STC_INLINE _cx_self _cx_memb(_init)(void) { return c_LITERAL(_cx_self){NULL}; } @@ -144,7 +144,7 @@ _cx_memb(_erase_at)(_cx_self* self, const intptr_t idx) { _cx_memb(_sift_down_)(self, idx + 1, n); } -STC_DEF void +STC_DEF _cx_value* _cx_memb(_push)(_cx_self* self, _cx_value value) { if (self->_len == self->_cap) _cx_memb(_reserve)(self, self->_len*3/2 + 4); @@ -153,6 +153,7 @@ _cx_memb(_push)(_cx_self* self, _cx_value value) { for (; c > 1 && (i_less((&arr[c/2]), (&value))); c /= 2) arr[c] = arr[c/2]; arr[c] = value; + return arr + c; } #endif |
