Trivial 64-bit warning fixes.

This commit is contained in:
Vincent Richard 2012-12-12 16:35:55 +01:00
parent 7a9db510f5
commit 3a5621c2aa
64 changed files with 226 additions and 214 deletions

View File

@ -341,6 +341,9 @@ SET(
INCLUDE(cmake/TargetArch.cmake) INCLUDE(cmake/TargetArch.cmake)
TARGET_ARCHITECTURE(CMAKE_TARGET_ARCHITECTURES) TARGET_ARCHITECTURE(CMAKE_TARGET_ARCHITECTURES)
INCLUDE(CheckTypeSize)
CHECK_TYPE_SIZE(size_t VMIME_HAVE_SIZE_T)
############################################################################## ##############################################################################
# Sendmail path # Sendmail path

View File

@ -810,6 +810,8 @@ config_hpp.write('// -- 32-bit\n')
config_hpp.write('typedef signed ' + env['pf_32bit_type'] + ' vmime_int32;\n') config_hpp.write('typedef signed ' + env['pf_32bit_type'] + ' vmime_int32;\n')
config_hpp.write('typedef unsigned ' + env['pf_32bit_type'] + ' vmime_uint32;\n') config_hpp.write('typedef unsigned ' + env['pf_32bit_type'] + ' vmime_uint32;\n')
config_hpp.write('\n') config_hpp.write('\n')
config_hpp.write('#define VMIME_HAVE_SIZE_T 1\n')
config_hpp.write('\n')
config_hpp.write('// Options\n') config_hpp.write('// Options\n')

View File

@ -35,6 +35,8 @@ typedef unsigned @VMIME_16BIT_TYPE@ vmime_uint16;
typedef signed @VMIME_32BIT_TYPE@ vmime_int32; typedef signed @VMIME_32BIT_TYPE@ vmime_int32;
typedef unsigned @VMIME_32BIT_TYPE@ vmime_uint32; typedef unsigned @VMIME_32BIT_TYPE@ vmime_uint32;
#cmakedefine01 VMIME_HAVE_SIZE_T
// Options // Options
// -- File-system support // -- File-system support
#cmakedefine01 VMIME_HAVE_FILESYSTEM_FEATURES #cmakedefine01 VMIME_HAVE_FILESYSTEM_FEATURES

View File

@ -121,7 +121,7 @@ addressList& addressList::operator=(const mailboxList& other)
{ {
removeAllAddresses(); 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>()); m_list.push_back(other.getMailboxAt(i)->clone().dynamicCast <address>());
return (*this); 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); 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); 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; 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()); 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]); 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]); return (m_list[pos]);
} }

View File

@ -183,7 +183,7 @@ const std::vector <ref <const attachment> >
{ {
ref <const body> bdy = part->getBody(); 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 = std::vector <ref <const attachment> > partAtts =
findAttachmentsInBodyPart(bdy->getPartAt(i), options); findAttachmentsInBodyPart(bdy->getPartAt(i), options);
@ -295,7 +295,7 @@ ref <bodyPart> attachmentHelper::findBodyPart
// Try in sub-parts // Try in sub-parts
ref <body> bdy = part->getBody(); 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 = ref <bodyPart> found =
findBodyPart(bdy->getPartAt(i), type); findBodyPart(bdy->getPartAt(i), type);

View File

@ -446,7 +446,7 @@ void body::generateImpl(utility::outputStream& os, const string::size_type maxLi
os << "--" << boundary; os << "--" << boundary;
for (int p = 0 ; p < getPartCount() ; ++p) for (size_t p = 0 ; p < getPartCount() ; ++p)
{ {
os << CRLF; os << CRLF;
@ -705,7 +705,7 @@ void body::copyFrom(const component& other)
removeAllParts(); 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>(); 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); 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); 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); 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()); 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]); 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]); return (m_parts[pos]);
} }

View File

@ -110,7 +110,7 @@ void component::offsetParsedBounds(const utility::stream::size_type offset)
// Offset parsed bounds of our children // Offset parsed bounds of our children
std::vector <ref <component> > children = getChildComponents(); 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); children[i]->offsetParsedBounds(offset);
} }

View File

@ -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); 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); 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; 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()); 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]); 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]); return (m_fields[pos]);
} }

View File

@ -56,7 +56,7 @@ const mediaType htmlTextPart::getType() const
} }
int htmlTextPart::getPartCount() const size_t htmlTextPart::getPartCount() const
{ {
return (m_plainText->isEmpty() ? 1 : 2); 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, void htmlTextPart::findEmbeddedParts(const bodyPart& part,
std::vector <ref <const bodyPart> >& cidParts, std::vector <ref <const bodyPart> >& locParts) 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); 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; 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); 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; bool found = false;
// Now, search for the alternative plain text part // 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); 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; 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); 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(); 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]; return m_objects[pos];
} }

View File

@ -377,7 +377,7 @@ void mailbox::generateImpl(utility::outputStream& os, const string::size_type ma
// and/or contain the special chars. // and/or contain the special chars.
bool forceEncode = false; 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)) if (m_name.getWordAt(w)->getCharset() == charset(charsets::US_ASCII))
{ {

View File

@ -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 // Sub-groups are not allowed in mailbox groups: so, we add all
// the contents of the sub-group into this group... // 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>()); 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. // and/or contain the special chars.
bool forceEncode = false; 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)) 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); 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); 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; 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()); return (m_list.size());
} }
ref <mailbox> mailboxGroup::getMailboxAt(const int pos) ref <mailbox> mailboxGroup::getMailboxAt(const size_t pos)
{ {
return (m_list[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]); return (m_list[pos]);
} }

View File

