diff options
author | Yang Tse <yangsita@gmail.com> | 2008-01-09 19:11:56 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-01-09 19:11:56 +0000 |
commit | 15f832d1c2c14327b971cacc200d48fce3077043 (patch) | |
tree | 8aa3e487fa4586c94dcc6ca1a85fedc6fa480b3c | |
parent | c249a8aa1b3cdd4a706820092542bb6237596240 (diff) |
fix compiler warning
-rw-r--r-- | lib/socks.c | 6 | ||||
-rw-r--r-- | lib/tftp.c | 5 | ||||
-rw-r--r-- | lib/transfer.c | 4 | ||||
-rw-r--r-- | src/main.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/lib/socks.c b/lib/socks.c index 693daffe3..c9cb85869 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -239,7 +239,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name, socksreq[6] = 0; socksreq[7] = 1; /* If still enough room in buffer, also append hostname */ - hostnamelen = strlen(hostname) + 1; /* length including NUL */ + hostnamelen = (ssize_t)strlen(hostname) + 1; /* length including NUL */ if (packetsize + hostnamelen <= SOCKS4REQLEN) strcpy((char*)socksreq + packetsize, hostname); else @@ -255,7 +255,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name, } if (protocol4a && hostnamelen == 0) { /* SOCKS4a with very long hostname - send that name separately */ - hostnamelen = strlen(hostname) + 1; + hostnamelen = (ssize_t)strlen(hostname) + 1; code = Curl_write(conn, sock, (char *)hostname, hostnamelen, &written); if((code != CURLE_OK) || (written != hostnamelen)) { failf(data, "Failed to send SOCKS4 connect request."); @@ -390,7 +390,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name, curl_socket_t sock = conn->sock[sockindex]; struct SessionHandle *data = conn->data; long timeout; - bool socks5_resolve_local = data->set.proxytype == CURLPROXY_SOCKS5; + bool socks5_resolve_local = (bool)(data->set.proxytype == CURLPROXY_SOCKS5); const size_t hostname_len = strlen(hostname); int packetsize = 0; diff --git a/lib/tftp.c b/lib/tftp.c index fcc193da3..69e3aba13 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -613,7 +613,8 @@ static CURLcode tftp_connect(struct connectdata *conn, bool *done) sessionhandle, deal with it */ Curl_reset_reqproto(conn); - if(!(state = conn->data->state.proto.tftp)) { + state = conn->data->state.proto.tftp; + if(!state) { state = conn->data->state.proto.tftp = calloc(sizeof(tftp_state_data_t), 1); if(!state) diff --git a/lib/transfer.c b/lib/transfer.c index 5b391318a..716094b2f 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -137,7 +137,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp) else if(nread == CURL_READFUNC_PAUSE) { struct SingleRequest *k = &data->req; k->keepon |= KEEP_READ_PAUSE; /* mark reading as paused */ - return 0; /* nothing was read */ + return CURLE_OK; /* nothing was read */ } else if((size_t)nread > buffersize) /* the read function returned a too large value */ diff --git a/src/main.c b/src/main.c index 1f978f6d6..c86bf2fe7 100644 --- a/src/main.c +++ b/src/main.c @@ -2138,7 +2138,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ } else { GetStr(&postdata, p); - size = strlen(postdata); + size = (long)strlen(postdata); } if(!postdata) { |