diff options
| author | Tyge Løvset <[email protected]> | 2020-12-30 11:17:30 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-30 11:17:30 +0100 |
| commit | 2b46410ef5bb28c4551cdd422c5e22731bd6b610 (patch) | |
| tree | 03408e3fb036ca610b81e2dccdbec9740605b074 /examples | |
| parent | e2de45078c5e668ed9fd0515eb8face9170b9f70 (diff) | |
| download | STC-modified-2b46410ef5bb28c4551cdd422c5e22731bd6b610.tar.gz STC-modified-2b46410ef5bb28c4551cdd422c5e22731bd6b610.zip | |
API change: Swapped destroy <-> compare function args in using_*() macros for cvec, cdeq, cptr and clist.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/complex.c | 2 | ||||
| -rw-r--r-- | examples/ex_gaussian.c | 2 | ||||
| -rw-r--r-- | examples/inits.c | 4 | ||||
| -rw-r--r-- | examples/ptr.c | 10 | ||||
| -rw-r--r-- | examples/share_ptr.c | 6 | ||||
| -rw-r--r-- | examples/share_ptr2.c | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/examples/complex.c b/examples/complex.c index 19e5ae2e..3dbf683d 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -6,7 +6,7 @@ void check_del(float* v) {printf("destroy %g\n", *v);}
using_carray(f, float, check_del); // normally omit the last argument - float type need no destroy.
-using_clist(y, carray2f, carray2f_del, c_no_compare);
+using_clist(y, carray2f, c_no_compare, carray2f_del);
using_cmap(g, int, clist_y, clist_y_del);
using_cmap_strkey(s, cmap_g, cmap_g_del);
diff --git a/examples/ex_gaussian.c b/examples/ex_gaussian.c index a5137614..bfc40363 100644 --- a/examples/ex_gaussian.c +++ b/examples/ex_gaussian.c @@ -14,7 +14,7 @@ static int compare(cmap_i_entry_t *a, cmap_i_entry_t *b) { return c_default_compare(&a->first, &b->first);
}
// Vector: typetag 'e' for (map) entry
-using_cvec(e, cmap_i_entry_t, c_default_del, compare);
+using_cvec(e, cmap_i_entry_t, compare);
int main()
{
diff --git a/examples/inits.c b/examples/inits.c index 28b54835..9138c5bb 100644 --- a/examples/inits.c +++ b/examples/inits.c @@ -14,8 +14,8 @@ inline static int ipair_compare(const ipair_t* a, const ipair_t* b) { return cx == 0 ? c_default_compare(&a->y, &b->y) : cx;
}
-using_cvec(ip, ipair_t, c_default_del, ipair_compare);
-using_clist(ip, ipair_t, c_default_del, ipair_compare);
+using_cvec(ip, ipair_t, ipair_compare);
+using_clist(ip, ipair_t, ipair_compare);
using_cvec(f, float);
using_cpque(f, cvec_f, >);
diff --git a/examples/ptr.c b/examples/ptr.c index b32fdb33..a9c4d258 100644 --- a/examples/ptr.c +++ b/examples/ptr.c @@ -17,13 +17,13 @@ int Person_compare(const Person* p, const Person* q) { return cmp == 0 ? strcmp(p->last.str, q->last.str) : cmp;
}
-using_cvec(pe, Person, Person_del, Person_compare);
+using_cvec(pe, Person, Person_compare, Person_del);
-using_cptr(pu, Person, Person_del, Person_compare);
-using_cvec(pu, Person*, cptr_pu_del, cptr_pu_compare);
+using_cptr(pu, Person, Person_compare, Person_del);
+using_cvec(pu, Person*, cptr_pu_compare, cptr_pu_del);
-using_csptr(ps, Person, Person_del, Person_compare);
-using_cvec(ps, csptr_ps, csptr_ps_del, csptr_ps_compare);
+using_csptr(ps, Person, Person_compare, Person_del);
+using_cvec(ps, csptr_ps, csptr_ps_compare, csptr_ps_del);
const char* names[] = {
diff --git a/examples/share_ptr.c b/examples/share_ptr.c index 2ec2470e..785333d0 100644 --- a/examples/share_ptr.c +++ b/examples/share_ptr.c @@ -19,9 +19,9 @@ int Person_compare(const Person* p, const Person* q) { return cmp == 0 ? strcmp(p->last.str, q->last.str) : cmp;
}
-using_csptr(pe, Person, Person_del, Person_compare);
-using_clist(pe, csptr_pe, csptr_pe_del, csptr_pe_compare);
-using_cvec(pe, csptr_pe, csptr_pe_del, csptr_pe_compare);
+using_csptr(pe, Person, Person_compare, Person_del);
+using_clist(pe, csptr_pe, csptr_pe_compare, csptr_pe_del);
+using_cvec(pe, csptr_pe, csptr_pe_compare, csptr_pe_del);
int main() {
clist_pe queue = clist_pe_init();
diff --git a/examples/share_ptr2.c b/examples/share_ptr2.c index 65240969..34abcd74 100644 --- a/examples/share_ptr2.c +++ b/examples/share_ptr2.c @@ -13,7 +13,7 @@ void Person_del(Person* p) { c_del(cstr, &p->name, &p->last);
}
-using_csptr(ps, Person, Person_del, c_no_compare);
+using_csptr(ps, Person, c_no_compare, Person_del);
using_cmap(ps, int, csptr_ps, csptr_ps_del);
|