@ -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); 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); 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); m_list.removeAddress(pos);
} }
@ -109,7 +109,7 @@ void mailboxList::removeAllMailboxes()
} }
int mailboxList::getMailboxCount() const size_t mailboxList::getMailboxCount() const
{ {
return (m_list.getAddressCount()); 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>(); 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>(); return m_list.getAddressAt(pos).staticCast <const mailbox>();
} }

View File

@ -81,7 +81,7 @@ void receivedMDNInfos::extract()
{ {
const ref <const body> bdy = m_msg->getBody(); 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); const ref <const bodyPart> part = bdy->getPartAt(i);

View File

@ -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); 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]); return (m_attach[pos]);
} }
ref <attachment> messageBuilder::getAttachmentAt(const int pos) ref <attachment> messageBuilder::getAttachmentAt(const size_t pos)
{ {
return (m_attach[pos]); return (m_attach[pos]);
} }
int messageBuilder::getAttachmentCount() const size_t messageBuilder::getAttachmentCount() const
{ {
return (m_attach.size()); return (m_attach.size());
} }

View File

@ -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); 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); 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; 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()); 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]); 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]); return (m_list[pos]);
} }

View File

@ -165,7 +165,7 @@ bool messageParser::findSubTextParts(ref <const bodyPart> msg, ref <const bodyPa
std::vector <ref <const bodyPart> > textParts; 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); 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; 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)); 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()); 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]); 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()); 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]); return (m_textParts[pos]);
} }

View File

@ -590,7 +590,7 @@ std::vector <ref <message> > IMAPFolder::getMessagesByUID(const std::vector <mes
cmd << "UID FETCH " << IMAPUtils::extractUIDFromGlobalUID(uids[0]); 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 << "," << IMAPUtils::extractUIDFromGlobalUID(uids[i]);
cmd << " UID"; cmd << " UID";

View File

@ -233,7 +233,7 @@ void IMAPMessage::fetchPartHeader(ref <part> p)
void IMAPMessage::fetchPartHeaderForStructure(ref <structure> str) 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); ref <class part> part = str->getPartAt(i);
@ -694,7 +694,7 @@ void IMAPMessage::constructParsedMessage(ref <bodyPart> parentPart, ref <structu
} }
else 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); ref <class part> part = str->getPartAt(i);

View File

@ -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]; return m_parts[x];
} }
ref <part> IMAPStructure::getPartAt(const int x) ref <part> IMAPStructure::getPartAt(const size_t x)
{ {
return m_parts[x]; return m_parts[x];
} }
int IMAPStructure::getPartCount() const size_t IMAPStructure::getPartCount() const
{ {
return m_parts.size(); return m_parts.size();
} }

View File

@ -122,7 +122,7 @@ const string IMAPUtils::pathToString
{ {
string result; string result;
for (int i = 0 ; i < path.getSize() ; ++i) for (size_t i = 0 ; i < path.getSize() ; ++i)
{ {
if (i > 0) result += hierarchySeparator; if (i > 0) result += hierarchySeparator;
result += toModifiedUTF7(hierarchySeparator, path[i]); result += toModifiedUTF7(hierarchySeparator, path[i]);
@ -556,7 +556,7 @@ const string IMAPUtils::listToSet(const std::vector <message::uid>& list)
res << extractUIDFromGlobalUID(list[0]); 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]); res << "," << extractUIDFromGlobalUID(list[i]);
return res.str(); return res.str();

View File

@ -91,7 +91,7 @@ void courierMaildirFormat::destroyFolder(const folder::path& path)
// Recursively delete directories of subfolders // Recursively delete directories of subfolders
const std::vector <folder::path> folders = listFolders(path, true); 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 maildirUtils::recursiveFSDelete(fsf->create
(folderPathToFileSystemPath(folders[i], ROOT_DIRECTORY))); (folderPathToFileSystemPath(folders[i], ROOT_DIRECTORY)));
@ -108,7 +108,7 @@ void courierMaildirFormat::renameFolder
{ {
const std::vector <folder::path> folders = listFolders(oldPath, true); 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]; const folder::path folderOldPath = folders[i];
@ -188,7 +188,7 @@ const utility::file::path courierMaildirFormat::folderPathToFileSystemPath
{ {
string folderComp; 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]); folderComp += "." + toModifiedUTF7(path[i]);
fsPath /= utility::file::path::component(folderComp); fsPath /= utility::file::path::component(folderComp);
@ -237,7 +237,7 @@ const std::vector <folder::path> courierMaildirFormat::listFolders
// Then, map directories to folders // Then, map directories to folders
std::vector <folder::path> 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) + "."; const string dir = dirs[i].substr(1) + ".";
folder::path path; folder::path path;
@ -273,7 +273,7 @@ bool courierMaildirFormat::listDirectories(const folder::path& root,
if (!root.isRoot()) 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]); base += "." + toModifiedUTF7(root[i]);
} }

View File

@ -505,7 +505,7 @@ void maildirFolder::listFolders(std::vector <ref <folder> >& list, const bool re
list.reserve(pathList.size()); 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 = ref <maildirFolder> subFolder =
vmime::create <maildirFolder>(pathList[i], store); vmime::create <maildirFolder>(pathList[i], store);
@ -1264,7 +1264,7 @@ void maildirFolder::expunge()
if (!nums.empty()) 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); m_messageInfos.erase(m_messageInfos.begin() + i);
} }

View File

@ -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]; return m_parts[x];
} }
ref <part> getPartAt(const int x) ref <part> getPartAt(const size_t x)
{ {
return m_parts[x]; return m_parts[x];
} }
int getPartCount() const size_t getPartCount() const
{ {
return m_parts.size(); return m_parts.size();
} }

View File

