X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Fhash.c;h=07936f8c4e3a72d879a0748c4b2b54dd245deaa4;hb=a4d60858fc3c717ec83cbdceb029a69fc535e3f8;hp=9f6bbe9015f9023cbaac648d24e54d623c52a584;hpb=f0f333f45536802923a359d930d1dcfd5b4589ea;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/hash.c b/x2p/hash.c index 9f6bbe9..07936f8 100644 --- a/x2p/hash.c +++ b/x2p/hash.c @@ -1,6 +1,7 @@ /* $RCSfile: hash.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:20 $ * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, + * by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -13,6 +14,10 @@ #include "a2p.h" #include "util.h" +#ifdef NETWARE +char *savestr(char *str); +#endif + STR * hfetch(register HASH *tb, char *key) { @@ -65,7 +70,7 @@ hstore(register HASH *tb, char *key, STR *val) if (strNE(entry->hent_key,key)) /* is this it? */ continue; /*NOSTRICT*/ - Safefree(entry->hent_val); + safefree(entry->hent_val); entry->hent_val = val; return TRUE; } @@ -89,9 +94,7 @@ hstore(register HASH *tb, char *key, STR *val) #ifdef NOTUSED bool -hdelete(tb,key) -register HASH *tb; -char *key; +hdelete(register HASH *tb, char *key) { register char *s; register int i; @@ -139,7 +142,7 @@ hsplit(HASH *tb) register HENT **oentry; a = (HENT**) saferealloc((char*)tb->tbl_array, newsize * sizeof(HENT*)); - bzero((char*)&a[oldsize], oldsize * sizeof(HENT*)); /* zero second half */ + memset(&a[oldsize], 0, oldsize * sizeof(HENT*)); /* zero second half */ tb->tbl_max = --newsize; tb->tbl_array = a; @@ -173,13 +176,12 @@ hnew(void) tb->tbl_fill = 0; tb->tbl_max = 7; hiterinit(tb); /* so each() will start off right */ - bzero((char*)tb->tbl_array, 8 * sizeof(HENT*)); + memset(tb->tbl_array, 0, 8 * sizeof(HENT*)); return tb; } #ifdef NOTUSED -hshow(tb) -register HASH *tb; +hshow(register HASH *tb) { fprintf(stderr,"%5d %4d (%2d%%)\n", tb->tbl_max+1,