summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-04-08 12:07:29 +0200
committerTyge Lovset <[email protected]>2023-04-08 12:07:29 +0200
commit2f64fae1f2f041ad3aec4a2388975297075fef42 (patch)
treee3f61a4fe0d4069f0f9d3a18390b80bcf9e22085 /include
parentd92ffe3da29b3352c90b2d356e395914ba5b3f52 (diff)
downloadSTC-modified-2f64fae1f2f041ad3aec4a2388975297075fef42.tar.gz
STC-modified-2f64fae1f2f041ad3aec4a2388975297075fef42.zip
Using "unsafe" c_ARRAYLEN(), because sizeof(shape) may be equal to sizeof pointer.
Diffstat (limited to 'include')
-rw-r--r--include/stc/cspan.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cspan.h b/include/stc/cspan.h
index ac3e9206..ce3c33ce 100644
--- a/include/stc/cspan.h
+++ b/include/stc/cspan.h
@@ -129,10 +129,10 @@ typedef struct { int32_t d[6]; } cspan_idx6;
{.data=(container)->data, .shape={(int32_t)(container)->_len}}
#define cspan_from_array(array) \
- {.data=(array) + c_static_assert(sizeof(array) != sizeof(void*)), .shape={c_arraylen(array)}}
+ {.data=(array) + c_static_assert(sizeof(array) != sizeof(void*)), .shape={c_ARRAYLEN(array)}}
#define cspan_size(self) _cspan_size((self)->shape, cspan_rank(self))
-#define cspan_rank(self) c_arraylen((self)->shape)
+#define cspan_rank(self) c_ARRAYLEN((self)->shape)
#define cspan_index(self, ...) c_PASTE(cspan_idx_, c_NUMARGS(__VA_ARGS__))(self, __VA_ARGS__)
#define cspan_idx_1 cspan_idx_4