diff options
| author | tylov <[email protected]> | 2023-07-20 14:42:00 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-20 15:00:02 +0200 |
| commit | 224a04f7fa7549ed94d2a1415eb25829e39a7cca (patch) | |
| tree | 1d1be262be71b512d334ded99741a64f2aa6ca67 /include/stc/cspan.h | |
| parent | 313c1d7bb9b92e75801429c1f7f132589860292e (diff) | |
| download | STC-modified-224a04f7fa7549ed94d2a1415eb25829e39a7cca.tar.gz STC-modified-224a04f7fa7549ed94d2a1415eb25829e39a7cca.zip | |
Added Task-object to coroutines and true stackless execution.
Diffstat (limited to 'include/stc/cspan.h')
| -rw-r--r-- | include/stc/cspan.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/stc/cspan.h b/include/stc/cspan.h index dcb02961..08045010 100644 --- a/include/stc/cspan.h +++ b/include/stc/cspan.h @@ -80,19 +80,19 @@ int demo2() { STC_INLINE Self Self##_from_n(Self##_raw* raw, const intptr_t n) { \ return (Self){.data=raw, .shape={(int32_t)n}}; \ } \ - STC_INLINE Self Self##_slice_(Self##_value* v, const int32_t shape[], const int32_t stri[], \ + STC_INLINE Self Self##_slice_(Self##_value* d, const int32_t shape[], const int32_t stri[], \ const int rank, const int32_t a[][2]) { \ - Self s; s.data = v; int outrank; \ - s.data += _cspan_slice(s.shape, s.stride.d, &outrank, shape, stri, rank, a); \ + Self s; int outrank; \ + s.data = d + _cspan_slice(s.shape, s.stride.d, &outrank, shape, stri, rank, a); \ c_assert(outrank == RANK); \ return s; \ } \ STC_INLINE Self##_iter Self##_begin(const Self* self) { \ - Self##_iter it = {.ref=self->data, .pos={0}, ._s=self}; \ + Self##_iter it = {.ref=self->data, ._s=self}; \ return it; \ } \ STC_INLINE Self##_iter Self##_end(const Self* self) { \ - Self##_iter it = {.ref=NULL}; \ + Self##_iter it = {0}; \ return it; \ } \ STC_INLINE void Self##_next(Self##_iter* it) { \ @@ -120,7 +120,7 @@ using_cspan_tuple(7); using_cspan_tuple(8); #define cspan_init(SpanType, ...) \ {.data=(SpanType##_value[])__VA_ARGS__, .shape={sizeof((SpanType##_value[])__VA_ARGS__)/sizeof(SpanType##_value)}, .stride={.d={1}}} -/* create a cspan from a cvec, cstack, cdeq, cqueue, or cpque (heap) */ +/* create a cspan from a cvec, cstack, or cpque (heap) */ #define cspan_from(container) \ {.data=(container)->data, .shape={(int32_t)(container)->_len}, .stride={.d={1}}} |
