X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fhash.c;h=dff84a67801f435de9484622cbf1964e257f553b;hb=3e4f58e4164e4ebb18e3c4df11200c6e72a107e6;hp=a2801b06fb543b3215022370d98619a2bb4b0fdf;hpb=0df6a7610307e8044b1b72298198a8eb83977565;p=ngircd-alex.git diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c index a2801b06..dff84a67 100644 --- a/src/ngircd/hash.c +++ b/src/ngircd/hash.c @@ -2,21 +2,20 @@ * ngIRCd -- The Next Generation IRC Daemon * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * - * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen - * der GNU General Public License (GPL), wie von der Free Software Foundation - * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 - * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. - * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste - * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: hash.c,v 1.3 2002/03/22 00:21:51 alex Exp $ - * - * hash.c: Hash-Werte berechnen + * Hash calculation */ #include "portab.h" +static char UNUSED id[] = "$Id: hash.c,v 1.6 2002/12/12 12:24:18 alex Exp $"; + #include "imp.h" #include #include @@ -29,10 +28,11 @@ #include "hash.h" -LOCAL UINT32 jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval); +LOCAL UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval )); -GLOBAL UINT32 Hash( CHAR *String ) +GLOBAL UINT32 +Hash( CHAR *String ) { /* Hash-Wert ueber String berechnen */ @@ -41,7 +41,7 @@ GLOBAL UINT32 Hash( CHAR *String ) strncpy( buffer, String, LINE_LEN - 1 ); buffer[LINE_LEN - 1] = '\0'; - return jenkins_hash( ngt_LowerStr( buffer ), strlen( buffer ), 42 ); + return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 ); } /* Hash */ @@ -75,7 +75,8 @@ GLOBAL UINT32 Hash( CHAR *String ) } /* mix */ -LOCAL UINT32 jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval) +LOCAL UINT32 +jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval ) { /* k: the key * length: length of the key