From 08312fe8bffa7c0fb59612a6fb6b6f463cae6d9b Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylo-work@users.noreply.github.com> Date: Tue, 24 Mar 2020 19:22:39 +0100 Subject: Update EXAMPLE.md --- EXAMPLE.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index efdf1800..9c901995 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -29,8 +29,6 @@ void person_destroy(struct Person* p) { cstring_destroy(&p->surname); } -#define person_compareVal(x, y) person_compare(&x, &y) - int person_compare(struct Person* x, struct Person* y) { int c; c = strcmp(x->name.str, y->name.str); if (c != 0) return c; @@ -54,7 +52,7 @@ size_t person_hash(const struct Person* p, size_t ignore) { With this in place, you can instantiate a CMap with Person => CString: ``` #include -declare_CMap(ex, struct Person, CString, cstring_destroy, person_hash, person_compareVal, person_destroy); +declare_CMap(ex, struct Person, CString, cstring_destroy, person_hash, person_compare, person_destroy); int main() { -- cgit v1.2.3