commit 95a4b1b1587f33692830153d6d03081b5e51d172 from: Alexander Barton date: Mon Mar 25 19:11:01 2002 UTC - einige Anpassungen nach Code-Check mit SPLint ;-) commit - c0ef984273811ee3aa0358d101d604a77d04e059 commit + 95a4b1b1587f33692830153d6d03081b5e51d172 blob - e9d16a56d0ec88c597158290d33b7a5c7c4fa3f9 blob + 6728e5a6125849bdbfcc806447430d69290e5d06 --- src/ngircd/channel.h +++ src/ngircd/channel.h @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: channel.h,v 1.15 2002/03/25 16:55:14 alex Exp $ + * $Id: channel.h,v 1.16 2002/03/25 19:11:01 alex Exp $ * * channel.h: Management der Channels (Header) */ @@ -21,7 +21,7 @@ #include "client.h" -#ifdef __channel_c__ +#if defined(__channel_c__) | defined(S_SPLINT_S) #include "defines.h" blob - b4c8dd5eabf350e2bb9665bdcd75174eb9e14281 blob + 1d08f47650ff02106191207d859bb503d7d2fbd8 --- src/ngircd/client.c +++ src/ngircd/client.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: client.c,v 1.51 2002/03/25 16:59:36 alex Exp $ + * $Id: client.c,v 1.52 2002/03/25 19:11:01 alex Exp $ * * client.c: Management aller Clients * @@ -105,7 +105,7 @@ GLOBAL VOID Client_Exit( VOID ) while( c ) { cnt++; - next = c->next; + next = (CLIENT *)c->next; free( c ); c = next; } @@ -169,7 +169,7 @@ GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introd if( strchr( client->modes, 'a' )) strcpy( client->away, DEFAULT_AWAY_MSG ); /* Verketten */ - client->next = My_Clients; + client->next = (POINTER *)My_Clients; My_Clients = client; return client; @@ -209,7 +209,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogM { /* Wir haben den Client gefunden: entfernen */ if( last ) last->next = c->next; - else My_Clients = c->next; + else My_Clients = (CLIENT *)c->next; if( c->type == CLIENT_USER ) { @@ -274,7 +274,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogM break; } last = c; - c = c->next; + c = (CLIENT *)c->next; } } /* Client_Destroy */ @@ -478,7 +478,7 @@ GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx ) while( c ) { if( c->conn_id == Idx ) return c; - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_GetFromConn */ @@ -511,7 +511,7 @@ GLOBAL CLIENT *Client_Search( CHAR *Nick ) /* lt. Hash-Wert: Treffer! */ if( strcasecmp( c->id, search_id ) == 0 ) return c; } - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_Search */ @@ -532,7 +532,7 @@ GLOBAL CLIENT *Client_GetFromToken( CLIENT *Client, IN while( c ) { if(( c->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c->token == Token )) return c; - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_GetFromToken */ @@ -575,7 +575,7 @@ GLOBAL CHAR *Client_Info( CLIENT *Client ) GLOBAL CHAR *Client_User( CLIENT *Client ) { assert( Client != NULL ); - if( Client->user ) return Client->user; + if( Client->user[0] ) return Client->user; else return "~"; } /* Client_User */ @@ -741,7 +741,7 @@ GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *I Conn_Close( Client->conn_id, str, str, TRUE ); return FALSE; } - c = c->next; + c = (CLIENT *)c->next; } return TRUE; @@ -762,7 +762,7 @@ GLOBAL CLIENT *Client_Next( CLIENT *c ) * so wird NULL geliefert. */ assert( c != NULL ); - return c->next; + return (CLIENT *)c->next; } /* Client_Next */ @@ -812,7 +812,7 @@ GLOBAL INT Client_OperCount( VOID ) while( c ) { if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* Client_OperCount */ @@ -828,7 +828,7 @@ GLOBAL INT Client_UnknownCount( VOID ) while( c ) { if( c && ( c->type != CLIENT_USER ) && ( c->type != CLIENT_SERVICE ) && ( c->type != CLIENT_SERVER )) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* Client_UnknownCount */ @@ -868,7 +868,7 @@ LOCAL INT Count( CLIENT_TYPE Type ) while( c ) { if( c && ( c->type == Type )) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* Count */ @@ -884,7 +884,7 @@ LOCAL INT MyCount( CLIENT_TYPE Type ) while( c ) { if( c && ( c->introducer == This_Server ) && ( c->type == Type )) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* MyCount */ @@ -941,7 +941,7 @@ LOCAL VOID Generate_MyToken( CLIENT *Client ) c = My_Clients; continue; } - else c = c->next; + else c = (CLIENT *)c->next; } Client->mytoken = token; Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id ); blob - d377d828f1a868cb880217e8bb58fc3bf5d5a9b6 blob + 853ac31362080811138a161df594d38cdd8ecb24 --- src/ngircd/client.h +++ src/ngircd/client.h @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: client.h,v 1.26 2002/03/25 17:01:07 alex Exp $ + * $Id: client.h,v 1.27 2002/03/25 19:11:01 alex Exp $ * * client.h: Konfiguration des ngircd (Header) */ @@ -35,7 +35,7 @@ typedef enum } CLIENT_TYPE; -#ifdef __client_c__ +#if defined(__client_c__) | defined(S_SPLINT_S) #include "defines.h" blob - df93b28b79ad5930ba21bd5462054c7b2d14bb23 blob + 9db611a1876975a6e0010f4c4421adad3f90c97b --- src/ngircd/conf.c +++ src/ngircd/conf.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: conf.c,v 1.19 2002/03/25 16:14:15 alex Exp $ + * $Id: conf.c,v 1.20 2002/03/25 19:11:01 alex Exp $ * * conf.h: Konfiguration des ngircd */ @@ -170,7 +170,7 @@ LOCAL VOID Read_Config( VOID ) GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg ) { CHAR *ptr; - INT port; + INT32 port; assert( Line > 0 ); assert( Var != NULL ); @@ -209,7 +209,7 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR * if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Log( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port ); else { - if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = port; + if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = (INT)port; else Log( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", Conf_File, Line, port ); } ptr = strtok( NULL, "," ); blob - a2801b06fb543b3215022370d98619a2bb4b0fdf blob + 876b92f5e41c18fc222151dc28a573839ea4677a --- src/ngircd/hash.c +++ src/ngircd/hash.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: hash.c,v 1.3 2002/03/22 00:21:51 alex Exp $ + * $Id: hash.c,v 1.4 2002/03/25 19:11:01 alex Exp $ * * hash.c: Hash-Werte 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 */ blob - 452c045e7606fc20eeed402287197001be859c01 blob + b10f3c4fcd50a1f0e11477934523d8c2df300822 --- src/ngircd/log.c +++ src/ngircd/log.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: log.c,v 1.22 2002/03/21 12:00:23 alex Exp $ + * $Id: log.c,v 1.23 2002/03/25 19:11:01 alex Exp $ * * log.c: Logging-Funktionen */ @@ -85,7 +85,7 @@ GLOBAL VOID Log_Init( VOID ) if( ! freopen( ERROR_FILE, "a+", stderr )) Log( LOG_ERR, "Can't reopen stderr (\""ERROR_FILE"\"): %s", strerror( errno )); fprintf( stderr, "\n--- %s ---\n\n", NGIRCd_StartStr ); - fprintf( stderr, "%s started.\npid=%d, ppid=%d, uid=%d, gid=%d [euid=%d, egid=%d].\nActivating: %s\n\n", NGIRCd_Version( ), getpid( ), getppid( ), getuid( ), getgid( ), geteuid( ), getegid( ), txt[0] ? txt : "-" ); + fprintf( stderr, "%s started.\npid=%ld, ppid=%ld, uid=%ld, gid=%ld [euid=%ld, egid=%ld].\nActivating: %s\n\n", NGIRCd_Version( ), (INT32)getpid( ), (INT32)getppid( ), (INT32)getuid( ), (INT32)getgid( ), (INT32)geteuid( ), (INT32)getegid( ), txt[0] ? txt : "-" ); fflush( stderr ); } /* Log_Init */ @@ -99,7 +99,7 @@ GLOBAL VOID Log_Exit( VOID ) t = time( NULL ); fputs( ctime( &t ), stderr ); - fprintf( stderr, PACKAGE" done (pid=%d).\n", getpid( )); + fprintf( stderr, PACKAGE" done (pid=%ld).\n", (INT32)getpid( )); fflush( stderr ); #ifdef USE_SYSLOG blob - 120589a8225a0aacb956b70760d4930e0b6cecc8 blob + ceadd32800c30a95add85dbf1bb30cb9c11da0e3 --- src/ngircd/ngircd.c +++ src/ngircd/ngircd.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: ngircd.c,v 1.34 2002/03/12 22:08:24 alex Exp $ + * $Id: ngircd.c,v 1.35 2002/03/25 19:11:01 alex Exp $ * * ngircd.c: Hier beginnt alles ;-) */ @@ -50,10 +50,11 @@ LOCAL VOID Show_Version( VOID ); LOCAL VOID Show_Help( VOID ); -GLOBAL INT main( INT argc, CONST CHAR *argv[] ) +GLOBAL int main( int argc, const char *argv[] ) { BOOLEAN ok; - INT pid, i, n; + INT32 pid, n; + INT i; NGIRCd_Restart = FALSE; NGIRCd_Quit = FALSE; @@ -114,7 +115,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] ) { /* Kurze Option */ - for( n = 1; n < strlen( argv[i] ); n++ ) + for( n = 1; n < (INT32)strlen( argv[i] ); n++ ) { ok = FALSE; #ifdef DEBUG @@ -177,7 +178,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] ) if( ! NGIRCd_NoDaemon ) { /* Daemon im Hintergrund erzeugen */ - pid = fork( ); + pid = (INT32)fork( ); if( pid > 0 ) { /* "alter" Prozess */ @@ -191,13 +192,13 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] ) } /* Child-Prozess initialisieren */ - setsid( ); + (VOID)setsid( ); chdir( "/" ); } /* Globale Variablen initialisieren */ NGIRCd_Start = time( NULL ); - strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start )); + (VOID)strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start )); NGIRCd_Restart = FALSE; NGIRCd_Quit = FALSE;