X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/edbd1fa554d38a3f19ff970c944800ddf36ac396..327ba4d7676807137f3ba3026d1d55f0b17a9bfd:/test-ohash.c diff --git a/test-ohash.c b/test-ohash.c index 72b3e3dd..522ad708 100644 --- a/test-ohash.c +++ b/test-ohash.c @@ -3,16 +3,18 @@ #include #include -void *xalloc(size_t sz, void *arg) { return(calloc(sz,1)); } -void xfree(void *p, size_t sz, void *arg) { free(p); } +void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); } +void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); } +void xfree(void *p, void *arg) { free(p); } int main(void) { struct ohash h; struct ohash_info i; - i.halloc = i.alloc = xalloc; - i.free = free; + i.alloc = xmalloc; + i.calloc = xcalloc; + i.free = xfree; ohash_init(&h, 2, &i); ohash_delete(&h); return 0;