]> granicus.if.org Git - curl/commitdiff
fix compiler warning
authorYang Tse <yangsita@gmail.com>
Wed, 9 Jan 2008 19:11:56 +0000 (19:11 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 9 Jan 2008 19:11:56 +0000 (19:11 +0000)
lib/socks.c
lib/tftp.c
lib/transfer.c
src/main.c

index 693daffe37b2ea1b4752a4e95cb37a6d51a98a4e..c9cb8586993c4ef6df31d586ae00677c10aba3b2 100644 (file)
@@ -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;
 
index fcc193da3ee46cc4600399fed3cdcbd717b4c8d7..69e3aba1325ca1065e30038dadf08bc7ba792d3e 100644 (file)
@@ -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)
index 5b391318acaa5640db4be35f2cf7bb15e1213ab8..716094b2fa66ec16933ae5920612c0a12f872859 100644 (file)
@@ -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 */
index 1f978f6d69dfd749640950a38df550cc63658ae7..c86bf2fe74b078e8de2985b292b5fdc17ba2878d 100644 (file)
@@ -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) {