diff options
| author | Tyge Lovset <[email protected]> | 2023-06-29 10:59:05 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-06-29 10:59:05 +0200 |
| commit | fc43b14f706f22e3933b3d225819ea68f7ce2679 (patch) | |
| tree | 5a8847adc62077c2d59e73379a94a0a1c89d9b97 /misc | |
| parent | 764d6b5a831c4ff58fb717a1360fe80f691a424d (diff) | |
| download | STC-modified-fc43b14f706f22e3933b3d225819ea68f7ce2679.tar.gz STC-modified-fc43b14f706f22e3933b3d225819ea68f7ce2679.zip | |
better variable names in list example.
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/examples/new_list.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/misc/examples/new_list.c b/misc/examples/new_list.c index b5ff847e..8083c315 100644 --- a/misc/examples/new_list.c +++ b/misc/examples/new_list.c @@ -5,8 +5,8 @@ forward_clist(clist_i32, int); forward_clist(clist_pnt, struct Point); typedef struct { - clist_i32 intlst; - clist_pnt pntlst; + clist_i32 intlist; + clist_pnt pntlist; } MyStruct; #define i_val int @@ -37,33 +37,33 @@ void MyStruct_drop(MyStruct* s); #include <stc/clist.h> void MyStruct_drop(MyStruct* s) { - clist_i32_drop(&s->intlst); - clist_pnt_drop(&s->pntlst); + clist_i32_drop(&s->intlist); + clist_pnt_drop(&s->pntlist); } int main() { MyStruct my = {0}; - clist_i32_push_back(&my.intlst, 123); - clist_pnt_push_back(&my.pntlst, c_LITERAL(Point){123, 456}); + clist_i32_push_back(&my.intlist, 123); + clist_pnt_push_back(&my.pntlist, c_LITERAL(Point){123, 456}); MyStruct_drop(&my); - clist_pnt plst = c_init(clist_pnt, {{42, 14}, {32, 94}, {62, 81}}); - clist_pnt_sort(&plst); + clist_pnt plist = c_init(clist_pnt, {{42, 14}, {32, 94}, {62, 81}}); + clist_pnt_sort(&plist); - c_foreach (i, clist_pnt, plst) + c_foreach (i, clist_pnt, plist) printf(" (%d %d)", i.ref->x, i.ref->y); puts(""); - clist_pnt_drop(&plst); + clist_pnt_drop(&plist); - clist_float flst = c_init(clist_float, {123.3f, 321.2f, -32.2f, 78.2f}); - clist_float_sort(&flst); + clist_float flist = c_init(clist_float, {123.3f, 321.2f, -32.2f, 78.2f}); + clist_float_sort(&flist); - c_foreach (i, clist_float, flst) + c_foreach (i, clist_float, flist) printf(" %g", (double)*i.ref); puts(""); - clist_float_drop(&flst); + clist_float_drop(&flist); } |
