X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fhash.c;h=1b2f4e678b412df818c53d81a7c7c91dc2f753f6;hb=a4d7c6f14594e1331885ff83afd584f7573c1a6c;hp=351c547a6e023be39352f4d420c85dacb82ab0d3;hpb=8adff5922376676c2eeb49de1cbab86cc345b887;p=ngircd-alex.git diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c index 351c547a..1b2f4e67 100644 --- a/src/ngircd/hash.c +++ b/src/ngircd/hash.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2009 Alexander Barton (alex@barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: hash.c,v 1.11 2005/03/19 18:43:48 fw Exp $"; +static char UNUSED id[] = "$Id: hash.c,v 1.13 2006/10/06 21:23:47 fw Exp $"; #include "imp.h" #include @@ -27,18 +27,19 @@ static char UNUSED id[] = "$Id: hash.c,v 1.11 2005/03/19 18:43:48 fw Exp $"; #include "hash.h" -LOCAL UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval )); +static UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval )); GLOBAL UINT32 -Hash( char *String ) +Hash( const char *String ) { /* Hash-Wert ueber String berechnen */ char buffer[LINE_LEN]; - strlcpy( buffer, String, sizeof( buffer )); - return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 ); + strlcpy(buffer, String, sizeof(buffer)); + return jenkins_hash((UINT8 *)ngt_LowerStr(buffer), + (UINT32)strlen(buffer), 42); } /* Hash */ @@ -72,7 +73,7 @@ Hash( char *String ) } /* mix */ -LOCAL UINT32 +static UINT32 jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval ) { /* k: the key