chiark / gitweb /
Various manual fixes.
[mLib] / assoc-test.c
index fc1f82eff56fc7d7f13f5d349b09684782763794..59498577b6ab33565554fe41498026ea7691f443 100644 (file)
@@ -14,7 +14,7 @@ static int cmp(const void *a, const void *b)
 {
   const word *const *v = b;
   const word *const *w = a;
-  return (strcmp(ATOM_NAME((*w)->_b.a), ATOM_NAME((*v)->_b.a)));
+  return (strcmp(ATOM_NAME(ASSOC_ATOM(*w)), ATOM_NAME(ASSOC_ATOM(*v))));
 }
 
 int main(void)
@@ -74,9 +74,9 @@ int main(void)
        for (vv = v, assoc_mkiter(&i, &t); (w = assoc_next(&i)) != 0; vv++)
          *vv = w;
        qsort(v, n, sizeof(*v), cmp);
-       printf("%s:%i", ATOM_NAME((*v)->_b.a), (*v)->i);
+       printf("%s:%i", ATOM_NAME(ASSOC_ATOM(*v)), (*v)->i);
        for (vv = v + 1; --n; vv++)
-         printf(" %s:%i", ATOM_NAME((*vv)->_b.a), (*vv)->i);
+         printf(" %s:%i", ATOM_NAME(ASSOC_ATOM(*vv)), (*vv)->i);
        free(v);
        putchar('\n');
       }
@@ -85,5 +85,6 @@ int main(void)
   }
 
   assoc_destroy(&t);
+  atom_destroytable(&at);
   return (0);
 }