]> granicus.if.org Git - curl/commitdiff
fix compiler warning
authorYang Tse <yangsita@gmail.com>
Wed, 27 Jan 2010 03:43:34 +0000 (03:43 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 27 Jan 2010 03:43:34 +0000 (03:43 +0000)
lib/cookie.c
lib/url.c
src/main.c

index 3a3edd51695e1fc8c6972e66a777d1950062bd3a..e117b0869698448b5b63e34bef01e46e7aab97d5 100644 (file)
@@ -783,7 +783,7 @@ static int cookie_sort(const void *p1, const void *p2)
   size_t l1 = c1->path?strlen(c1->path):0;
   size_t l2 = c2->path?strlen(c2->path):0;
 
-  return l2 - l1;
+  return (int)(l2 - l1);
 }
 
 /*****************************************************************************
@@ -806,7 +806,7 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
   struct Cookie *co;
   time_t now = time(NULL);
   struct Cookie *mainco=NULL;
-  int matches=0;
+  size_t matches = 0;
 
   if(!c || !c->cookies)
     return NULL; /* no cookie struct or no cookies in the struct */
@@ -872,7 +872,7 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
        once, the longest specified path version comes first. To make this
        the swiftest way, we just sort them all based on path length. */
     struct Cookie **array;
-    int i;
+    size_t i;
 
     /* alloc an array and store all cookie pointers */
     array = (struct Cookie **)malloc(sizeof(struct Cookie *) * matches);
index 9f7cd0ac594467771b602b8514a7677205f4348a..26ad8b78ce3d29d2d40278e371d9d6a06ca956f8 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2339,7 +2339,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
        * Would this be better if the RTSPREQ_* were just moved into here?
        */
       long curl_rtspreq = va_arg(param, long);
-      long rtspreq = RTSPREQ_NONE;
+      Curl_RtspReq rtspreq = RTSPREQ_NONE;
       switch(curl_rtspreq) {
         case CURL_RTSPREQ_OPTIONS:
           rtspreq = RTSPREQ_OPTIONS;
@@ -3557,8 +3557,8 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
        * The URL was badly formatted, let's try the browser-style _without_
        * protocol specified like 'http://'.
        */
-      if(1 > (rc = sscanf(data->change.url, "%[^\n/]%[^\n]",
-                          conn->host.name, path)) ) {
+      rc = sscanf(data->change.url, "%[^\n/]%[^\n]", conn->host.name, path);
+      if(1 > rc) {
         /*
          * We couldn't even get this format.
          * djgpp 2.04 has a sscanf() bug where 'conn->host.name' is
index 381f8109715951b1ad94a05e9166d23d7507b5ed..3c6714ba6c0f78b2a8bcf309d1b0156c192fb4f8 100644 (file)
@@ -4073,7 +4073,8 @@ static void dumpeasycode(struct Configurable *config)
 
 static bool stdin_upload(const char *uploadfile)
 {
-  return curlx_strequal(uploadfile, "-") || curlx_strequal(uploadfile, ".");
+  return (bool)(curlx_strequal(uploadfile, "-") ||
+                curlx_strequal(uploadfile, "."));
 }
 
 static char*