@ -34,19 +34,19 @@ namespace vmime {
namespace net { 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); return getStructure()->getPartAt(pos);
} }
ref <part> part::getPartAt(const int pos) ref <part> part::getPartAt(const size_t pos)
{ {
return getStructure()->getPartAt(pos); return getStructure()->getPartAt(pos);
} }
int part::getPartCount() const size_t part::getPartCount() const
{ {
return getStructure()->getPartCount(); return getStructure()->getPartCount();
} }

View File

@ -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]; return m_lines[pos];
} }
unsigned int POP3Response::getLineCount() const size_t POP3Response::getLineCount() const
{ {
return m_lines.size(); return m_lines.size();
} }

View File

@ -653,7 +653,7 @@ const std::vector <string> POP3Store::getCapabilities()
if (response->isSuccess()) 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)); res.push_back(response->getLineAt(i));
} }

View File

@ -43,7 +43,7 @@ void POP3Utils::parseMultiListOrUidlResponse(ref <POP3Response> response, std::m
{ {
std::map <int, string> ids; 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 line = response->getLineAt(i);
string::iterator it = line.begin(); string::iterator it = line.begin();

View File

@ -105,13 +105,13 @@ ref <const serviceFactory::registeredService> serviceFactory::getServiceByProtoc
} }
int serviceFactory::getServiceCount() const size_t serviceFactory::getServiceCount() const
{ {
return (m_services.size()); 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]); return (m_services[pos]);
} }

View File

@ -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]; return m_lines[pos];
} }
unsigned int SMTPResponse::getLineCount() const size_t SMTPResponse::getLineCount() const
{ {
return m_lines.size(); return m_lines.size();
} }

View File

@ -231,7 +231,7 @@ void SMTPTransport::helo()
// Get supported extensions from SMTP response // Get supported extensions from SMTP response
// One extension per line, format is: EXT PARAM1 PARAM2... // 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(); const string line = resp->getLineAt(i).getText();
std::istringstream iss(line); std::istringstream iss(line);
@ -582,7 +582,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
sendRequest("MAIL FROM:<" + expeditor.getEmail() + ">"); sendRequest("MAIL FROM:<" + expeditor.getEmail() + ">");
// Emit a "RCPT TO" command for each recipient // 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); 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 // 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); 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 // 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); const mailbox& mbox = *recipients.getMailboxAt(i);

View File

@ -50,7 +50,7 @@ transport::transport(ref <session> sess, const serviceInfos& infos, ref <securit
static void extractMailboxes static void extractMailboxes
(mailboxList& recipients, const addressList& list) (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>(); ref <mailbox> mbox = list.getAddressAt(i)->clone().dynamicCast <mailbox>();

View File

@ -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); 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); 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; 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()); 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]); 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]); return (m_params[pos]);
} }

View File

@ -51,7 +51,7 @@ const mediaType plainTextPart::getType() const
} }
int plainTextPart::getPartCount() const size_t plainTextPart::getPartCount() const
{ {
return (1); return (1);
} }

View File

@ -211,8 +211,8 @@ void md5MessageDigest::finalize()
memset(p, 0, padding); memset(p, 0, padding);
reinterpret_cast <vmime_uint32*>(m_block)[14] = (m_byteCount << 3); reinterpret_cast <vmime_uint32*>(m_block)[14] = static_cast <vmime_uint32>(m_byteCount << 3);
reinterpret_cast <vmime_uint32*>(m_block)[15] = (m_byteCount >> 29); reinterpret_cast <vmime_uint32*>(m_block)[15] = static_cast <vmime_uint32>(m_byteCount >> 29);
#if VMIME_BYTE_ORDER_BIG_ENDIAN #if VMIME_BYTE_ORDER_BIG_ENDIAN
swapUint32Array((vmime_uint32*) m_block, (64 - 8) / 4); swapUint32Array((vmime_uint32*) m_block, (64 - 8) / 4);

View File

@ -108,10 +108,10 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len)
j = (m_count[0] >> 3) & 63; 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]++;
m_count[1] += (len >> 29); m_count[1] += static_cast <unsigned int>(len >> 29);
if ((j + len) > 63) if ((j + len) > 63)
{ {

View File

@ -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); 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); 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; 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()); 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]); 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]); return (m_words[pos]);
} }
@ -354,7 +354,7 @@ void text::encodeAndFold(utility::outputStream& os, const string::size_type maxL
string::size_type curLineLength = firstLineOffset; string::size_type curLineLength = firstLineOffset;
word::generatorState state; word::generatorState state;
for (int wi = 0 ; wi < getWordCount() ; ++wi) for (size_t wi = 0 ; wi < getWordCount() ; ++wi)
{ {
getWordAt(wi)->generate(os, maxLineLength, curLineLength, getWordAt(wi)->generate(os, maxLineLength, curLineLength,
&curLineLength, flags, &state); &curLineLength, flags, &state);

View File

@ -89,13 +89,13 @@ const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderBy
} }
int encoderFactory::getEncoderCount() const size_t encoderFactory::getEncoderCount() const
{ {
return (m_encoders.size()); 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]); return (m_encoders[pos]);
} }

View File

@ -171,19 +171,19 @@ path::component& path::getLastComponent()
} }
int path::getSize() const size_t path::getSize() const
{ {
return (m_list.size()); 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]); return (m_list[x]);
} }
path::component& path::operator[](const int x) path::component& path::operator[](const size_t x)
{ {
return (m_list[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]); return (m_list[pos]);
} }
path::component& path::getComponentAt(const int pos) path::component& path::getComponentAt(const size_t pos)
{ {
return (m_list[pos]); return (m_list[pos]);
} }

View File

