From 6a45dc4a35b2025d6bbebf0ae2b19b94387882f6 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 2 Sep 2020 15:36:28 +0200 Subject: cleanup hashtab --- hashtab.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hashtab.c') diff --git a/hashtab.c b/hashtab.c index ea097ad..be5e3d3 100644 --- a/hashtab.c +++ b/hashtab.c @@ -134,7 +134,7 @@ hash_free(struct hash_tab *ht) } } -int +static int getword(FILE *fp, char *buf, int size, int first(int), int rest(int)) { int i = 0, c; @@ -163,19 +163,19 @@ getword(FILE *fp, char *buf, int size, int first(int), int rest(int)) return c > 0; } -int +static int first(int c) { return isalpha(c); } -int +static int rest(int c) { return isalpha(c) || c == '_'; } -void +static void print(const char *key, T data, void *cl) { fprintf(cl, "%s: %d\n", key, data); @@ -190,7 +190,7 @@ main() hash_init(ht); while ( getword(stdin, word, sizeof word, first, rest) ) { - int *p = hash_lookup(ht, word, 0, 1); + T *p = hash_lookup(ht, word, 0, 1); if ( p != NULL ) ++(*p); } -- cgit v1.3