summaryrefslogtreecommitdiffhomepage
path: root/misc/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-08-21 18:26:59 +0200
committerTyge Løvset <[email protected]>2023-08-21 18:26:59 +0200
commit7b57eb4240ee886278b862ed8c90618376237afc (patch)
tree844f3fd9377a805218ce04aed13bb961e93a8307 /misc/examples
parentf354a2d11df91becfd7b3fb16abe54533737b1ad (diff)
downloadSTC-modified-7b57eb4240ee886278b862ed8c90618376237afc.tar.gz
STC-modified-7b57eb4240ee886278b862ed8c90618376237afc.zip
Some cleanups.
Diffstat (limited to 'misc/examples')
-rw-r--r--misc/examples/spans/submdspan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/spans/submdspan.c b/misc/examples/spans/submdspan.c
index fa0d5762..0752dfa1 100644
--- a/misc/examples/spans/submdspan.c
+++ b/misc/examples/spans/submdspan.c
@@ -3,11 +3,11 @@
#include <stdio.h>
#include <stc/cspan.h>
-using_cspan3(span, double); // define span, span2, span3
+using_cspan3(span, double); // shorthand for defining span, span2, span3
// Set all elements of a rank-2 mdspan to zero.
void zero_2d(span2 grid2d) {
- c_static_assert(cspan_rank(&grid2d) == 2);
+ (void)c_static_assert(cspan_rank(&grid2d) == 2);
for (int i = 0; i < grid2d.shape[0]; ++i) {
for (int j = 0; j < grid2d.shape[1]; ++j) {
*cspan_at(&grid2d, i,j) = 0;
@@ -16,7 +16,7 @@ void zero_2d(span2 grid2d) {
}
void zero_surface(span3 grid3d) {
- c_static_assert(cspan_rank(&grid3d) == 3);
+ (void)c_static_assert(cspan_rank(&grid3d) == 3);
zero_2d(cspan_slice(span2, &grid3d, {0}, {c_ALL}, {c_ALL}));
zero_2d(cspan_slice(span2, &grid3d, {c_ALL}, {0}, {c_ALL}));
zero_2d(cspan_slice(span2, &grid3d, {c_ALL}, {c_ALL}, {0}));
@@ -41,4 +41,4 @@ int main() {
}
puts("");
}
-} \ No newline at end of file
+}