@ -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; string res;
res.resize(length); res.resize(length);
const unsigned int x = randomChars.length(); const unsigned int x = static_cast <unsigned int>(randomChars.length());
int c = 0; string::size_type c = 0;
while (c < length) while (c < length)
{ {

View File

@ -54,7 +54,7 @@ VMIME_TEST_SUITE_BEGIN
res += "["; res += "[";
for (int i = 0 ; i < bdy->getPartCount() ; ++i) for (size_t i = 0 ; i < bdy->getPartCount() ; ++i)
{ {
vmime::ref <vmime::bodyPart> subPart = bdy->getPartAt(i); vmime::ref <vmime::bodyPart> subPart = bdy->getPartAt(i);

View File

@ -110,6 +110,7 @@ void testSocket::sendRaw(const char* buffer, const size_type count)
testSocket::size_type testSocket::sendRawNonBlocking(const char* buffer, const size_type count) testSocket::size_type testSocket::sendRawNonBlocking(const char* buffer, const size_type count)
{ {
sendRaw(buffer, count); sendRaw(buffer, count);
return count;
} }

View File

@ -106,7 +106,7 @@ inline std::ostream& operator<<(std::ostream& os, const vmime::text& txt)
{ {
os << "[text: ["; os << "[text: [";
for (int i = 0 ; i < txt.getWordCount() ; ++i) for (size_t i = 0 ; i < txt.getWordCount() ; ++i)
{ {
const vmime::word& w = *txt.getWordAt(i); const vmime::word& w = *txt.getWordAt(i);
@ -134,7 +134,7 @@ inline std::ostream& operator<<(std::ostream& os, const vmime::mailboxGroup& gro
{ {
os << "[mailbox-group: name=" << group.getName() << ", list=["; os << "[mailbox-group: name=" << group.getName() << ", list=[";
for (int i = 0 ; i < group.getMailboxCount() ; ++i) for (size_t i = 0 ; i < group.getMailboxCount() ; ++i)
{ {
if (i != 0) if (i != 0)
os << ","; os << ",";
@ -152,7 +152,7 @@ inline std::ostream& operator<<(std::ostream& os, const vmime::addressList& list
{ {
os << "[address-list: ["; os << "[address-list: [";
for (int i = 0 ; i < list.getAddressCount() ; ++i) for (size_t i = 0 ; i < list.getAddressCount() ; ++i)
{ {
const vmime::address& addr = *list.getAddressAt(i); const vmime::address& addr = *list.getAddressAt(i);

View File

@ -79,7 +79,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param addr address to insert * @param addr address to insert
*/ */
void insertAddressBefore(const int pos, ref <address> addr); void insertAddressBefore(const size_t pos, ref <address> addr);
/** Insert a new address after the specified address. /** Insert a new address after the specified address.
* *
@ -94,7 +94,7 @@ public:
* @param pos position of the address before the new address * @param pos position of the address before the new address
* @param addr address to insert * @param addr address to insert
*/ */
void insertAddressAfter(const int pos, ref <address> addr); void insertAddressAfter(const size_t pos, ref <address> addr);
/** Remove the specified address from the list. /** Remove the specified address from the list.
* *
@ -107,7 +107,7 @@ public:
* *
* @param pos position of the address to remove * @param pos position of the address to remove
*/ */
void removeAddress(const int pos); void removeAddress(const size_t pos);
/** Remove all addresses from the list. /** Remove all addresses from the list.
*/ */
@ -117,7 +117,7 @@ public:
* *
* @return number of addresses * @return number of addresses
*/ */
int getAddressCount() const; size_t getAddressCount() const;
/** Tests whether the list of addresses is empty. /** Tests whether the list of addresses is empty.
* *
@ -130,14 +130,14 @@ public:
* @param pos position * @param pos position
* @return address at position 'pos' * @return address at position 'pos'
*/ */
ref <address> getAddressAt(const int pos); ref <address> getAddressAt(const size_t pos);
/** Return the address at the specified position. /** Return the address at the specified position.
* *
* @param pos position * @param pos position
* @return address at position 'pos' * @return address at position 'pos'
*/ */
const ref <const address> getAddressAt(const int pos) const; const ref <const address> getAddressAt(const size_t pos) const;
/** Return the address list. /** Return the address list.
* *

View File

@ -76,7 +76,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param part part to insert * @param part part to insert
*/ */
void insertPartBefore(const int pos, ref <bodyPart> part); void insertPartBefore(const size_t pos, ref <bodyPart> part);
/** Insert a new part after the specified part. /** Insert a new part after the specified part.
* *
@ -91,7 +91,7 @@ public:
* @param pos position of the part before the new part * @param pos position of the part before the new part
* @param part part to insert * @param part part to insert
*/ */
void insertPartAfter(const int pos, ref <bodyPart> part); void insertPartAfter(const size_t pos, ref <bodyPart> part);
/** Remove the specified part from the list. /** Remove the specified part from the list.
* *
@ -104,7 +104,7 @@ public:
* *
* @param pos position of the part to remove * @param pos position of the part to remove
*/ */
void removePart(const int pos); void removePart(const size_t pos);
/** Remove all parts from the list. /** Remove all parts from the list.
*/ */
@ -114,7 +114,7 @@ public:
* *
* @return number of parts * @return number of parts
*/ */
int getPartCount() const; size_t getPartCount() const;
/** Tests whether the list of parts is empty. /** Tests whether the list of parts is empty.
* *
@ -127,14 +127,14 @@ public:
* @param pos position * @param pos position
* @return part at position 'pos' * @return part at position 'pos'
*/ */
ref <bodyPart> getPartAt(const int pos); ref <bodyPart> getPartAt(const size_t pos);
/** Return the part at the specified position. /** Return the part at the specified position.
* *
* @param pos position * @param pos position
* @return part at position 'pos' * @return part at position 'pos'
*/ */
const ref <const bodyPart> getPartAt(const int pos) const; const ref <const bodyPart> getPartAt(const size_t pos) const;
/** Return the part list. /** Return the part list.
* *

View File

@ -140,7 +140,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param field field to insert * @param field field to insert
*/ */
void insertFieldBefore(const int pos, ref <headerField> field); void insertFieldBefore(const size_t pos, ref <headerField> field);
/** Insert a new field after the specified field. /** Insert a new field after the specified field.
* *
@ -155,7 +155,7 @@ public:
* @param pos position of the field before the new field * @param pos position of the field before the new field
* @param field field to insert * @param field field to insert
*/ */
void insertFieldAfter(const int pos, ref <headerField> field); void insertFieldAfter(const size_t pos, ref <headerField> field);
/** Remove the specified field from the list. /** Remove the specified field from the list.
* *
@ -168,7 +168,7 @@ public:
* *
* @param pos position of the field to remove * @param pos position of the field to remove
*/ */
void removeField(const int pos); void removeField(const size_t pos);
/** Remove all fields from the list. /** Remove all fields from the list.
*/ */
@ -182,7 +182,7 @@ public:
* *
* @return number of fields * @return number of fields
*/ */
int getFieldCount() const; size_t getFieldCount() const;
/** Tests whether the list of fields is empty. /** Tests whether the list of fields is empty.
* *
@ -195,14 +195,14 @@ public:
* @param pos position * @param pos position
* @return field at position 'pos' * @return field at position 'pos'
*/ */
const ref <headerField> getFieldAt(const int pos); const ref <headerField> getFieldAt(const size_t pos);
/** Return the field at the specified position. /** Return the field at the specified position.
* *
* @param pos position * @param pos position
* @return field at position 'pos' * @return field at position 'pos'
*/ */
const ref <const headerField> getFieldAt(const int pos) const; const ref <const headerField> getFieldAt(const size_t pos) const;
/** Return the field list. /** Return the field list.
* *

View File

@ -121,14 +121,14 @@ public:
* *
* @return number of embedded objects * @return number of embedded objects
*/ */
int getObjectCount() const; size_t getObjectCount() const;
/** Return the embedded object at the specified position. /** Return the embedded object at the specified position.
* *
* @param pos position of the embedded object * @param pos position of the embedded object
* @return embedded object at position 'pos' * @return embedded object at position 'pos'
*/ */
const ref <const embeddedObject> getObjectAt(const int pos) const; const ref <const embeddedObject> getObjectAt(const size_t pos) const;
/** Embed an object and returns a string which identifies it. /** Embed an object and returns a string which identifies it.
* The returned identifier is suitable for use in the 'src' attribute * The returned identifier is suitable for use in the 'src' attribute
@ -168,7 +168,7 @@ public:
const string addObject(ref <contentHandler> data, const encoding& enc, const mediaType& type); const string addObject(ref <contentHandler> data, const encoding& enc, const mediaType& type);
int getPartCount() const; size_t getPartCount() const;
void generateIn(ref <bodyPart> message, ref <bodyPart> parent) const; void generateIn(ref <bodyPart> message, ref <bodyPart> parent) const;
void parse(ref <const bodyPart> message, ref <const bodyPart> parent, ref <const bodyPart> textPart); void parse(ref <const bodyPart> message, ref <const bodyPart> parent, ref <const bodyPart> textPart);

View File

@ -86,7 +86,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param mbox mailbox to insert * @param mbox mailbox to insert
*/ */
void insertMailboxBefore(const int pos, ref <mailbox> mbox); void insertMailboxBefore(const size_t pos, ref <mailbox> mbox);
/** Insert a new mailbox after the specified mailbox. /** Insert a new mailbox after the specified mailbox.
* *
@ -101,7 +101,7 @@ public:
* @param pos position of the mailbox before the new mailbox * @param pos position of the mailbox before the new mailbox
* @param mbox mailbox to insert * @param mbox mailbox to insert
*/ */
void insertMailboxAfter(const int pos, ref <mailbox> mbox); void insertMailboxAfter(const size_t pos, ref <mailbox> mbox);
/** Remove the specified mailbox from the list. /** Remove the specified mailbox from the list.
* *
@ -114,7 +114,7 @@ public:
* *
* @param pos position of the mailbox to remove * @param pos position of the mailbox to remove
*/ */
void removeMailbox(const int pos); void removeMailbox(const size_t pos);
/** Remove all mailboxes from the list. /** Remove all mailboxes from the list.
*/ */
@ -124,7 +124,7 @@ public:
* *
* @return number of mailboxes * @return number of mailboxes
*/ */
int getMailboxCount() const; size_t getMailboxCount() const;
/** Tests whether the list of mailboxes is empty. /** Tests whether the list of mailboxes is empty.
* *
@ -137,14 +137,14 @@ public:
* @param pos position * @param pos position
* @return mailbox at position 'pos' * @return mailbox at position 'pos'
*/ */
ref <mailbox> getMailboxAt(const int pos); ref <mailbox> getMailboxAt(const size_t pos);
/** Return the mailbox at the specified position. /** Return the mailbox at the specified position.
* *
* @param pos position * @param pos position
* @return mailbox at position 'pos' * @return mailbox at position 'pos'
*/ */
const ref <const mailbox> getMailboxAt(const int pos) const; const ref <const mailbox> getMailboxAt(const size_t pos) const;
/** Return the mailbox list. /** Return the mailbox list.
* *

View File

@ -73,7 +73,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param mbox mailbox to insert * @param mbox mailbox to insert
*/ */
void insertMailboxBefore(const int pos, ref <mailbox> mbox); void insertMailboxBefore(const size_t pos, ref <mailbox> mbox);
/** Insert a new mailbox after the specified mailbox. /** Insert a new mailbox after the specified mailbox.
* *
@ -88,7 +88,7 @@ public:
* @param pos position of the mailbox before the new mailbox * @param pos position of the mailbox before the new mailbox
* @param mbox mailbox to insert * @param mbox mailbox to insert
*/ */
void insertMailboxAfter(const int pos, ref <mailbox> mbox); void insertMailboxAfter(const size_t pos, ref <mailbox> mbox);
/** Remove the specified mailbox from the list. /** Remove the specified mailbox from the list.
* *
@ -101,7 +101,7 @@ public:
* *
* @param pos position of the mailbox to remove * @param pos position of the mailbox to remove
*/ */
void removeMailbox(const int pos); void removeMailbox(const size_t pos);
/** Remove all mailboxes from the list. /** Remove all mailboxes from the list.
*/ */
@ -111,7 +111,7 @@ public:
* *
* @return number of mailboxes * @return number of mailboxes
*/ */
int getMailboxCount() const; size_t getMailboxCount() const;
/** Tests whether the list of mailboxes is empty. /** Tests whether the list of mailboxes is empty.
* *
@ -124,14 +124,14 @@ public:
* @param pos position * @param pos position
* @return mailbox at position 'pos' * @return mailbox at position 'pos'
*/ */
ref <mailbox> getMailboxAt(const int pos); ref <mailbox> getMailboxAt(const size_t pos);
/** Return the mailbox at the specified position. /** Return the mailbox at the specified position.
* *
* @param pos position * @param pos position
* @return mailbox at position 'pos' * @return mailbox at position 'pos'
*/ */
const ref <const mailbox> getMailboxAt(const int pos) const; const ref <const mailbox> getMailboxAt(const size_t pos) const;
/** Return the mailbox list. /** Return the mailbox list.
* *

View File

@ -148,27 +148,27 @@ public:
* *
* @param pos position of the attachment to remove * @param pos position of the attachment to remove
*/ */
void removeAttachment(const int pos); void removeAttachment(const size_t pos);
/** Return the attachment at the specified position. /** Return the attachment at the specified position.
* *
* @param pos position of the attachment * @param pos position of the attachment
* @return attachment at the specified position * @return attachment at the specified position
*/ */
const ref <const attachment> getAttachmentAt(const int pos) const; const ref <const attachment> getAttachmentAt(const size_t pos) const;
/** Return the attachment at the specified position. /** Return the attachment at the specified position.
* *
* @param pos position of the attachment * @param pos position of the attachment
* @return attachment at the specified position * @return attachment at the specified position
*/ */
ref <attachment> getAttachmentAt(const int pos); ref <attachment> getAttachmentAt(const size_t pos);
/** Return the number of attachments in the message. /** Return the number of attachments in the message.
* *
* @return number of attachments * @return number of attachments
*/ */
int getAttachmentCount() const; size_t getAttachmentCount() const;
/** Return the list of attachments. /** Return the list of attachments.
* *

View File

@ -72,7 +72,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param mid message-id to insert * @param mid message-id to insert
*/ */
void insertMessageIdBefore(const int pos, ref <messageId> mid); void insertMessageIdBefore(const size_t pos, ref <messageId> mid);
/** Insert a new message-id after the specified message-id. /** Insert a new message-id after the specified message-id.
* *
@ -87,7 +87,7 @@ public:
* @param pos position of the message-id before the new message-id * @param pos position of the message-id before the new message-id
* @param mid message-id to insert * @param mid message-id to insert
*/ */
void insertMessageIdAfter(const int pos, ref <messageId> mid); void insertMessageIdAfter(const size_t pos, ref <messageId> mid);
/** Remove the specified message-id from the list. /** Remove the specified message-id from the list.
* *
@ -100,7 +100,7 @@ public:
* *
* @param pos position of the message-id to remove * @param pos position of the message-id to remove
*/ */
void removeMessageId(const int pos); void removeMessageId(const size_t pos);
/** Remove all message-ids from the list. /** Remove all message-ids from the list.
*/ */
@ -110,7 +110,7 @@ public:
* *
* @return number of message-ides * @return number of message-ides
*/ */
int getMessageIdCount() const; size_t getMessageIdCount() const;
/** Tests whether the list of message-ides is empty. /** Tests whether the list of message-ides is empty.
* *
@ -123,14 +123,14 @@ public:
* @param pos position * @param pos position
* @return message-id at position 'pos' * @return message-id at position 'pos'
*/ */
const ref <messageId> getMessageIdAt(const int pos); const ref <messageId> getMessageIdAt(const size_t pos);
/** Return the message-id at the specified position. /** Return the message-id at the specified position.
* *
* @param pos position * @param pos position
* @return message-id at position 'pos' * @return message-id at position 'pos'
*/ */
const ref <const messageId> getMessageIdAt(const int pos) const; const ref <const messageId> getMessageIdAt(const size_t pos) const;
/** Return the message-id list. /** Return the message-id list.
* *

View File

@ -94,14 +94,14 @@ public:
* *
* @return number of attachments * @return number of attachments
*/ */
int getAttachmentCount() const; size_t getAttachmentCount() const;
/** Return the attachment at the specified position. /** Return the attachment at the specified position.
* *
* @param pos position of the attachment * @param pos position of the attachment
* @return attachment at position 'pos' * @return attachment at position 'pos'
*/ */
const ref <const attachment> getAttachmentAt(const int pos) const; const ref <const attachment> getAttachmentAt(const size_t pos) const;
/** Return the attachments of the message. /** Return the attachments of the message.
* *
@ -119,14 +119,14 @@ public:
* *
* @return number of text parts * @return number of text parts
*/ */
int getTextPartCount() const; size_t getTextPartCount() const;
/** Return the text part at the specified position. /** Return the text part at the specified position.
* *
* @param pos position of the text part * @param pos position of the text part
* @return text part at position 'pos' * @return text part at position 'pos'
*/ */
const ref <const textPart> getTextPartAt(const int pos) const; const ref <const textPart> getTextPartAt(const size_t pos) const;
private: private:

View File

@ -52,9 +52,9 @@ public:
IMAPStructure(const IMAPParser::body* body); IMAPStructure(const IMAPParser::body* body);
IMAPStructure(ref <IMAPPart> parent, const std::vector <IMAPParser::body*>& list); IMAPStructure(ref <IMAPPart> parent, const std::vector <IMAPParser::body*>& list);
ref <const part> getPartAt(const int x) const; ref <const part> getPartAt(const size_t x) const;
ref <part> getPartAt(const int x); ref <part> getPartAt(const size_t x);
int getPartCount() const; size_t getPartCount() const;
static ref <IMAPStructure> emptyStructure(); static ref <IMAPStructure> emptyStructure();

View File

@ -105,7 +105,7 @@ public:
* @param pos index of the sub-part * @param pos index of the sub-part
* @return sub-part at position 'pos' * @return sub-part at position 'pos'
*/ */
ref <const part> getPartAt(const int pos) const; ref <const part> getPartAt(const size_t pos) const;
/** Return the sub-part at the specified position (zero is the /** Return the sub-part at the specified position (zero is the
* first part). * first part).
@ -113,13 +113,13 @@ public:
* @param pos index of the sub-part * @param pos index of the sub-part
* @return sub-part at position 'pos' * @return sub-part at position 'pos'
*/ */
ref <part> getPartAt(const int pos); ref <part> getPartAt(const size_t pos);
/** Return the number of sub-parts in this part. /** Return the number of sub-parts in this part.
* *
* @return number of sub-parts * @return number of sub-parts
*/ */
int getPartCount() const; size_t getPartCount() const;
}; };
@ -143,7 +143,7 @@ public:
* @param pos position * @param pos position
* @return part at position 'pos' * @return part at position 'pos'
*/ */
virtual ref <const part> getPartAt(const int pos) const = 0; virtual ref <const part> getPartAt(const size_t pos) const = 0;
/** Return the part at the specified position (first /** Return the part at the specified position (first
* part is at position 0). * part is at position 0).
@ -151,13 +151,13 @@ public:
* @param pos position * @param pos position
* @return part at position 'pos' * @return part at position 'pos'
*/ */
virtual ref <part> getPartAt(const int pos) = 0; virtual ref <part> getPartAt(const size_t pos) = 0;
/** Return the number of parts in this part. /** Return the number of parts in this part.
* *
* @return number of parts * @return number of parts
*/ */
virtual int getPartCount() const = 0; virtual size_t getPartCount() const = 0;
}; };

View File

@ -137,13 +137,13 @@ public:
* @param pos line index * @param pos line index
* @return line at the specified index * @return line at the specified index
*/ */
const string getLineAt(const unsigned int pos) const; const string getLineAt(const size_t pos) const;
/** Return the number of lines in the response. /** Return the number of lines in the response.
* *
* @return number of lines in the response * @return number of lines in the response
*/ */
unsigned int getLineCount() const; size_t getLineCount() const;
private: private:
@ -171,7 +171,7 @@ private:
string m_firstLine; string m_firstLine;
ResponseCode m_code; ResponseCode m_code;
string m_text; string m_text;
std::vector <string> m_lines; std::vector <string> m_lines;
}; };

View File

@ -138,14 +138,14 @@ public:
* *
* @return number of registered services * @return number of registered services
*/ */
int getServiceCount() const; size_t getServiceCount() const;
/** Return the registered service at the specified position. /** Return the registered service at the specified position.
* *
* @param pos position of the registered service to return * @param pos position of the registered service to return
* @return registered service at the specified position * @return registered service at the specified position
*/ */
ref <const registeredService> getServiceAt(const int pos) const; ref <const registeredService> getServiceAt(const size_t pos) const;
/** Return a list of all registered services. /** Return a list of all registered services.
* *

View File

@ -109,13 +109,13 @@ public:
* @param pos line index * @param pos line index
* @return line at the specified index * @return line at the specified index
*/ */
const responseLine getLineAt(const unsigned int pos) const; const responseLine getLineAt(const size_t pos) const;
/** Return the number of lines in the response. /** Return the number of lines in the response.
* *
* @return number of lines in the response * @return number of lines in the response
*/ */
unsigned int getLineCount() const; size_t getLineCount() const;
/** Return the last line in the response. /** Return the last line in the response.
* *

View File

@ -100,7 +100,7 @@ public:
* the beginning of the list) * the beginning of the list)
* @param param parameter to insert * @param param parameter to insert
*/ */
void insertParameterBefore(const int pos, ref <parameter> param); void insertParameterBefore(const size_t pos, ref <parameter> param);
/** Insert a new parameter after the specified parameter. /** Insert a new parameter after the specified parameter.
* *
@ -115,7 +115,7 @@ public:
* @param pos position of the parameter before the new parameter * @param pos position of the parameter before the new parameter
* @param param parameter to insert * @param param parameter to insert
*/ */
void insertParameterAfter(const int pos, ref <parameter> param); void insertParameterAfter(const size_t pos, ref <parameter> param);
/** Remove the specified parameter from the list. /** Remove the specified parameter from the list.
* *
@ -128,7 +128,7 @@ public:
* *
* @param pos position of the parameter to remove * @param pos position of the parameter to remove
*/ */
void removeParameter(const int pos); void removeParameter(const size_t pos);
/** Remove all parameters from the list. /** Remove all parameters from the list.
*/ */
@ -138,7 +138,7 @@ public:
* *
* @return number of parameters * @return number of parameters
*/ */
int getParameterCount() const; size_t getParameterCount() const;
/** Tests whether the list of parameters is empty. /** Tests whether the list of parameters is empty.
* *
@ -151,14 +151,14 @@ public:
* @param pos position * @param pos position
* @return parameter at position 'pos' * @return parameter at position 'pos'
*/ */
const ref <parameter> getParameterAt(const int pos); const ref <parameter> getParameterAt(const size_t pos);
/** Return the parameter at the specified position. /** Return the parameter at the specified position.
* *
* @param pos position * @param pos position
* @return parameter at position 'pos' * @return parameter at position 'pos'
*/ */
const ref <const parameter> getParameterAt(const int pos) const; const ref <const parameter> getParameterAt(const size_t pos) const;
/** Return the parameter list. /** Return the parameter list.
* *

View File

@ -50,7 +50,7 @@ public:
const ref <const contentHandler> getText() const; const ref <const contentHandler> getText() const;
void setText(ref <contentHandler> text); void setText(ref <contentHandler> text);
int getPartCount() const; size_t getPartCount() const;
void generateIn(ref <bodyPart> message, ref <bodyPart> parent) const; void generateIn(ref <bodyPart> message, ref <bodyPart> parent) const;
void parse(ref <const bodyPart> message, ref <const bodyPart> parent, ref <const bodyPart> textPart); void parse(ref <const bodyPart> message, ref <const bodyPart> parent, ref <const bodyPart> textPart);

View File

@ -72,20 +72,20 @@ public:
* the beginning of the list) * the beginning of the list)
* @param w word to insert * @param w word to insert
*/ */
void insertWordBefore(const int pos, ref <word> w); void insertWordBefore(const size_t pos, ref <word> w);
/** Insert a new word after the specified position. /** Insert a new word after the specified position.
* *
* @param pos position of the word before the new word * @param pos position of the word before the new word
* @param w word to insert * @param w word to insert
*/ */
void insertWordAfter(const int pos, ref <word> w); void insertWordAfter(const size_t pos, ref <word> w);
/** Remove the word at the specified position. /** Remove the word at the specified position.
* *
* @param pos position of the word to remove * @param pos position of the word to remove
*/ */
void removeWord(const int pos); void removeWord(const size_t pos);
/** Remove all words from the list. /** Remove all words from the list.
*/ */
@ -95,7 +95,7 @@ public:
* *
* @return number of words * @return number of words
*/ */
int getWordCount() const; size_t getWordCount() const;
/** Tests whether the list of words is empty. /** Tests whether the list of words is empty.
* *
@ -108,14 +108,14 @@ public:
* @param pos position * @param pos position
* @return word at position 'pos' * @return word at position 'pos'
*/ */
const ref <word> getWordAt(const int pos); const ref <word> getWordAt(const size_t pos);
/** Return the word at the specified position. /** Return the word at the specified position.
* *
* @param pos position * @param pos position
* @return word at position 'pos' * @return word at position 'pos'
*/ */
const ref <const word> getWordAt(const int pos) const; const ref <const word> getWordAt(const size_t pos) const;
/** Return the word list. /** Return the word list.
* *

View File

@ -87,7 +87,7 @@ public:
* *
* @return number of body parts * @return number of body parts
*/ */
virtual int getPartCount() const = 0; virtual size_t getPartCount() const = 0;
/** Generate the text part(s) into the specified message. /** Generate the text part(s) into the specified message.
* *

View File

@ -44,6 +44,10 @@ namespace vmime
typedef vmime_uint8 byte_t; typedef vmime_uint8 byte_t;
typedef std::vector <byte_t> byteArray; typedef std::vector <byte_t> byteArray;
#if !VMIME_HAVE_SIZE_T
typedef unsigned long size_t;
#endif // !VMIME_HAVE_SIZE_T
// Some aliases // Some aliases
namespace utils = utility; namespace utils = utility;

View File

@ -127,14 +127,14 @@ public:
* *
* @return number of registered encoders * @return number of registered encoders
*/ */
int getEncoderCount() const; size_t getEncoderCount() const;
/** Return the registered encoder at the specified position. /** Return the registered encoder at the specified position.
* *
* @param pos position of the registered encoder to return * @param pos position of the registered encoder to return
* @return registered encoder at the specified position * @return registered encoder at the specified position
*/ */
const ref <const registeredEncoder> getEncoderAt(const int pos) const; const ref <const registeredEncoder> getEncoderAt(const size_t pos) const;
/** Return a list of all registered encoders. /** Return a list of all registered encoders.
* *

View File

@ -80,14 +80,14 @@ public:
* @param pos position * @param pos position
* @return component at position 'pos' * @return component at position 'pos'
*/ */
const component& getComponentAt(const int pos) const; const component& getComponentAt(const size_t pos) const;
/** Return the component at the specified position. /** Return the component at the specified position.
* *
* @param pos position * @param pos position
* @return component at position 'pos' * @return component at position 'pos'
*/ */
component& getComponentAt(const int pos); component& getComponentAt(const size_t pos);
/** Test whether this path is empty (root). /** Test whether this path is empty (root).
* *
@ -117,21 +117,21 @@ public:
* *
* @return number of components * @return number of components
*/ */
int getSize() const; size_t getSize() const;
/** Return the specified component of the path (const version). /** Return the specified component of the path (const version).
* *
* @param x index of the component * @param x index of the component
* @return component at the specified index * @return component at the specified index
*/ */
const component& operator[](const int x) const; const component& operator[](const size_t x) const;
/** Return the specified component of the path (non-const version). /** Return the specified component of the path (non-const version).
* *
* @param x index of the component * @param x index of the component
* @return component at the specified index * @return component at the specified index
*/ */
component& operator[](const int x); component& operator[](const size_t x);
/** Test whether this path is a direct parent of another one. /** Test whether this path is a direct parent of another one.
* *

View File

@ -65,7 +65,7 @@ public:
* @param randomChars list of characters to use * @param randomChars list of characters to use
* @return random string * @return random string
*/ */
static const string getString(const int length, const string& randomChars static const string getString(const string::size_type length, const string& randomChars
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
protected: protected: