Mercurial > ~mikael > mcabber > hg
diff mcabber/connwrap/connwrap.c @ 235:f7f07794d2df
[/trunk] Changeset 248 by mikael
* Try to kill some warnings
author | mikael |
---|---|
date | Fri, 10 Jun 2005 18:42:38 +0000 |
parents | e19ad58c3cad |
children | 8ca708a0d550 |
line wrap: on
line diff
--- a/mcabber/connwrap/connwrap.c Fri Jun 10 17:52:44 2005 +0000 +++ b/mcabber/connwrap/connwrap.c Fri Jun 10 18:42:38 2005 +0000 @@ -277,7 +277,7 @@ rc = cw_connect(sockfd, serv_addr, addrlen, 0); else{ /* check if the socket is connected correctly */ int optlen = sizeof(int), optval; - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval, &optlen) || optval) + if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval, (socklen_t*)&optlen) || optval) return -1; } @@ -322,7 +322,7 @@ rc = connect(sockfd, serv_addr, addrlen); else{ /* check if the socket is connected correctly */ int optlen = sizeof(int), optval; - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval, &optlen) || optval) + if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval, (socklen_t*)&optlen) || optval) return -1; *state = 0; return 0; @@ -340,7 +340,7 @@ int rc; if(ssl) { - rc = accept(s, addr, addrlen); + rc = accept(s, addr, (socklen_t*)addrlen); if(!rc) { sslsock *p = addsock(s); @@ -352,7 +352,7 @@ return rc; } #endif - return accept(s, addr, addrlen); + return accept(s, addr, (socklen_t*)addrlen); } int cw_write(int fd, const void *buf, int count, int ssl) { @@ -360,7 +360,7 @@ sslsock *p; if(ssl) - if(p = getsock(fd)) + if((p = getsock(fd)) != NULL) return SSL_write(p->ssl, buf, count); #endif return write(fd, buf, count); @@ -371,13 +371,13 @@ sslsock *p; if(ssl) - if(p = getsock(fd)) + if((p = getsock(fd)) != NULL) return SSL_read(p->ssl, buf, count); #endif return read(fd, buf, count); } -int cw_close(int fd) { +void cw_close(int fd) { #ifdef HAVE_OPENSSL delsock(fd); #endif