cURL / Mailing Lists / curl-library / Single Mail

curl-library

[compile-warnings 3/3] Fix rest of build warnings on 64-bit Fedora 11.

From: Ben Greear <greearb_at_candelatech.com>
Date: Sat, 27 Mar 2010 23:45:18 -0700

  Add explicit casts. In several places, the code would probably
  still break on messages > 2TB in size, but that doesn't seem to
  be a problem in the real world.

Signed-off-by: Ben Greear <greearb_at_candelatech.com>

---
:100644 100644 f4c0893... 07f076c... M	lib/pop3.c
:100644 100644 073925d... ad7342d... M	lib/smtp.c
:100644 100644 80edfe0... 61b663e... M	src/main.c
 lib/pop3.c |    2 +-
 lib/smtp.c |    2 +-
 src/main.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/pop3.c b/lib/pop3.c
index f4c0893..07f076c 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -990,7 +990,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn,
      0d 0a 2e 0d 0a. This marker can of course be spread out
      over up to 5 different data chunks. Deal with it! */
   struct pop3_conn *pop3c = &conn->proto.pop3c;
-  int checkmax = (nread >= POP3_EOB_LEN?POP3_EOB_LEN:nread);
+  int checkmax = (int)(nread >= POP3_EOB_LEN?POP3_EOB_LEN:nread);
   int checkleft = POP3_EOB_LEN-pop3c->eob;
   int check = (checkmax >= checkleft?checkleft:checkmax);
 
diff --git a/lib/smtp.c b/lib/smtp.c
index 073925d..ad7342d 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1059,7 +1059,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
   /* This loop can be improved by some kind of Boyer-Moore style of
      approach but that is saved for later... */
   for(i = 0, si = 0; i < nread; i++, si++) {
-    int left = nread - i;
+    int left = (int)(nread - i);
 
     if(left>= (SMTP_EOB_LEN-smtpc->eob)) {
       if(!memcmp(SMTP_EOB+smtpc->eob, &data->req.upload_fromhere[i],
diff --git a/src/main.c b/src/main.c
index 80edfe0..61b663e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4238,7 +4238,7 @@ header_callback(void *ptr, size_t size, size_t nmemb, void *stream)
         continue;
       }
       p+=9;
-      filename = parse_filename(p, cb - (p - str));
+      filename = parse_filename(p, (int)(cb - (p - str)));
       if (filename) {
         outs->filename = filename;
         break;
-- 
1.6.2.5
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-28