]> granicus.if.org Git - curl/commitdiff
fix compiler warning
authorYang Tse <yangsita@gmail.com>
Mon, 8 Sep 2008 19:34:58 +0000 (19:34 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 8 Sep 2008 19:34:58 +0000 (19:34 +0000)
lib/connect.c
lib/http.c
lib/transfer.c
lib/url.c

index 860111f56b415cec36af0c53f6ed22f072e956c0..3773b8280bc71da74ce129e15826dc8aacbb1f91 100644 (file)
@@ -578,7 +578,7 @@ static bool trynextip(struct connectdata *conn,
       conn->sock[sockindex] = sockfd;
       conn->ip_addr = ai;
 
-      return Curl_store_ip_addr(conn) != CURLE_OK;
+      return (bool)(Curl_store_ip_addr(conn) != CURLE_OK);
     }
     ai = ai->ai_next;
   }
index e223c1f92bb15256838d8b4fda6015ea6f406e68..b57d9b59271a543668ae90dc9f2b0ecf726a89f9 100644 (file)
@@ -1958,11 +1958,11 @@ handle this request only supports 1.0. */
 static bool use_http_1_1(const struct SessionHandle *data,
                          const struct connectdata *conn)
 {
-  return (data->set.httpversion == CURL_HTTP_VERSION_1_1) ||
+  return (bool)((data->set.httpversion == CURL_HTTP_VERSION_1_1) ||
          ((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
           ((conn->httpversion == 11) ||
            ((conn->httpversion != 10) &&
-            (data->state.httpversion != 10))));
+            (data->state.httpversion != 10)))));
 }
 
 /* check and possibly add an Expect: header */
index 1e22b2646aa8bef2b62543c0b52115a3fa49b13b..8d2d0db824f4685d4e1337e889b1df6c5efcd322 100644 (file)
@@ -2012,7 +2012,7 @@ static bool is_absolute_url(const char *url)
   char prot[16]; /* URL protocol string storage */
   char letter;   /* used for a silly sscanf */
 
-  return 2 == sscanf(url, "%15[^?&/:]://%c", prot, &letter);
+  return (bool)(2 == sscanf(url, "%15[^?&/:]://%c", prot, &letter));
 }
 
 /*
index 197548a12c4d2d8825cde14a7021a80ccb595f80..a79ab9d785c476be2f31f0f0a37a7aed87655ea9 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1038,8 +1038,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
      * other - POST is kept as POST after 301 and 302
      */
     long postRedir = va_arg(param, long);
-    data->set.post301 = (postRedir & CURL_REDIR_POST_301)?1:0;
-    data->set.post302 = (postRedir & CURL_REDIR_POST_302)?1:0;
+    data->set.post301 = (bool)((postRedir & CURL_REDIR_POST_301)?TRUE:FALSE);
+    data->set.post302 = (bool)((postRedir & CURL_REDIR_POST_302)?TRUE:FALSE);
   }
   break;
 
@@ -3683,8 +3683,8 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
     if(conn->bits.httpproxy) {
       /* we need to create new URL with the new port number */
       char *url;
-      bool isftp = strequal("ftp", conn->protostr) ||
-                   strequal("ftps", conn->protostr);
+      bool isftp = (bool)(strequal("ftp", conn->protostr) ||
+                          strequal("ftps", conn->protostr));
 
       /*
        * This synthesized URL isn't always right--suffixes like ;type=A