diff options
| -rw-r--r-- | EXAMPLE.md | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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 <c_lib/CMap.h>
-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()
{
|
