summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-25 20:18:02 +0100
committerTyge Løvset <[email protected]>2023-01-25 20:18:02 +0100
commit68fd366ceaa919293d348ce15c2596d485160cec (patch)
treee50caaf6dc2952da36b5cd0c60252f94ee2b77ec /include/stc
parentaf4c2d6d2f3353364632701ef8208a9dcbe18623 (diff)
downloadSTC-modified-68fd366ceaa919293d348ce15c2596d485160cec.tar.gz
STC-modified-68fd366ceaa919293d348ce15c2596d485160cec.zip
Updates on cspan ++.
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/cspan.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/cspan.h b/include/stc/cspan.h
index 2b600a2a..5b0358e2 100644
--- a/include/stc/cspan.h
+++ b/include/stc/cspan.h
@@ -30,7 +30,7 @@ using_cspan(Intspan, int, 1);
int demo1() {
float raw[4*5];
- Span2f ms = cspan_make(raw, 4, 5);
+ Span2f ms = cspan_multidim(raw, 4, 5);
for (size_t i=0; i<ms.dim[0]; i++)
for (size_t j=0; j<ms.dim[1]; j++)
@@ -87,11 +87,11 @@ int demo2() {
#define cspan_rank_ok(self, rank) c_static_assert(cspan_rank(self) == rank)
-#define cspan_make(array, ...) \
+#define cspan_multidim(array, ...) \
{.data=array, .dim={__VA_ARGS__}}
-/* For static initialization use , cspan_init(). c_make() only works for non-static. */
-#define cspan_init(SpanType, ...) \
+/* For static initialization, use cspan_make(). c_make() for non-static only. */
+#define cspan_make(SpanType, ...) \
{.data=(SpanType##_value[])__VA_ARGS__, .dim={sizeof((SpanType##_value[])__VA_ARGS__)/sizeof(SpanType##_value)}}
#define cspan_flatten(span) \