gcc 4.4.1 compiler warning fix

svn: r18090
This commit is contained in:
Kevin Tew 2010-02-15 20:31:24 +00:00
parent df51f39987
commit b865bb7868

View File

@ -1726,9 +1726,11 @@ tcp_connect_break(int argc, Scheme_Object *argv[])
static unsigned short get_no_portno(tcp_t socket, int *_errid) static unsigned short get_no_portno(tcp_t socket, int *_errid)
{ {
char here[MZ_SOCK_NAME_MAX_LEN]; char here[MZ_SOCK_NAME_MAX_LEN];
struct sockaddr_in *addr_in;
unsigned int l = sizeof(here); unsigned int l = sizeof(here);
unsigned short no_port; unsigned short no_port;
if (getsockname(socket, (struct sockaddr *)here, &l)) { if (getsockname(socket, (struct sockaddr *)here, &l)) {
int errid; int errid;
errid = SOCK_ERRNO(); errid = SOCK_ERRNO();
@ -1737,7 +1739,8 @@ static unsigned short get_no_portno(tcp_t socket, int *_errid)
} }
/* don't use ntohs, since the result is put back into another sin_port: */ /* don't use ntohs, since the result is put back into another sin_port: */
no_port = ((struct sockaddr_in *)here)->sin_port; addr_in = (struct sockaddr_in *)here;
no_port = addr_in->sin_port;
if (!no_port) if (!no_port)
*_errid = 0; *_errid = 0;
return no_port; return no_port;