fix compiler warning

This commit is contained in:
Yang Tse 2010-03-11 18:53:42 +00:00
parent 3709ffc700
commit 52cd332b95
4 changed files with 10 additions and 12 deletions

View File

@ -368,7 +368,7 @@ CARES_EXTERN int ares_fds(ares_channel channel,
fd_set *write_fds); fd_set *write_fds);
CARES_EXTERN int ares_getsock(ares_channel channel, CARES_EXTERN int ares_getsock(ares_channel channel,
int *socks, ares_socket_t *socks,
int numsocks); int numsocks);
CARES_EXTERN struct timeval *ares_timeout(ares_channel channel, CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,

View File

@ -14,25 +14,25 @@
.\" this software for any purpose. It is provided "as is" .\" this software for any purpose. It is provided "as is"
.\" without express or implied warranty. .\" without express or implied warranty.
.\" .\"
.TH ARES_GETSOCK 3 "22 December 2005" .TH ARES_GETSOCK 3 "11 March 2010"
.SH NAME .SH NAME
ares_getsock \- get file descriptors to wait on ares_getsock \- get socket descriptors to wait on
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <ares.h> .B #include <ares.h>
.PP .PP
.B int ares_getsock(ares_channel \fIchannel\fP, int *\fIsocks\fP, .B int ares_getsock(ares_channel \fIchannel\fP, ares_socket_t *\fIsocks\fP,
.B int \fInumsocks\fP); .B int \fInumsocks\fP);
.fi .fi
.SH DESCRIPTION .SH DESCRIPTION
The The
.B ares_getsock .B ares_getsock
function retrieves the set of file descriptors which the calling function retrieves the set of socket descriptors which the calling
application should wait on for reading and/or writing for the application should wait on for reading and/or writing for the
processing of name service queries pending on the name service channel processing of name service queries pending on the name service channel
identified by identified by
.IR channel . .IR channel .
File descriptors will be set in the integer array pointed to by Socket descriptors will be set in the socket descriptor array pointed to by
\fIsocks\fP. \fIsocks\fP.
\fInumsocks\fP is the size of the given array in number of ints. \fInumsocks\fP is the size of the given array in number of ints.

View File

@ -1,6 +1,6 @@
/* $Id$ */ /* $Id$ */
/* Copyright (C) 2005 - 2007, Daniel Stenberg /* Copyright (C) 2005 - 2010, Daniel Stenberg
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided * documentation for any purpose and without fee is hereby granted, provided
@ -23,7 +23,7 @@
#include "ares_private.h" #include "ares_private.h"
int ares_getsock(ares_channel channel, int ares_getsock(ares_channel channel,
int *s, ares_socket_t *socks,
int numsocks) /* size of the 'socks' array */ int numsocks) /* size of the 'socks' array */
{ {
struct server_state *server; struct server_state *server;
@ -32,8 +32,6 @@ int ares_getsock(ares_channel channel,
int bitmap = 0; int bitmap = 0;
unsigned int setbits = 0xffffffff; unsigned int setbits = 0xffffffff;
ares_socket_t *socks = (ares_socket_t *)s;
/* Are there any active queries? */ /* Are there any active queries? */
int active_queries = !ares__is_list_empty(&(channel->all_queries)); int active_queries = !ares__is_list_empty(&(channel->all_queries));

View File

@ -105,7 +105,7 @@ int Curl_resolv_getsock(struct connectdata *conn,
struct timeval timebuf; struct timeval timebuf;
struct timeval *timeout; struct timeval *timeout;
int max = ares_getsock(conn->data->state.areschannel, int max = ares_getsock(conn->data->state.areschannel,
(int *)socks, numsocks); (ares_socket_t *)socks, numsocks);
maxtime.tv_sec = CURL_TIMEOUT_RESOLVE; maxtime.tv_sec = CURL_TIMEOUT_RESOLVE;
@ -134,7 +134,7 @@ static int waitperform(struct connectdata *conn, int timeout_ms)
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
int nfds; int nfds;
int bitmask; int bitmask;
int socks[ARES_GETSOCK_MAXNUM]; ares_socket_t socks[ARES_GETSOCK_MAXNUM];
struct pollfd pfd[ARES_GETSOCK_MAXNUM]; struct pollfd pfd[ARES_GETSOCK_MAXNUM];
int i; int i;
int num = 0; int num = 0;