=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/look.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/m4/look.c 2010/09/07 19:58:09 1.22 --- src/usr.bin/m4/look.c 2014/05/12 19:11:19 1.23 *************** *** 1,4 **** ! /* $OpenBSD: look.c,v 1.22 2010/09/07 19:58:09 marco Exp $ */ /* * Copyright (c) 1989, 1993 --- 1,4 ---- ! /* $OpenBSD: look.c,v 1.23 2014/05/12 19:11:19 espie Exp $ */ /* * Copyright (c) 1989, 1993 *************** *** 48,90 **** #include "stdd.h" #include "extern.h" ! static void *hash_alloc(size_t, void *); ! static void hash_free(void *, size_t, void *); static void *element_alloc(size_t, void *); static void setup_definition(struct macro_definition *, const char *, const char *); static struct ohash_info macro_info = { offsetof(struct ndblock, name), ! NULL, hash_alloc, hash_free, element_alloc }; struct ohash macros; /* Support routines for hash tables. */ void * ! hash_alloc(s, u) ! size_t s; ! void *u UNUSED; { ! void *storage = xalloc(s, "hash alloc"); ! if (storage) ! memset(storage, 0, s); return storage; } void ! hash_free(p, s, u) ! void *p; ! size_t s UNUSED; ! void *u UNUSED; { free(p); } void * ! element_alloc(s, u) ! size_t s; ! void *u UNUSED; { return xalloc(s, "element alloc"); } --- 48,81 ---- #include "stdd.h" #include "extern.h" ! static void *hash_calloc(size_t, size_t, void *); ! static void hash_free(void *, void *); static void *element_alloc(size_t, void *); static void setup_definition(struct macro_definition *, const char *, const char *); static struct ohash_info macro_info = { offsetof(struct ndblock, name), ! NULL, hash_calloc, hash_free, element_alloc }; struct ohash macros; /* Support routines for hash tables. */ void * ! hash_calloc(size_t n, size_t s, void *u UNUSED) { ! void *storage = xcalloc(n, s, "hash alloc"); return storage; } void ! hash_free(void *p, void *u UNUSED) { free(p); } void * ! element_alloc(size_t s, void *u UNUSED) { return xalloc(s, "element alloc"); }