diff options
| author | Tyge Løvset <[email protected]> | 2021-04-27 20:44:11 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-04-27 20:44:11 +0200 |
| commit | 1faeef377e0298df3e6d765c08c2eeb02f45757a (patch) | |
| tree | 82d5fedce2cade18d8010e788e736054574eeb4b /examples | |
| parent | c0bdaa745f2367812bc72290d6b7dfe2a1a149fe (diff) | |
| download | STC-modified-1faeef377e0298df3e6d765c08c2eeb02f45757a.tar.gz STC-modified-1faeef377e0298df3e6d765c08c2eeb02f45757a.zip | |
Renamed carray struct member at to data. Improved cdeq_expand_() method.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/complex.c | 6 | ||||
| -rw-r--r-- | examples/demos.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/examples/complex.c b/examples/complex.c index 6095a03e..32bbd057 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -27,7 +27,7 @@ int main() { printf("arr2 size: %zu x %zu\n", arr2.xdim, arr2.ydim);
// Put in some data in 2D array
- arr2.at[x][y] = 3.1415927f;
+ arr2.data[x][y] = 3.1415927f;
clist_arr_push_back(&tableList, arr2);
cmap_lst_insert(&listMap, tableKey, tableList);
cmap_map_insert(&myMap, cstr_from(strKey), listMap);
@@ -37,8 +37,8 @@ int main() { clist_arr* lsta = &cmap_lst_find(mapl, tableKey).ref->second;
carray2f arr = *clist_arr_back(lsta);
- printf("value (%d, %d) is: %f\n", x, y, arr.at[x][y]);
+ printf("value (%d, %d) is: %f\n", x, y, arr.data[x][y]);
- arr2.at[x][y] = 1.41421356f; // change the value in array
+ arr2.data[x][y] = 1.41421356f; // change the value in array
cmap_map_del(&myMap); // free up everything!
}
diff --git a/examples/demos.c b/examples/demos.c index 1eb74525..286c2e79 100644 --- a/examples/demos.c +++ b/examples/demos.c @@ -185,20 +185,20 @@ void arraydemo1() {
printf("\nARRAYDEMO1\n");
carray3f a3 = carray3f_init(30, 20, 10, 0.0f);
- a3.at[5][4][3] = 10.2f;
- float **a2 = a3.at[5];
- float *a1 = a3.at[5][4];
+ a3.data[5][4][3] = 10.2f;
+ float **a2 = a3.data[5];
+ float *a1 = a3.data[5][4];
printf("a3: %zu: (%zu, %zu, %zu) = %zu\n", sizeof(a3), a3.xdim, a3.ydim, a3.zdim, carray3f_size(a3));
printf("%g\n", a1[3]); // = 10.2
printf("%g\n", a2[4][3]); // = 10.2
- printf("%g\n", a3.at[5][4][3]); // = 10.2
+ printf("%g\n", a3.data[5][4][3]); // = 10.2
float x = 0.0;
c_foreach (i, carray3f, a3)
*i.ref = ++x;
- printf("%g\n", a3.at[29][19][9]); // = 6000
+ printf("%g\n", a3.data[29][19][9]); // = 6000
carray3f_del(&a3);
}
|
