From 653d5b980c6314e416c2b2ccbbe0cced1498e7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 10 May 2013 20:28:37 +0200 Subject: [PATCH] pop3: fixes 64 bit warnings --- .../inbound_protocols/pop3/MessageIO.cpp | 2 +- .../mail_daemon/inbound_protocols/pop3/pop3.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/MessageIO.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/MessageIO.cpp index 58913947ab..a49a77108b 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/MessageIO.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/MessageIO.cpp @@ -102,7 +102,7 @@ BMailMessageIO::ReadAt(off_t pos, void* buffer, size_t amountToRead) // Put the file position back at where it was, if possible. That's because // ReadAt isn't supposed to affect the file position. - if (oldPosition < fSize) + if (oldPosition < (off_t)fSize) fSlave->Seek (oldPosition, SEEK_SET); else fSlave->Seek (0, SEEK_END); diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp index 25a391d6ed..078b45ebe9 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -494,8 +494,9 @@ POP3Protocol::Stat() if (SendCommand("STAT" CRLF) < B_OK) return B_ERROR; - int32 messages,dropSize; - if (sscanf(fLog.String(), "+OK %ld %ld", &messages, &dropSize) < 2) + int32 messages, dropSize; + if (sscanf(fLog.String(), "+OK %" B_SCNd32" %" B_SCNd32, &messages, + &dropSize) < 2) return B_ERROR; fNumMessages = messages; @@ -591,11 +592,11 @@ POP3Protocol::Retrieve(int32 message, BPositionIO *write_to) int32 message_len = MessageSize(message); write_to->Seek (0, SEEK_END); if (write_to->Position() != message_len) { - printf ("POP3Protocol::Retrieve Note: message size is %d, was " - "expecting %ld, for message #%ld. Could be a transmission error " - "or a bad POP server implementation (does it remove escape codes " - "when it counts size?).\n", - (int) write_to->Position(), message_len, message); + printf ("POP3Protocol::Retrieve Note: message size is %" B_PRIdOFF + ", was expecting %" B_PRId32 ", for message #%" B_PRId32 ". " + "Could be a transmission error or a bad POP server " + "implementation (does it remove escape codes when it counts " + "size?).\n", write_to->Position(), message_len, message); } } @@ -916,7 +917,7 @@ POP3Protocol::_UniqueIDs() b = atol(&(result.String()[b])); else b = 0; - fSizes.AddItem((void *)(b)); + fSizes.AddItem((void *)(addr_t)b); } return ret;