diff options
| author | Tyge Løvset <[email protected]> | 2023-01-16 14:40:18 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-01-16 14:40:18 +0100 |
| commit | 5519490cacb966e4205e9d98869fb9cde981ad4f (patch) | |
| tree | f835c8a5f27292b0fefb38a732e3d6d31621bc31 /misc/examples/multidim.c | |
| parent | f9bb1e77a79aa9d02f5d816491e7fd53db0b964a (diff) | |
| download | STC-modified-5519490cacb966e4205e9d98869fb9cde981ad4f.tar.gz STC-modified-5519490cacb966e4205e9d98869fb9cde981ad4f.zip | |
cspan API change: Switched to passing spans as value instead of pointer (except resize).
Diffstat (limited to 'misc/examples/multidim.c')
| -rw-r--r-- | misc/examples/multidim.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/multidim.c b/misc/examples/multidim.c index 99310847..4f31548e 100644 --- a/misc/examples/multidim.c +++ b/misc/examples/multidim.c @@ -27,16 +27,16 @@ int main() // write data using 2D view for (unsigned i=0; i != ms2.dim[0]; i++) for (unsigned j=0; j != ms2.dim[1]; j++) - *cspan_at(&ms2, i, j) = i*1000 + j; + *cspan_at(ms2, i, j) = i*1000 + j; // print all items using 1D view printf("all: "); for (unsigned i=0; i != ms1.dim[0]; i++) - printf(" %d", *cspan_at(&ms1, i)); + printf(" %d", *cspan_at(ms1, i)); puts(""); // or iterate a subspan... - ispan2 sub = cspan_3to2(&ms3, 1); + ispan2 sub = cspan_3to2(ms3, 1); printf("sub: "); c_FOREACH (i, ispan2, sub) printf(" %d", *i.ref); @@ -49,7 +49,7 @@ int main() for (unsigned j=0; j != ms3.dim[1]; j++) { for (unsigned k=0; k != ms3.dim[2]; k++) - printf("%d ", *cspan_at(&ms3, i, j, k)); + printf("%d ", *cspan_at(ms3, i, j, k)); puts(""); } } |
