From c3dfd63bf3213a5a68d890d3e7cb38fe94a55cb6 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 21 Apr 2003 10:52:26 +0000 Subject: [PATCH] Fixed up some castings. --- src/ngircd/conn-zip.c | 10 +++++----- src/ngircd/conn.c | 9 +++++---- src/ngircd/resolve.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/ngircd/conn-zip.c b/src/ngircd/conn-zip.c index afdfd5d2..02a3c253 100644 --- a/src/ngircd/conn-zip.c +++ b/src/ngircd/conn-zip.c @@ -19,7 +19,7 @@ #ifdef USE_ZLIB -static char UNUSED id[] = "$Id: conn-zip.c,v 1.2 2002/12/30 17:15:06 alex Exp $"; +static char UNUSED id[] = "$Id: conn-zip.c,v 1.3 2003/04/21 10:52:26 alex Exp $"; #include "imp.h" #include @@ -114,9 +114,9 @@ Zip_Flush( CONN_ID Idx ) out = &My_Connections[Idx].zip.out; - out->next_in = My_Connections[Idx].zip.wbuf; + out->next_in = (VOID *)My_Connections[Idx].zip.wbuf; out->avail_in = My_Connections[Idx].zip.wdatalen; - out->next_out = My_Connections[Idx].wbuf + My_Connections[Idx].wdatalen; + out->next_out = (VOID *)(My_Connections[Idx].wbuf + My_Connections[Idx].wdatalen); out->avail_out = WRITEBUFFER_LEN - My_Connections[Idx].wdatalen; result = deflate( out, Z_SYNC_FLUSH ); @@ -153,9 +153,9 @@ Unzip_Buffer( CONN_ID Idx ) in = &My_Connections[Idx].zip.in; - in->next_in = My_Connections[Idx].zip.rbuf; + in->next_in = (VOID *)My_Connections[Idx].zip.rbuf; in->avail_in = My_Connections[Idx].zip.rdatalen; - in->next_out = My_Connections[Idx].rbuf + My_Connections[Idx].rdatalen; + in->next_out = (VOID *)(My_Connections[Idx].rbuf + My_Connections[Idx].rdatalen); in->avail_out = READBUFFER_LEN - My_Connections[Idx].rdatalen - 1; result = inflate( in, Z_SYNC_FLUSH ); diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index ba37676a..d35a0917 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -16,7 +16,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: conn.c,v 1.121 2003/03/31 15:54:21 alex Exp $"; +static char UNUSED id[] = "$Id: conn.c,v 1.122 2003/04/21 10:52:26 alex Exp $"; #include "imp.h" #include @@ -798,6 +798,7 @@ Handle_Write( CONN_ID Idx ) /* Daten aus Schreibpuffer versenden bzw. Connection aufbauen */ INT len, res, err; + socklen_t sock_len; CLIENT *c; assert( Idx > NONE ); @@ -811,9 +812,9 @@ Handle_Write( CONN_ID Idx ) FD_CLR( My_Connections[Idx].sock, &My_Connects ); /* Ergebnis des connect() ermitteln */ - len = sizeof( err ); - res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &len ); - assert( len == sizeof( err )); + sock_len = sizeof( err ); + res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &sock_len ); + assert( sock_len == sizeof( err )); /* Fehler aufgetreten? */ if(( res != 0 ) || ( err != 0 )) diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index c833609a..aeb98ba6 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: resolve.c,v 1.5 2002/12/26 17:04:54 alex Exp $"; +static char UNUSED id[] = "$Id: resolve.c,v 1.6 2003/04/21 10:52:51 alex Exp $"; #include "imp.h" #include @@ -186,7 +186,7 @@ Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd ) } /* Antwort an Parent schreiben */ - if( write( w_fd, hostname, strlen( hostname ) + 1 ) != ( strlen( hostname ) + 1 )) + if( (size_t)write( w_fd, hostname, strlen( hostname ) + 1 ) != (size_t)( strlen( hostname ) + 1 )) { Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno )); close( w_fd ); @@ -226,7 +226,7 @@ Do_ResolveName( CHAR *Host, INT w_fd ) } /* Antwort an Parent schreiben */ - if( write( w_fd, ip, strlen( ip ) + 1 ) != ( strlen( ip ) + 1 )) + if( (size_t)write( w_fd, ip, strlen( ip ) + 1 ) != (size_t)( strlen( ip ) + 1 )) { Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno )); close( w_fd ); -- 2.39.2