X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fhash.c;h=d9aa79bb1f1b93478a9f1dd7c0e135ac7ed62408;hp=820c8f684adcd1ebf85969718b6c277d78850aa6;hb=4e56e5341f632827af3810e26cd59ac0c15b642b;hpb=0ced4181b032249a5ccab2a6ae1d61bf08f60293 diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c index 820c8f68..d9aa79bb 100644 --- a/src/ngircd/hash.c +++ b/src/ngircd/hash.c @@ -14,29 +14,28 @@ #include "portab.h" -static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $"; +static char UNUSED id[] = "$Id: hash.c,v 1.13 2006/10/06 21:23:47 fw Exp $"; #include "imp.h" #include #include #include "defines.h" -#include "log.h" #include "tool.h" #include "exp.h" #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]; + char buffer[LINE_LEN]; strlcpy( buffer, String, sizeof( buffer )); return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 ); @@ -73,7 +72,7 @@ Hash( CHAR *String ) } /* mix */ -LOCAL UINT32 +static UINT32 jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval ) { /* k: the key @@ -100,7 +99,7 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval /* handle the last 11 bytes */ c += length; - switch( (INT)len ) /* all the case statements fall through */ + switch( (int)len ) /* all the case statements fall through */ { case 11: c+=((UINT32)k[10]<<24); case 10: c+=((UINT32)k[9]<<16);