aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/addressList.cpp14
-rw-r--r--src/attachmentHelper.cpp4
-rw-r--r--src/body.cpp16
-rw-r--r--src/component.cpp2
-rw-r--r--src/header.cpp12
-rw-r--r--src/htmlTextPart.cpp14
-rw-r--r--src/mailbox.cpp2
-rw-r--r--src/mailboxGroup.cpp16
-rw-r--r--src/mailboxList.cpp12
-rw-r--r--src/mdn/receivedMDNInfos.cpp2
-rw-r--r--src/messageBuilder.cpp8
-rw-r--r--src/messageIdSequence.cpp12
-rw-r--r--src/messageParser.cpp12
-rw-r--r--src/net/imap/IMAPFolder.cpp2
-rw-r--r--src/net/imap/IMAPMessage.cpp4
-rw-r--r--src/net/imap/IMAPStructure.cpp6
-rw-r--r--src/net/imap/IMAPUtils.cpp4
-rw-r--r--src/net/maildir/format/courierMaildirFormat.cpp10
-rw-r--r--src/net/maildir/maildirFolder.cpp4
-rw-r--r--src/net/maildir/maildirMessage.cpp6
-rw-r--r--src/net/message.cpp6
-rw-r--r--src/net/pop3/POP3Response.cpp4
-rw-r--r--src/net/pop3/POP3Store.cpp2
-rw-r--r--src/net/pop3/POP3Utils.cpp2
-rw-r--r--src/net/serviceFactory.cpp4
-rw-r--r--src/net/smtp/SMTPResponse.cpp4
-rw-r--r--src/net/smtp/SMTPTransport.cpp8
-rw-r--r--src/net/transport.cpp2
-rw-r--r--src/parameterizedHeaderField.cpp12
-rw-r--r--src/plainTextPart.cpp2
-rw-r--r--src/security/digest/md5/md5MessageDigest.cpp4
-rw-r--r--src/security/digest/sha1/sha1MessageDigest.cpp4
-rw-r--r--src/text.cpp14
-rw-r--r--src/utility/encoder/encoderFactory.cpp4
-rw-r--r--src/utility/path.cpp10
-rw-r--r--src/utility/random.cpp6
36 files changed, 125 insertions, 125 deletions
diff --git a/src/addressList.cpp b/src/addressList.cpp
index f06460d3..dc280c89 100644
--- a/src/addressList.cpp
+++ b/src/addressList.cpp
@@ -121,7 +121,7 @@ addressList& addressList::operator=(const mailboxList& other)
{
removeAllAddresses();
- for (int i = 0 ; i < other.getMailboxCount() ; ++i)
+ for (size_t i = 0 ; i < other.getMailboxCount() ; ++i)
m_list.push_back(other.getMailboxAt(i)->clone().dynamicCast <address>());
return (*this);
@@ -152,7 +152,7 @@ void addressList::insertAddressBefore(ref <address> beforeAddress, ref <address>
}
-void addressList::insertAddressBefore(const int pos, ref <address> addr)
+void addressList::insertAddressBefore(const size_t pos, ref <address> addr)
{
m_list.insert(m_list.begin() + pos, addr);
}
@@ -170,7 +170,7 @@ void addressList::insertAddressAfter(ref <address> afterAddress, ref <address> a
}
-void addressList::insertAddressAfter(const int pos, ref <address> addr)
+void addressList::insertAddressAfter(const size_t pos, ref <address> addr)
{
m_list.insert(m_list.begin() + pos + 1, addr);
}
@@ -188,7 +188,7 @@ void addressList::removeAddress(ref <address> addr)
}
-void addressList::removeAddress(const int pos)
+void addressList::removeAddress(const size_t pos)
{
const std::vector <ref <address> >::iterator it = m_list.begin() + pos;
@@ -202,7 +202,7 @@ void addressList::removeAllAddresses()
}
-int addressList::getAddressCount() const
+size_t addressList::getAddressCount() const
{
return (m_list.size());
}
@@ -214,13 +214,13 @@ bool addressList::isEmpty() const
}
-ref <address> addressList::getAddressAt(const int pos)
+ref <address> addressList::getAddressAt(const size_t pos)
{
return (m_list[pos]);
}
-const ref <const address> addressList::getAddressAt(const int pos) const
+const ref <const address> addressList::getAddressAt(const size_t pos) const
{
return (m_list[pos]);
}
diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp
index 01746813..68c003f9 100644
--- a/src/attachmentHelper.cpp
+++ b/src/attachmentHelper.cpp
@@ -183,7 +183,7 @@ const std::vector <ref <const attachment> >
{
ref <const body> bdy = part->getBody();
- for (int i = 0 ; i < bdy->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < bdy->getPartCount() ; ++i)
{
std::vector <ref <const attachment> > partAtts =
findAttachmentsInBodyPart(bdy->getPartAt(i), options);
@@ -295,7 +295,7 @@ ref <bodyPart> attachmentHelper::findBodyPart
// Try in sub-parts
ref <body> bdy = part->getBody();
- for (int i = 0 ; i < bdy->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < bdy->getPartCount() ; ++i)
{
ref <bodyPart> found =
findBodyPart(bdy->getPartAt(i), type);
diff --git a/src/body.cpp b/src/body.cpp
index e235d49a..6c3c629c 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -446,7 +446,7 @@ void body::generateImpl(utility::outputStream& os, const string::size_type maxLi
os << "--" << boundary;
- for (int p = 0 ; p < getPartCount() ; ++p)
+ for (size_t p = 0 ; p < getPartCount() ; ++p)
{
os << CRLF;
@@ -705,7 +705,7 @@ void body::copyFrom(const component& other)
removeAllParts();
- for (int p = 0 ; p < bdy.getPartCount() ; ++p)
+ for (size_t p = 0 ; p < bdy.getPartCount() ; ++p)
{
ref <bodyPart> part = bdy.getPartAt(p)->clone().dynamicCast <bodyPart>();
@@ -854,7 +854,7 @@ void body::insertPartBefore(ref <bodyPart> beforePart, ref <bodyPart> part)
}
-void body::insertPartBefore(const int pos, ref <bodyPart> part)
+void body::insertPartBefore(const size_t pos, ref <bodyPart> part)
{
initNewPart(part);
@@ -876,7 +876,7 @@ void body::insertPartAfter(ref <bodyPart> afterPart, ref <bodyPart> part)
}
-void body::insertPartAfter(const int pos, ref <bodyPart> part)
+void body::insertPartAfter(const size_t pos, ref <bodyPart> part)
{
initNewPart(part);
@@ -896,7 +896,7 @@ void body::removePart(ref <bodyPart> part)
}
-void body::removePart(const int pos)
+void body::removePart(const size_t pos)
{
m_parts.erase(m_parts.begin() + pos);
}
@@ -908,7 +908,7 @@ void body::removeAllParts()
}
-int body::getPartCount() const
+size_t body::getPartCount() const
{
return (m_parts.size());
}
@@ -920,13 +920,13 @@ bool body::isEmpty() const
}
-ref <bodyPart> body::getPartAt(const int pos)
+ref <bodyPart> body::getPartAt(const size_t pos)
{
return (m_parts[pos]);
}
-const ref <const bodyPart> body::getPartAt(const int pos) const
+const ref <const bodyPart> body::getPartAt(const size_t pos) const
{
return (m_parts[pos]);
}
diff --git a/src/component.cpp b/src/component.cpp
index e93aacf3..8db5d3f5 100644
--- a/src/component.cpp
+++ b/src/component.cpp
@@ -110,7 +110,7 @@ void component::offsetParsedBounds(const utility::stream::size_type offset)
// Offset parsed bounds of our children
std::vector <ref <component> > children = getChildComponents();
- for (unsigned int i = 0, n = children.size() ; i < n ; ++i)
+ for (size_t i = 0, n = children.size() ; i < n ; ++i)
children[i]->offsetParsedBounds(offset);
}
diff --git a/src/header.cpp b/src/header.cpp
index fcdca2c9..386cb5ed 100644
--- a/src/header.cpp
+++ b/src/header.cpp
@@ -232,7 +232,7 @@ void header::insertFieldBefore(ref <headerField> beforeField, ref <headerField>
}
-void header::insertFieldBefore(const int pos, ref <headerField> field)
+void header::insertFieldBefore(const size_t pos, ref <headerField> field)
{
m_fields.insert(m_fields.begin() + pos, field);
}
@@ -250,7 +250,7 @@ void header::insertFieldAfter(ref <headerField> afterField, ref <headerField> fi
}
-void header::insertFieldAfter(const int pos, ref <headerField> field)
+void header::insertFieldAfter(const size_t pos, ref <headerField> field)
{
m_fields.insert(m_fields.begin() + pos + 1, field);
}
@@ -268,7 +268,7 @@ void header::removeField(ref <headerField> field)
}
-void header::removeField(const int pos)
+void header::removeField(const size_t pos)
{
const std::vector <ref <headerField> >::iterator it = m_fields.begin() + pos;
@@ -291,7 +291,7 @@ void header::removeAllFields(const string& fieldName)
}
-int header::getFieldCount() const
+size_t header::getFieldCount() const
{
return (m_fields.size());
}
@@ -303,13 +303,13 @@ bool header::isEmpty() const
}
-const ref <headerField> header::getFieldAt(const int pos)
+const ref <headerField> header::getFieldAt(const size_t pos)
{
return (m_fields[pos]);
}
-const ref <const headerField> header::getFieldAt(const int pos) const
+const ref <const headerField> header::getFieldAt(const size_t pos) const
{
return (m_fields[pos]);
}
diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp
index 98524afb..578796bd 100644
--- a/src/htmlTextPart.cpp
+++ b/src/htmlTextPart.cpp
@@ -56,7 +56,7 @@ const mediaType htmlTextPart::getType() const
}
-int htmlTextPart::getPartCount() const
+size_t htmlTextPart::getPartCount() const
{
return (m_plainText->isEmpty() ? 1 : 2);
}
@@ -131,7 +131,7 @@ void htmlTextPart::generateIn(ref <bodyPart> /* message */, ref <bodyPart> paren
void htmlTextPart::findEmbeddedParts(const bodyPart& part,
std::vector <ref <const bodyPart> >& cidParts, std::vector <ref <const bodyPart> >& locParts)
{
- for (int i = 0 ; i < part.getBody()->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < part.getBody()->getPartCount() ; ++i)
{
ref <const bodyPart> p = part.getBody()->getPartAt(i);
@@ -278,7 +278,7 @@ bool htmlTextPart::findPlainTextPart(const bodyPart& part, const bodyPart& paren
{
ref <const bodyPart> foundPart = NULL;
- for (int i = 0 ; i < part.getBody()->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < part.getBody()->getPartCount() ; ++i)
{
const ref <const bodyPart> p = part.getBody()->getPartAt(i);
@@ -294,7 +294,7 @@ bool htmlTextPart::findPlainTextPart(const bodyPart& part, const bodyPart& paren
bool found = false;
// Now, search for the alternative plain text part
- for (int i = 0 ; !found && i < part.getBody()->getPartCount() ; ++i)
+ for (size_t i = 0 ; !found && i < part.getBody()->getPartCount() ; ++i)
{
const ref <const bodyPart> p = part.getBody()->getPartAt(i);
@@ -332,7 +332,7 @@ bool htmlTextPart::findPlainTextPart(const bodyPart& part, const bodyPart& paren
bool found = false;
- for (int i = 0 ; !found && i < part.getBody()->getPartCount() ; ++i)
+ for (size_t i = 0 ; !found && i < part.getBody()->getPartCount() ; ++i)
{
found = findPlainTextPart(*part.getBody()->getPartAt(i), parent, textPart);
}
@@ -377,13 +377,13 @@ void htmlTextPart::setText(ref <contentHandler> text)
}
-int htmlTextPart::getObjectCount() const
+size_t htmlTextPart::getObjectCount() const
{
return m_objects.size();
}
-const ref <const htmlTextPart::embeddedObject> htmlTextPart::getObjectAt(const int pos) const
+const ref <const htmlTextPart::embeddedObject> htmlTextPart::getObjectAt(const size_t pos) const
{
return m_objects[pos];
}
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index dfdccad7..cdfbaf50 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -377,7 +377,7 @@ void mailbox::generateImpl(utility::outputStream& os, const string::size_type ma
// and/or contain the special chars.
bool forceEncode = false;
- for (int w = 0 ; !forceEncode && w != m_name.getWordCount() ; ++w)
+ for (size_t w = 0 ; !forceEncode && w != m_name.getWordCount() ; ++w)
{
if (m_name.getWordAt(w)->getCharset() == charset(charsets::US_ASCII))
{
diff --git a/src/mailboxGroup.cpp b/src/mailboxGroup.cpp
index c37444a0..4144f524 100644
--- a/src/mailboxGroup.cpp
+++ b/src/mailboxGroup.cpp
@@ -90,7 +90,7 @@ void mailboxGroup::parseImpl(const string& buffer, const string::size_type posit
// Sub-groups are not allowed in mailbox groups: so, we add all
// the contents of the sub-group into this group...
- for (int i = 0 ; i < group->getMailboxCount() ; ++i)
+ for (size_t i = 0 ; i < group->getMailboxCount() ; ++i)
{
m_list.push_back(group->getMailboxAt(i)->clone().staticCast <mailbox>());
}
@@ -123,7 +123,7 @@ void mailboxGroup::generateImpl(utility::outputStream& os, const string::size_ty
// and/or contain the special chars.
bool forceEncode = false;
- for (int w = 0 ; !forceEncode && w < m_name.getWordCount() ; ++w)
+ for (size_t w = 0 ; !forceEncode && w < m_name.getWordCount() ; ++w)
{
if (m_name.getWordAt(w)->getCharset() == charset(charsets::US_ASCII))
{
@@ -258,7 +258,7 @@ void mailboxGroup::insertMailboxBefore(ref <mailbox> beforeMailbox, ref <mailbox
}
-void mailboxGroup::insertMailboxBefore(const int pos, ref <mailbox> mbox)
+void mailboxGroup::insertMailboxBefore(const size_t pos, ref <mailbox> mbox)
{
m_list.insert(m_list.begin() + pos, mbox);
}
@@ -276,7 +276,7 @@ void mailboxGroup::insertMailboxAfter(ref <mailbox> afterMailbox, ref <mailbox>
}
-void mailboxGroup::insertMailboxAfter(const int pos, ref <mailbox> mbox)
+void mailboxGroup::insertMailboxAfter(const size_t pos, ref <mailbox> mbox)
{
m_list.insert(m_list.begin() + pos + 1, mbox);
}
@@ -294,7 +294,7 @@ void mailboxGroup::removeMailbox(ref <mailbox> mbox)
}
-void mailboxGroup::removeMailbox(const int pos)
+void mailboxGroup::removeMailbox(const size_t pos)
{
const std::vector <ref <mailbox> >::iterator it = m_list.begin() + pos;
@@ -308,19 +308,19 @@ void mailboxGroup::removeAllMailboxes()
}
-int mailboxGroup::getMailboxCount() const
+size_t mailboxGroup::getMailboxCount() const
{
return (m_list.size());
}
-ref <mailbox> mailboxGroup::getMailboxAt(const int pos)
+ref <mailbox> mailboxGroup::getMailboxAt(const size_t pos)
{
return (m_list[pos]);
}
-const ref <const mailbox> mailboxGroup::getMailboxAt(const int pos) const
+const ref <const mailbox> mailboxGroup::getMailboxAt(const size_t pos) const
{
return (m_list[pos]);
}
diff --git a/src/mailboxList.cpp b/src/mailboxList.cpp
index f87fb48d..2a6a26bf 100644
--- a/src/mailboxList.cpp
+++ b/src/mailboxList.cpp
@@ -59,7 +59,7 @@ void mailboxList::insertMailboxBefore(ref <mailbox> beforeMailbox, ref <mailbox>
}
-void mailboxList::insertMailboxBefore(const int pos, ref <mailbox> mbox)
+void mailboxList::insertMailboxBefore(const size_t pos, ref <mailbox> mbox)
{
m_list.insertAddressBefore(pos, mbox);
}
@@ -78,7 +78,7 @@ void mailboxList::insertMailboxAfter(ref <mailbox> afterMailbox, ref <mailbox> m
}
-void mailboxList::insertMailboxAfter(const int pos, ref <mailbox> mbox)
+void mailboxList::insertMailboxAfter(const size_t pos, ref <mailbox> mbox)
{
m_list.insertAddressAfter(pos, mbox);
}
@@ -97,7 +97,7 @@ void mailboxList::removeMailbox(ref <mailbox> mbox)
}
-void mailboxList::removeMailbox(const int pos)
+void mailboxList::removeMailbox(const size_t pos)
{
m_list.removeAddress(pos);
}
@@ -109,7 +109,7 @@ void mailboxList::removeAllMailboxes()
}
-int mailboxList::getMailboxCount() const
+size_t mailboxList::getMailboxCount() const
{
return (m_list.getAddressCount());
}
@@ -121,13 +121,13 @@ bool mailboxList::isEmpty() const
}
-ref <mailbox> mailboxList::getMailboxAt(const int pos)
+ref <mailbox> mailboxList::getMailboxAt(const size_t pos)
{
return m_list.getAddressAt(pos).staticCast <mailbox>();
}
-const ref <const mailbox> mailboxList::getMailboxAt(const int pos) const
+const ref <const mailbox> mailboxList::getMailboxAt(const size_t pos) const
{
return m_list.getAddressAt(pos).staticCast <const mailbox>();
}
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp
index f97a58d4..1416071c 100644
--- a/src/mdn/receivedMDNInfos.cpp
+++ b/src/mdn/receivedMDNInfos.cpp
@@ -81,7 +81,7 @@ void receivedMDNInfos::extract()
{
const ref <const body> bdy = m_msg->getBody();
- for (int i = 0 ; i < bdy->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < bdy->getPartCount() ; ++i)
{
const ref <const bodyPart> part = bdy->getPartAt(i);
diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp
index 3597b3ae..8b8af883 100644
--- a/src/messageBuilder.cpp
+++ b/src/messageBuilder.cpp
@@ -280,25 +280,25 @@ void messageBuilder::setSubject(const text& subject)
}
-void messageBuilder::removeAttachment(const int pos)
+void messageBuilder::removeAttachment(const size_t pos)
{
m_attach.erase(m_attach.begin() + pos);
}
-const ref <const attachment> messageBuilder::getAttachmentAt(const int pos) const
+const ref <const attachment> messageBuilder::getAttachmentAt(const size_t pos) const
{
return (m_attach[pos]);
}
-ref <attachment> messageBuilder::getAttachmentAt(const int pos)
+ref <attachment> messageBuilder::getAttachmentAt(const size_t pos)
{
return (m_attach[pos]);
}
-int messageBuilder::getAttachmentCount() const
+size_t messageBuilder::getAttachmentCount() const
{
return (m_attach.size());
}
diff --git a/src/messageIdSequence.cpp b/src/messageIdSequence.cpp
index 0a5c9a01..6e5a76c1 100644
--- a/src/messageIdSequence.cpp
+++ b/src/messageIdSequence.cpp
@@ -148,7 +148,7 @@ void messageIdSequence::insertMessageIdBefore(ref <messageId> beforeMid, ref <me
}
-void messageIdSequence::insertMessageIdBefore(const int pos, ref <messageId> mid)
+void messageIdSequence::insertMessageIdBefore(const size_t pos, ref <messageId> mid)
{
m_list.insert(m_list.begin() + pos, mid);
}
@@ -166,7 +166,7 @@ void messageIdSequence::insertMessageIdAfter(ref <messageId> afterMid, ref <mess
}
-void messageIdSequence::insertMessageIdAfter(const int pos, ref <messageId> mid)
+void messageIdSequence::insertMessageIdAfter(const size_t pos, ref <messageId> mid)
{
m_list.insert(m_list.begin() + pos + 1, mid);
}
@@ -184,7 +184,7 @@ void messageIdSequence::removeMessageId(ref <messageId> mid)
}
-void messageIdSequence::removeMessageId(const int pos)
+void messageIdSequence::removeMessageId(const size_t pos)
{
const std::vector <ref <messageId> >::iterator it = m_list.begin() + pos;
@@ -198,7 +198,7 @@ void messageIdSequence::removeAllMessageIds()
}
-int messageIdSequence::getMessageIdCount() const
+size_t messageIdSequence::getMessageIdCount() const
{
return (m_list.size());
}
@@ -210,13 +210,13 @@ bool messageIdSequence::isEmpty() const
}
-const ref <messageId> messageIdSequence::getMessageIdAt(const int pos)
+const ref <messageId> messageIdSequence::getMessageIdAt(const size_t pos)
{
return (m_list[pos]);
}
-const ref <const messageId> messageIdSequence::getMessageIdAt(const int pos) const
+const ref <const messageId> messageIdSequence::getMessageIdAt(const size_t pos) const
{
return (m_list[pos]);
}
diff --git a/src/messageParser.cpp b/src/messageParser.cpp
index 35e0bbad..b8860a0c 100644
--- a/src/messageParser.cpp
+++ b/src/messageParser.cpp
@@ -165,7 +165,7 @@ bool messageParser::findSubTextParts(ref <const bodyPart> msg, ref <const bodyPa
std::vector <ref <const bodyPart> > textParts;
- for (int i = 0 ; i < part->getBody()->getPartCount() ; ++i)
+ for (size_t i = 0 ; i < part->getBody()->getPartCount() ; ++i)
{
const ref <const bodyPart> p = part->getBody()->getPartAt(i);
@@ -228,7 +228,7 @@ bool messageParser::findSubTextParts(ref <const bodyPart> msg, ref <const bodyPa
bool found = false;
- for (int i = 0 ; !found && (i < part->getBody()->getPartCount()) ; ++i)
+ for (size_t i = 0 ; !found && (i < part->getBody()->getPartCount()) ; ++i)
{
found = findSubTextParts(msg, part->getBody()->getPartAt(i));
}
@@ -279,13 +279,13 @@ const std::vector <ref <const attachment> > messageParser::getAttachmentList() c
}
-int messageParser::getAttachmentCount() const
+size_t messageParser::getAttachmentCount() const
{
return (m_attach.size());
}
-const ref <const attachment> messageParser::getAttachmentAt(const int pos) const
+const ref <const attachment> messageParser::getAttachmentAt(const size_t pos) const
{
return (m_attach[pos]);
}
@@ -307,13 +307,13 @@ const std::vector <ref <const textPart> > messageParser::getTextPartList() const
}
-int messageParser::getTextPartCount() const
+size_t messageParser::getTextPartCount() const
{
return (m_textParts.size());
}
-const ref <const textPart> messageParser::getTextPartAt(const int pos) const
+const ref <const textPart> messageParser::getTextPartAt(const size_t pos) const
{
return (m_textParts[pos]);
}
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index 8eac9eae..ddd53994 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -590,7 +590,7 @@ std::vector <ref <message> > IMAPFolder::getMessagesByUID(const std::vector <mes
cmd << "UID FETCH " << IMAPUtils::extractUIDFromGlobalUID(uids[0]);
- for (unsigned int i = 1, n = uids.size() ; i < n ; ++i)
+ for (std::vector <message::uid>::size_type i = 1, n = uids.size() ; i < n ; ++i)
cmd << "," << IMAPUtils::extractUIDFromGlobalUID(uids[i]);
cmd << " UID";
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 45d4699b..55f2108e 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -233,7 +233,7 @@ void IMAPMessage::fetchPartHeader(ref <part> p)
void IMAPMessage::fetchPartHeaderForStructure(ref <structure> str)
{
- for (int i = 0, n = str->getPartCount() ; i < n ; ++i)
+ for (size_t i = 0, n = str->getPartCount() ; i < n ; ++i)
{
ref <class part> part = str->getPartAt(i);
@@ -694,7 +694,7 @@ void IMAPMessage::constructParsedMessage(ref <bodyPart> parentPart, ref <structu
}
else
{
- for (int i = 0, n = str->getPartCount() ; i < n ; ++i)
+ for (size_t i = 0, n = str->getPartCount() ; i < n ; ++i)
{
ref <class part> part = str->getPartAt(i);
diff --git a/src/net/imap/IMAPStructure.cpp b/src/net/imap/IMAPStructure.cpp
index a0bd98bb..6b0a6c02 100644
--- a/src/net/imap/IMAPStructure.cpp
+++ b/src/net/imap/IMAPStructure.cpp
@@ -59,19 +59,19 @@ IMAPStructure::IMAPStructure(ref <IMAPPart> parent, const std::vector <IMAPParse
}
-ref <const part> IMAPStructure::getPartAt(const int x) const
+ref <const part> IMAPStructure::getPartAt(const size_t x) const
{
return m_parts[x];
}
-ref <part> IMAPStructure::getPartAt(const int x)
+ref <part> IMAPStructure::getPartAt(const size_t x)
{
return m_parts[x];
}
-int IMAPStructure::getPartCount() const
+size_t IMAPStructure::getPartCount() const
{
return m_parts.size();
}
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index 3f1c704b..68507644 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -122,7 +122,7 @@ const string IMAPUtils::pathToString
{
string result;
- for (int i = 0 ; i < path.getSize() ; ++i)
+ for (size_t i = 0 ; i < path.getSize() ; ++i)
{
if (i > 0) result += hierarchySeparator;
result += toModifiedUTF7(hierarchySeparator, path[i]);
@@ -556,7 +556,7 @@ const string IMAPUtils::listToSet(const std::vector <message::uid>& list)
res << extractUIDFromGlobalUID(list[0]);
- for (unsigned int i = 1, n = list.size() ; i < n ; ++i)
+ for (std::vector <message::uid>::size_type i = 1, n = list.size() ; i < n ; ++i)
res << "," << extractUIDFromGlobalUID(list[i]);
return res.str();
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 033951a1..58176a27 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -91,7 +91,7 @@ void courierMaildirFormat::destroyFolder(const folder::path& path)
// Recursively delete directories of subfolders
const std::vector <folder::path> folders = listFolders(path, true);
- for (unsigned int i = 0, n = folders.size() ; i < n ; ++i)
+ for (std::vector <folder::path>::size_type i = 0, n = folders.size() ; i < n ; ++i)
{
maildirUtils::recursiveFSDelete(fsf->create
(folderPathToFileSystemPath(folders[i], ROOT_DIRECTORY)));
@@ -108,7 +108,7 @@ void courierMaildirFormat::renameFolder
{
const std::vector <folder::path> folders = listFolders(oldPath, true);
- for (unsigned int i = 0, n = folders.size() ; i < n ; ++i)
+ for (std::vector <folder::path>::size_type i = 0, n = folders.size() ; i < n ; ++i)
{
const folder::path folderOldPath = folders[i];
@@ -188,7 +188,7 @@ const utility::file::path courierMaildirFormat::folderPathToFileSystemPath
{
string folderComp;
- for (int i = 0, n = path.getSize() ; i < n ; ++i)
+ for (size_t i = 0, n = path.getSize() ; i < n ; ++i)
folderComp += "." + toModifiedUTF7(path[i]);
fsPath /= utility::file::path::component(folderComp);
@@ -237,7 +237,7 @@ const std::vector <folder::path> courierMaildirFormat::listFolders
// Then, map directories to folders
std::vector <folder::path> folders;
- for (unsigned int i = 0, n = dirs.size() ; i < n ; ++i)
+ for (std::vector <string>::size_type i = 0, n = dirs.size() ; i < n ; ++i)
{
const string dir = dirs[i].substr(1) + ".";
folder::path path;
@@ -273,7 +273,7 @@ bool courierMaildirFormat::listDirectories(const folder::path& root,
if (!root.isRoot())
{
- for (int i = 0, n = root.getSize() ; i < n ; ++i)
+ for (size_t i = 0, n = root.getSize() ; i < n ; ++i)
base += "." + toModifiedUTF7(root[i]);
}
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index cbea38ee..d8ca8695 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -505,7 +505,7 @@ void maildirFolder::listFolders(std::vector <ref <folder> >& list, const bool re
list.reserve(pathList.size());
- for (unsigned int i = 0, n = pathList.size() ; i < n ; ++i)
+ for (std::vector <folder::path>::size_type i = 0, n = pathList.size() ; i < n ; ++i)
{
ref <maildirFolder> subFolder =
vmime::create <maildirFolder>(pathList[i], store);
@@ -1264,7 +1264,7 @@ void maildirFolder::expunge()
if (!nums.empty())
{
- for (int i = nums.size() - 1 ; i >= 0 ; --i)
+ for (std::vector <int>::size_type i = nums.size() - 1 ; i >= 0 ; --i)
m_messageInfos.erase(m_messageInfos.begin() + i);
}
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index dd38cbd8..0bd1b277 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -143,17 +143,17 @@ public:
}
- ref <const part> getPartAt(const int x) const
+ ref <const part> getPartAt(const size_t x) const
{
return m_parts[x];
}
- ref <part> getPartAt(const int x)
+ ref <part> getPartAt(const size_t x)
{
return m_parts[x];
}
- int getPartCount() const
+ size_t getPartCount() const
{
return m_parts.size();
}
diff --git a/src/net/message.cpp b/src/net/message.cpp
index b8624330..8639625e 100644
--- a/src/net/message.cpp
+++ b/src/net/message.cpp
@@ -34,19 +34,19 @@ namespace vmime {
namespace net {
-ref <const part> part::getPartAt(const int pos) const
+ref <const part> part::getPartAt(const size_t pos) const
{
return getStructure()->getPartAt(pos);
}
-ref <part> part::getPartAt(const int pos)
+ref <part> part::getPartAt(const size_t pos)
{
return getStructure()->getPartAt(pos);
}
-int part::getPartCount() const
+size_t part::getPartCount() const
{
return getStructure()->getPartCount();
}
diff --git a/src/net/pop3/POP3Response.cpp b/src/net/pop3/POP3Response.cpp
index ab792611..6ca0ad75 100644
--- a/src/net/pop3/POP3Response.cpp
+++ b/src/net/pop3/POP3Response.cpp
@@ -136,13 +136,13 @@ const string POP3Response::getText() const
}
-const string POP3Response::getLineAt(const unsigned int pos) const
+const string POP3Response::getLineAt(const size_t pos) const
{
return m_lines[pos];
}
-unsigned int POP3Response::getLineCount() const
+size_t POP3Response::getLineCount() const
{
return m_lines.size();
}
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index a1dac0a0..4e3f4512 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -653,7 +653,7 @@ const std::vector <string> POP3Store::getCapabilities()
if (response->isSuccess())
{
- for (unsigned int i = 0, n = response->getLineCount() ; i < n ; ++i)
+ for (size_t i = 0, n = response->getLineCount() ; i < n ; ++i)
res.push_back(response->getLineAt(i));
}
diff --git a/src/net/pop3/POP3Utils.cpp b/src/net/pop3/POP3Utils.cpp
index c065b695..c4654956 100644
--- a/src/net/pop3/POP3Utils.cpp
+++ b/src/net/pop3/POP3Utils.cpp
@@ -43,7 +43,7 @@ void POP3Utils::parseMultiListOrUidlResponse(ref <POP3Response> response, std::m
{
std::map <int, string> ids;
- for (unsigned int i = 0, n = response->getLineCount() ; i < n ; ++i)
+ for (size_t i = 0, n = response->getLineCount() ; i < n ; ++i)
{
string line = response->getLineAt(i);
string::iterator it = line.begin();
diff --git a/src/net/serviceFactory.cpp b/src/net/serviceFactory.cpp
index 71b7efea..3a547bb2 100644
--- a/src/net/serviceFactory.cpp
+++ b/src/net/serviceFactory.cpp
@@ -105,13 +105,13 @@ ref <const serviceFactory::registeredService> serviceFactory::getServiceByProtoc
}
-int serviceFactory::getServiceCount() const
+size_t serviceFactory::getServiceCount() const
{
return (m_services.size());
}
-ref <const serviceFactory::registeredService> serviceFactory::getServiceAt(const int pos) const
+ref <const serviceFactory::registeredService> serviceFactory::getServiceAt(const size_t pos) const
{
return (m_services[pos]);
}
diff --git a/src/net/smtp/SMTPResponse.cpp b/src/net/smtp/SMTPResponse.cpp
index 28a1ea87..c0000e94 100644
--- a/src/net/smtp/SMTPResponse.cpp
+++ b/src/net/smtp/SMTPResponse.cpp
@@ -200,13 +200,13 @@ int SMTPResponse::extractResponseCode(const string& response)
}
-const SMTPResponse::responseLine SMTPResponse::getLineAt(const unsigned int pos) const
+const SMTPResponse::responseLine SMTPResponse::getLineAt(const size_t pos) const
{
return m_lines[pos];
}
-unsigned int SMTPResponse::getLineCount() const
+size_t SMTPResponse::getLineCount() const
{
return m_lines.size();
}
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 7c67fa02..0ea4e379 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -231,7 +231,7 @@ void SMTPTransport::helo()
// Get supported extensions from SMTP response
// One extension per line, format is: EXT PARAM1 PARAM2...
- for (int i = 1, n = resp->getLineCount() ; i < n ; ++i)
+ for (size_t i = 1, n = resp->getLineCount() ; i < n ; ++i)
{
const string line = resp->getLineAt(i).getText();
std::istringstream iss(line);
@@ -582,7 +582,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
sendRequest("MAIL FROM:<" + expeditor.getEmail() + ">");
// Emit a "RCPT TO" command for each recipient
- for (int i = 0 ; i < recipients.getMailboxCount() ; ++i)
+ for (size_t i = 0 ; i < recipients.getMailboxCount() ; ++i)
{
const mailbox& mbox = *recipients.getMailboxAt(i);
@@ -602,7 +602,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
}
// Read responses for "RCPT TO" commands
- for (int i = 0 ; i < recipients.getMailboxCount() ; ++i)
+ for (size_t i = 0 ; i < recipients.getMailboxCount() ; ++i)
{
const mailbox& mbox = *recipients.getMailboxAt(i);
@@ -632,7 +632,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
}
// Emit a "RCPT TO" command for each recipient
- for (int i = 0 ; i < recipients.getMailboxCount() ; ++i)
+ for (size_t i = 0 ; i < recipients.getMailboxCount() ; ++i)
{
const mailbox& mbox = *recipients.getMailboxAt(i);
diff --git a/src/net/transport.cpp b/src/net/transport.cpp
index 9349e750..90279170 100644
--- a/src/net/transport.cpp
+++ b/src/net/transport.cpp
@@ -50,7 +50,7 @@ transport::transport(ref <session> sess, const serviceInfos& infos, ref <securit
static void extractMailboxes
(mailboxList& recipients, const addressList& list)
{
- for (int i = 0 ; i < list.getAddressCount() ; ++i)
+ for (size_t i = 0 ; i < list.getAddressCount() ; ++i)
{
ref <mailbox> mbox = list.getAddressAt(i)->clone().dynamicCast <mailbox>();
diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp
index 756d02f2..8c60b205 100644
--- a/src/parameterizedHeaderField.cpp
+++ b/src/parameterizedHeaderField.cpp
@@ -456,7 +456,7 @@ void parameterizedHeaderField::insertParameterBefore(ref <parameter> beforeParam
}
-void parameterizedHeaderField::insertParameterBefore(const int pos, ref <parameter> param)
+void parameterizedHeaderField::insertParameterBefore(const size_t pos, ref <parameter> param)
{
m_params.insert(m_params.begin() + pos, param);
}
@@ -474,7 +474,7 @@ void parameterizedHeaderField::insertParameterAfter(ref <parameter> afterParam,
}
-void parameterizedHeaderField::insertParameterAfter(const int pos, ref <parameter> param)
+void parameterizedHeaderField::insertParameterAfter(const size_t pos, ref <parameter> param)
{
m_params.insert(m_params.begin() + pos + 1, param);
}
@@ -492,7 +492,7 @@ void parameterizedHeaderField::removeParameter(ref <parameter> param)
}
-void parameterizedHeaderField::removeParameter(const int pos)
+void parameterizedHeaderField::removeParameter(const size_t pos)
{
const std::vector <ref <parameter> >::iterator it = m_params.begin() + pos;
@@ -506,7 +506,7 @@ void parameterizedHeaderField::removeAllParameters()
}
-int parameterizedHeaderField::getParameterCount() const
+size_t parameterizedHeaderField::getParameterCount() const
{
return (m_params.size());
}
@@ -518,13 +518,13 @@ bool parameterizedHeaderField::isEmpty() const
}
-const ref <parameter> parameterizedHeaderField::getParameterAt(const int pos)
+const ref <parameter> parameterizedHeaderField::getParameterAt(const size_t pos)
{
return (m_params[pos]);
}
-const ref <const parameter> parameterizedHeaderField::getParameterAt(const int pos) const
+const ref <const parameter> parameterizedHeaderField::getParameterAt(const size_t pos) const
{
return (m_params[pos]);
}
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp
index 15bcb5eb..5ac372da 100644
--- a/src/plainTextPart.cpp
+++ b/src/plainTextPart.cpp
@@ -51,7 +51,7 @@ const mediaType plainTextPart::getType() const
}
-int plainTextPart::getPartCount() const
+size_t plainTextPart::getPartCount() const
{
return (1);
}
diff --git a/src/security/digest/md5/md5MessageDigest.cpp b/src/security/digest/md5/md5MessageDigest.cpp
index 84ca99ae..f803a6e4 100644
--- a/src/security/digest/md5/md5MessageDigest.cpp
+++ b/src/security/digest/md5/md5MessageDigest.cpp
@@ -211,8 +211,8 @@ void md5MessageDigest::finalize()
memset(p, 0, padding);
- reinterpret_cast <vmime_uint32*>(m_block)[14] = (m_byteCount << 3);
- reinterpret_cast <vmime_uint32*>(m_block)[15] = (m_byteCount >> 29);
+ reinterpret_cast <vmime_uint32*>(m_block)[14] = static_cast <vmime_uint32>(m_byteCount << 3);
+ reinterpret_cast <vmime_uint32*>(m_block)[15] = static_cast <vmime_uint32>(m_byteCount >> 29);
#if VMIME_BYTE_ORDER_BIG_ENDIAN
swapUint32Array((vmime_uint32*) m_block, (64 - 8) / 4);
diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index e4bcea41..3fb102ff 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -108,10 +108,10 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len)
j = (m_count[0] >> 3) & 63;
- if ((m_count[0] += len << 3) < (len << 3))
+ if ((m_count[0] += static_cast <unsigned int>(len << 3)) < static_cast <unsigned int>(len << 3))
m_count[1]++;
- m_count[1] += (len >> 29);
+ m_count[1] += static_cast <unsigned int>(len >> 29);
if ((j + len) > 63)
{
diff --git a/src/text.cpp b/src/text.cpp
index 91b81e1b..0fda458a 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -159,19 +159,19 @@ void text::appendWord(ref <word> w)
}
-void text::insertWordBefore(const int pos, ref <word> w)
+void text::insertWordBefore(const size_t pos, ref <word> w)
{
m_words.insert(m_words.begin() + pos, w);
}
-void text::insertWordAfter(const int pos, ref <word> w)
+void text::insertWordAfter(const size_t pos, ref <word> w)
{
m_words.insert(m_words.begin() + pos + 1, w);
}
-void text::removeWord(const int pos)
+void text::removeWord(const size_t pos)
{
const std::vector <ref <word> >::iterator it = m_words.begin() + pos;
@@ -185,7 +185,7 @@ void text::removeAllWords()
}
-int text::getWordCount() const
+size_t text::getWordCount() const
{
return (m_words.size());
}
@@ -197,13 +197,13 @@ bool text::isEmpty() const
}
-const ref <word> text::getWordAt(const int pos)
+const ref <word> text::getWordAt(const size_t pos)
{
return (m_words[pos]);
}
-const ref <const word> text::getWordAt(const int pos) const
+const ref <const word> text::getWordAt(const size_t pos) const
{
return (m_words[pos]);
}
@@ -354,7 +354,7 @@ void text::encodeAndFold(utility::outputStream& os, const string::size_type maxL
string::size_type curLineLength = firstLineOffset;
word::generatorState state;
- for (int wi = 0 ; wi < getWordCount() ; ++wi)
+ for (size_t wi = 0 ; wi < getWordCount() ; ++wi)
{
getWordAt(wi)->generate(os, maxLineLength, curLineLength,
&curLineLength, flags, &state);
diff --git a/src/utility/encoder/encoderFactory.cpp b/src/utility/encoder/encoderFactory.cpp
index 1798ffaf..3b86f682 100644
--- a/src/utility/encoder/encoderFactory.cpp
+++ b/src/utility/encoder/encoderFactory.cpp
@@ -89,13 +89,13 @@ const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderBy
}
-int encoderFactory::getEncoderCount() const
+size_t encoderFactory::getEncoderCount() const
{
return (m_encoders.size());
}
-const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderAt(const int pos) const
+const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderAt(const size_t pos) const
{
return (m_encoders[pos]);
}
diff --git a/src/utility/path.cpp b/src/utility/path.cpp
index 9e314e6a..2702f48c 100644
--- a/src/utility/path.cpp
+++ b/src/utility/path.cpp
@@ -171,19 +171,19 @@ path::component& path::getLastComponent()
}
-int path::getSize() const
+size_t path::getSize() const
{
return (m_list.size());
}
-const path::component& path::operator[](const int x) const
+const path::component& path::operator[](const size_t x) const
{
return (m_list[x]);
}
-path::component& path::operator[](const int x)
+path::component& path::operator[](const size_t x)
{
return (m_list[x]);
}
@@ -250,13 +250,13 @@ void path::appendComponent(const path::component& c)
}
-const path::component& path::getComponentAt(const int pos) const
+const path::component& path::getComponentAt(const size_t pos) const
{
return (m_list[pos]);
}
-path::component& path::getComponentAt(const int pos)
+path::component& path::getComponentAt(const size_t pos)
{
return (m_list[pos]);
}
diff --git a/src/utility/random.cpp b/src/utility/random.cpp
index d12989b8..20719ad6 100644
--- a/src/utility/random.cpp
+++ b/src/utility/random.cpp
@@ -56,13 +56,13 @@ unsigned int random::getProcess()
}
-const string random::getString(const int length, const string& randomChars)
+const string random::getString(const string::size_type length, const string& randomChars)
{
string res;
res.resize(length);
- const unsigned int x = randomChars.length();
- int c = 0;
+ const unsigned int x = static_cast <unsigned int>(randomChars.length());
+ string::size_type c = 0;
while (c < length)
{