COMP: Remove warnings on borland build

This commit is contained in:
Andy Cedilnik 2004-10-13 10:45:30 -04:00
parent 3f75f0ea1e
commit 68c3550faa
15 changed files with 48 additions and 31 deletions

View File

@ -215,6 +215,7 @@ CURLcode Curl_dict(struct connectdata *conn)
return result; return result;
} }
} }
(void)nthdef;
return CURLE_OK; return CURLE_OK;
} }

View File

@ -374,7 +374,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
FormInfo *first_form, *current_form, *form = NULL; FormInfo *first_form, *current_form, *form = NULL;
CURLFORMcode return_value = CURL_FORMADD_OK; CURLFORMcode return_value = CURL_FORMADD_OK;
const char *prevtype = NULL; const char *prevtype = NULL;
struct curl_httppost *post = NULL; struct curl_httppost *post;
CURLformoption option; CURLformoption option;
struct curl_forms *forms = NULL; struct curl_forms *forms = NULL;
char *array_value=NULL; /* value read from an array */ char *array_value=NULL; /* value read from an array */

View File

@ -276,7 +276,6 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
*nreadp=0; *nreadp=0;
perline=0; perline=0;
keepon=TRUE;
while((*nreadp<BUFSIZE) && (keepon && !result)) { while((*nreadp<BUFSIZE) && (keepon && !result)) {
/* check and reset timeout value every lap */ /* check and reset timeout value every lap */
@ -913,7 +912,7 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
static static
CURLcode ftp_getfiletime(struct connectdata *conn, char *file) CURLcode ftp_getfiletime(struct connectdata *conn, char *file)
{ {
CURLcode result=CURLE_OK; CURLcode result;
int ftpcode; /* for ftp status */ int ftpcode; /* for ftp status */
ssize_t nread; ssize_t nread;
char *buf = conn->data->state.buffer; char *buf = conn->data->state.buffer;
@ -1050,7 +1049,7 @@ static
CURLcode ftp_use_port(struct connectdata *conn) CURLcode ftp_use_port(struct connectdata *conn)
{ {
struct SessionHandle *data=conn->data; struct SessionHandle *data=conn->data;
curl_socket_t portsock= CURL_SOCKET_BAD; curl_socket_t portsock;
ssize_t nread; ssize_t nread;
int ftpcode; /* receive FTP response codes in this */ int ftpcode; /* receive FTP response codes in this */
CURLcode result; CURLcode result;
@ -1306,6 +1305,7 @@ CURLcode ftp_use_port(struct connectdata *conn)
int rc = Curl_resolv(conn, myhost, 0, &h); int rc = Curl_resolv(conn, myhost, 0, &h);
if(rc == CURLRESOLV_PENDING) if(rc == CURLRESOLV_PENDING)
rc = Curl_wait_for_resolv(conn, &h); rc = Curl_wait_for_resolv(conn, &h);
(void)rc;
if(h) { if(h) {
addr = h->addr; addr = h->addr;
/* when we return from this function, we can forget about this entry /* when we return from this function, we can forget about this entry
@ -1625,6 +1625,7 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
} }
#endif /* CURL_DISABLE_HTTP */ #endif /* CURL_DISABLE_HTTP */
(void)rc;
return CURLE_OK; return CURLE_OK;
} }
@ -1724,6 +1725,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
/* no data to transfer */ /* no data to transfer */
result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL); result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
(void)result;
/* Set no_transfer so that we won't get any error in /* Set no_transfer so that we won't get any error in
* Curl_ftp_done() because we didn't transfer anything! */ * Curl_ftp_done() because we didn't transfer anything! */
@ -1791,7 +1793,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
if(conn->bits.use_range && conn->range) { if(conn->bits.use_range && conn->range) {
curl_off_t from, to; curl_off_t from, to;
curl_off_t totalsize=-1; curl_off_t totalsize;
char *ptr; char *ptr;
char *ptr2; char *ptr2;
@ -1924,6 +1926,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
if (downloadsize == 0) { if (downloadsize == 0) {
/* no data to transfer */ /* no data to transfer */
result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL); result=Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
(void)result;
infof(data, "File already completely downloaded\n"); infof(data, "File already completely downloaded\n");
/* Set no_transfer so that we won't get any error in Curl_ftp_done() /* Set no_transfer so that we won't get any error in Curl_ftp_done()
@ -2253,7 +2256,7 @@ CURLcode ftp_perform(struct connectdata *conn,
*/ */
CURLcode Curl_ftp(struct connectdata *conn) CURLcode Curl_ftp(struct connectdata *conn)
{ {
CURLcode retcode = CURLE_OK; CURLcode retcode;
if (conn->sec_conn) /* 3rd party transfer */ if (conn->sec_conn) /* 3rd party transfer */
retcode = ftp_3rdparty(conn); retcode = ftp_3rdparty(conn);
@ -2279,7 +2282,7 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
char s[256]; char s[256];
size_t write_len; size_t write_len;
char *sptr=s; char *sptr=s;
CURLcode res = CURLE_OK; CURLcode res;
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
@ -2381,7 +2384,7 @@ CURLcode Curl_ftp_disconnect(struct connectdata *conn)
*/ */
static CURLcode ftp_mkd(struct connectdata *conn, char *path) static CURLcode ftp_mkd(struct connectdata *conn, char *path)
{ {
CURLcode result=CURLE_OK; CURLcode result;
int ftpcode; /* for ftp status */ int ftpcode; /* for ftp status */
ssize_t nread; ssize_t nread;
@ -2477,7 +2480,7 @@ static CURLcode ftp_cwd_and_mkd(struct connectdata *conn, char *path)
*/ */
static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn) static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn)
{ {
CURLcode result = CURLE_OK; CURLcode result;
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
struct connectdata *sec_conn = conn->sec_conn; struct connectdata *sec_conn = conn->sec_conn;
@ -2512,7 +2515,7 @@ static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn)
*/ */
static CURLcode ftp_3rdparty_transfer(struct connectdata *conn) static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
{ {
CURLcode result = CURLE_OK; CURLcode result;
ssize_t nread; ssize_t nread;
int ftpcode, ip[4], port[2]; int ftpcode, ip[4], port[2];
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
@ -2756,7 +2759,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn)
*/ */
static CURLcode ftp_3rdparty(struct connectdata *conn) static CURLcode ftp_3rdparty(struct connectdata *conn)
{ {
CURLcode retcode = CURLE_OK; CURLcode retcode;
conn->proto.ftp->ctl_valid = conn->sec_conn->proto.ftp->ctl_valid = TRUE; conn->proto.ftp->ctl_valid = conn->sec_conn->proto.ftp->ctl_valid = TRUE;
conn->size = conn->sec_conn->size = -1; conn->size = conn->sec_conn->size = -1;

View File

@ -428,6 +428,7 @@ union yyalloc
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
(void)yyptr; \
} \ } \
while (0) while (0)
@ -1767,6 +1768,7 @@ yyerrlab:
#endif /* YYERROR_VERBOSE */ #endif /* YYERROR_VERBOSE */
yyerror ("syntax error"); yyerror ("syntax error");
} }
(void)yynerrs;

View File

@ -385,7 +385,7 @@ int Curl_resolv(struct connectdata *conn,
int port, int port,
struct Curl_dns_entry **entry) struct Curl_dns_entry **entry)
{ {
char *entry_id = NULL; char *entry_id;
struct Curl_dns_entry *dns = NULL; struct Curl_dns_entry *dns = NULL;
size_t entry_len; size_t entry_len;
int wait; int wait;

View File

@ -443,7 +443,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
int port, int port,
int *waitp) int *waitp)
{ {
struct hostent *h = NULL; struct hostent *h;
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
in_addr_t in; in_addr_t in;

View File

@ -916,7 +916,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
bool keepon=TRUE; bool keepon=TRUE;
ssize_t gotbytes; ssize_t gotbytes;
char *ptr; char *ptr;
long timeout = 3600; /* default timeout in seconds */ long timeout; /* default timeout in seconds */
struct timeval interval; struct timeval interval;
fd_set rkeepfd; fd_set rkeepfd;
fd_set readfd; fd_set readfd;
@ -979,7 +979,6 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
nread=0; nread=0;
perline=0; perline=0;
keepon=TRUE;
while((nread<BUFSIZE) && (keepon && !error)) { while((nread<BUFSIZE) && (keepon && !error)) {
readfd = rkeepfd; /* set every lap */ readfd = rkeepfd; /* set every lap */
@ -1230,7 +1229,7 @@ CURLcode Curl_http(struct connectdata *conn)
{ {
struct SessionHandle *data=conn->data; struct SessionHandle *data=conn->data;
char *buf = data->state.buffer; /* this is a short cut to the buffer */ char *buf = data->state.buffer; /* this is a short cut to the buffer */
CURLcode result=CURLE_OK; CURLcode result;
struct HTTP *http; struct HTTP *http;
char *ppath = conn->path; char *ppath = conn->path;
char *host = conn->host.name; char *host = conn->host.name;

View File

@ -59,8 +59,8 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
header */ header */
{ {
bool more = TRUE; bool more = TRUE;
char *token = NULL; char *token;
char *tmp = NULL; char *tmp;
bool foundAuth = FALSE; bool foundAuth = FALSE;
bool foundAuthInt = FALSE; bool foundAuthInt = FALSE;
struct SessionHandle *data=conn->data; struct SessionHandle *data=conn->data;
@ -91,7 +91,7 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
while(more) { while(more) {
char value[32]; char value[32];
char content[128]; char content[128];
size_t totlen=0; size_t totlen;
while(*header && isspace((int)*header)) while(*header && isspace((int)*header))
header++; header++;
@ -224,7 +224,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
unsigned char ha2[33];/* 32 digits and 1 zero byte */ unsigned char ha2[33];/* 32 digits and 1 zero byte */
char cnoncebuf[7]; char cnoncebuf[7];
char *cnonce; char *cnonce;
char *tmp = NULL; char *tmp;
struct timeval now; struct timeval now;
char **allocuserpwd; char **allocuserpwd;

View File

@ -933,6 +933,7 @@ static int dprintf_formatf(
fptr += len; fptr += len;
left -= len; left -= len;
} }
(void)left;
if (p->flags & FLAGS_LONG) if (p->flags & FLAGS_LONG)
*fptr++ = 'l'; *fptr++ = 'l';

View File

@ -309,7 +309,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
struct Curl_one_easy *easy; struct Curl_one_easy *easy;
bool done; bool done;
CURLMcode result=CURLM_OK; CURLMcode result=CURLM_OK;
struct Curl_message *msg = NULL; struct Curl_message *msg;
bool connected; bool connected;
bool async; bool async;

View File

@ -1202,7 +1202,7 @@ CURLcode Curl_telnet(struct connectdata *conn)
case WAIT_TIMEOUT: case WAIT_TIMEOUT:
{ {
unsigned char outbuf[2]; unsigned char outbuf[2];
int out_count = 0; int out_count;
ssize_t bytes_written; ssize_t bytes_written;
char *buffer = buf; char *buffer = buf;
@ -1239,7 +1239,7 @@ CURLcode Curl_telnet(struct connectdata *conn)
case WAIT_OBJECT_0 + 1: case WAIT_OBJECT_0 + 1:
{ {
unsigned char outbuf[2]; unsigned char outbuf[2];
int out_count = 0; int out_count;
ssize_t bytes_written; ssize_t bytes_written;
char *buffer = buf; char *buffer = buf;
@ -1300,6 +1300,10 @@ CURLcode Curl_telnet(struct connectdata *conn)
close_event_func = NULL; close_event_func = NULL;
event_select_func = NULL; event_select_func = NULL;
enum_netevents_func = NULL; enum_netevents_func = NULL;
(void)create_event_func;
(void)close_event_func;
(void)event_select_func;
(void)enum_netevents_func;
/* We called LoadLibrary, so call FreeLibrary */ /* We called LoadLibrary, so call FreeLibrary */
if (!FreeLibrary(wsock2)) if (!FreeLibrary(wsock2))

View File

@ -53,9 +53,9 @@ static int gettimeofday(struct timeval *tp, void *nothing)
** of multimedia apis offer a better time resolution ** of multimedia apis offer a better time resolution
** of 1ms.Need to link against winmm.lib for this ** of 1ms.Need to link against winmm.lib for this
**/ **/
unsigned long Ticks = 0; unsigned long Ticks;
unsigned long Sec =0; unsigned long Sec;
unsigned long Usec = 0; unsigned long Usec;
Ticks = timeGetTime(); Ticks = timeGetTime();
Sec = Ticks/1000; Sec = Ticks/1000;

View File

@ -1163,6 +1163,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
k->keepon &= ~KEEP_WRITE; /* we're done writing */ k->keepon &= ~KEEP_WRITE; /* we're done writing */
FD_ZERO(&k->wkeepfd); FD_ZERO(&k->wkeepfd);
writedone = TRUE; writedone = TRUE;
(void)writedone;
break; break;
} }
@ -1337,7 +1338,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
CURLcode Curl_readwrite_init(struct connectdata *conn) CURLcode Curl_readwrite_init(struct connectdata *conn)
{ {
struct SessionHandle *data = conn->data; struct SessionHandle *data;
struct Curl_transfer_keeper *k = &conn->keep; struct Curl_transfer_keeper *k = &conn->keep;
/* NB: the content encoding software depends on this initialization of /* NB: the content encoding software depends on this initialization of
@ -1856,6 +1857,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
data->change.url = newurl; data->change.url = newurl;
newurl = NULL; /* don't free! */ newurl = NULL; /* don't free! */
(void)newurl;
infof(data, "Issue another request to this URL: '%s'\n", data->change.url); infof(data, "Issue another request to this URL: '%s'\n", data->change.url);
@ -1953,8 +1955,8 @@ static CURLcode
Curl_connect_host(struct SessionHandle *data, Curl_connect_host(struct SessionHandle *data,
struct connectdata **conn) struct connectdata **conn)
{ {
CURLcode res = CURLE_OK; CURLcode res;
int urlchanged = FALSE; int urlchanged;
do { do {
bool async; bool async;
@ -2086,6 +2088,8 @@ CURLcode Curl_perform(struct SessionHandle *data)
/* Curl_do() failed, clean up left-overs in the done-call */ /* Curl_do() failed, clean up left-overs in the done-call */
res2 = Curl_done(&conn, res); res2 = Curl_done(&conn, res);
(void)res2;
/* /*
* Important: 'conn' cannot be used here, since it may have been closed * Important: 'conn' cannot be used here, since it may have been closed
* in 'Curl_done' or other functions. * in 'Curl_done' or other functions.
@ -2158,7 +2162,7 @@ Curl_Transfer(struct connectdata *c_conn, /* connection data */
*/ */
CURLcode Curl_pretransfersec(struct connectdata *conn) CURLcode Curl_pretransfersec(struct connectdata *conn)
{ {
CURLcode status = CURLE_OK; CURLcode status;
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
struct connectdata *sec_conn = NULL; /* secondary connection */ struct connectdata *sec_conn = NULL; /* secondary connection */

View File

@ -1869,6 +1869,7 @@ static int handleSock5Proxy(const char *proxy_name,
if(rc == CURLRESOLV_PENDING) if(rc == CURLRESOLV_PENDING)
/* this requires that we're in "wait for resolve" state */ /* this requires that we're in "wait for resolve" state */
rc = Curl_wait_for_resolv(conn, &dns); rc = Curl_wait_for_resolv(conn, &dns);
(void)rc;
/* /*
* We cannot use 'hostent' as a struct that Curl_resolv() returns. It * We cannot use 'hostent' as a struct that Curl_resolv() returns. It
@ -2401,10 +2402,11 @@ static CURLcode CreateConnection(struct SessionHandle *data,
* For compatibility, the all-uppercase versions of these variables are * For compatibility, the all-uppercase versions of these variables are
* checked if the lowercase versions don't exist. * checked if the lowercase versions don't exist.
*/ */
char *no_proxy=NULL; char *no_proxy;
char *no_proxy_tok_buf; char *no_proxy_tok_buf;
char *proxy=NULL; char *proxy=NULL;
char proxy_env[128]; char proxy_env[128];
(void)proxy;
no_proxy=curl_getenv("no_proxy"); no_proxy=curl_getenv("no_proxy");
if(!no_proxy) if(!no_proxy)

View File

@ -112,6 +112,7 @@ char *curl_version(void)
strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION );
ptr=strchr(ptr, '\0'); ptr=strchr(ptr, '\0');
left -= strlen(ptr); left -= strlen(ptr);
(void)left;
#ifdef USE_SSLEAY #ifdef USE_SSLEAY
{ {