]> granicus.if.org Git - curl/commitdiff
Andrew Francis removed the need for/use of MSVC pragmas
authorDaniel Stenberg <daniel@haxx.se>
Mon, 26 Aug 2002 17:20:29 +0000 (17:20 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Aug 2002 17:20:29 +0000 (17:20 +0000)
lib/config-win32.h
lib/connect.c
lib/http.c
lib/progress.c
lib/url.c
src/main.c

index 5cf10514d8b2b267b8219334ae754f3ef7cc7416..1e06229417883bff257251816671ede857b9777c 100644 (file)
  *This is to eliminate the warnings when compiled *
  * using MS VC++ compiler                                *
  **************************************************/
-#ifdef _MSC_VER
+#if 0
 
 #pragma warning (disable: 4244)        /* truncation from 'const int' to 'char' */
 #pragma warning (disable: 4127)        /* conditional expression is constant */
index 9bbf8409c8c7504d64103272b54f18e9fda109fe..a90b87e1720fbb89f13f419873affcf8f3111f23 100644 (file)
@@ -602,7 +602,7 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
            (struct in_addr *)remotehost->h_addr_list[aliasindex],
            sizeof(struct in_addr));
     serv_addr.sin_family = remotehost->h_addrtype;
-    serv_addr.sin_port = htons(port);
+    serv_addr.sin_port = htons((unsigned short)port);
   
     rc = connect(sockfd, (struct sockaddr *)&serv_addr,
                  sizeof(serv_addr));
index 763b90a3a7038a76c16d0f196a327f9981b4427a..66fa234ec22a6a26c4e56e43b5eb5f04145e21fc 100644 (file)
@@ -552,7 +552,7 @@ CURLcode Curl_http(struct connectdata *conn)
   if(data->cookies) {
     co = Curl_cookie_getlist(data->cookies,
                              host, ppath,
-                             conn->protocol&PROT_HTTPS?TRUE:FALSE);
+                             (conn->protocol&PROT_HTTPS?TRUE:FALSE));
   }
   if (data->change.proxy &&
       !data->set.tunnel_thru_httpproxy &&
index 6a9ebc5a44675d48748a0e0ba11eee9622f576a2..3ca71f117712267a43721d5b2e5d92b42c58bb44 100644 (file)
@@ -344,8 +344,8 @@ int Curl_pgrsUpdate(struct connectdata *conn)
   /* If we have a total estimate, we can display that and the expected
      time left */
   if(total_estimate) {
-    time2str(time_left, total_estimate-(int) data->progress.timespent); 
-    time2str(time_total, total_estimate);
+    time2str(time_left, (int)(total_estimate - data->progress.timespent)); 
+    time2str(time_total, (int)total_estimate);
   }
   else {
     /* otherwise we blank those times */
@@ -353,7 +353,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
     strcpy(time_total, "--:--:--");
   }
   /* The time spent so far is always known */
-  time2str(time_current, data->progress.timespent);
+  time2str(time_current, (int)data->progress.timespent);
 
   /* Get the total amount of data expected to get transfered */
   total_expected_transfer = 
index 08180efa9d80c3681dac8eacd5d355db31897722..4fa601f7ca68928add728d600d383a5d09a90d77 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1349,7 +1349,7 @@ static CURLcode ConnectPlease(struct connectdata *conn,
     memcpy((char *)&(conn->serv_addr.sin_addr),
            (struct in_addr *)addr, sizeof(struct in_addr));
     conn->serv_addr.sin_family = hostaddr->h_addrtype;
-    conn->serv_addr.sin_port = htons(conn->port);
+    conn->serv_addr.sin_port = htons((unsigned short)conn->port);
 #endif
   }
 
@@ -2078,7 +2078,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
       }
 
       *tmp = '\0'; /* cut off the name there */
-      conn->remote_port = port;
+      conn->remote_port = (unsigned short)port;
     }
   }
 
index 956cb861afc6fc44e33e62aae4cecaa66c8f8dbc..36d28ca7c061428ccb0ba5bd2e05ea649813aa12 100644 (file)
@@ -2011,32 +2011,32 @@ int myprogress (void *clientp,
   char line[256];
   char outline[256];
   char format[40];
-  float frac;
-  float percent;
+  double frac;
+  double percent;
   int barwidth;
   int num;
   int i;
 
   struct ProgressData *bar = (struct ProgressData *)clientp;
-  size_t total = dltotal + ultotal;
+  double total = dltotal + ultotal;
 
   bar->point = dlnow + ulnow; /* we've come this far */
 
   bar->calls++; /* simply count invokes */
 
   if(0 == total) {
-    int prevblock = bar->prev / 1024;
-    int thisblock = bar->point / 1024;
+    int prevblock = (int)bar->prev / 1024;
+    int thisblock = (int)bar->point / 1024;
     while ( thisblock > prevblock ) {
       fprintf( bar->out, "#" );
       prevblock++;
     }
   }
   else {
-    frac = (float) bar->point / (float) total;
+    frac = bar->point / total;
     percent = frac * 100.0f;
     barwidth = bar->width - 7;
-    num = (int) (((float)barwidth) * frac);
+    num = (int) (((double)barwidth) * frac);
     i = 0;
     for ( i = 0; i < num; i++ ) {
       line[i] = '#';