From b68ca06e46fa498425e2cb545cf44e0580bc7531 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 13 Mar 2016 17:45:19 +0100 Subject: [PATCH] Issue #126: fixed some warnings. --- src/vmime/net/folderAttributes.cpp | 3 ++- src/vmime/net/imap/IMAPUtils.cpp | 4 ++++ src/vmime/net/maildir/maildirStore.cpp | 2 +- src/vmime/net/pop3/POP3Folder.cpp | 5 ++++- src/vmime/net/pop3/POP3Message.cpp | 2 +- src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp | 2 +- src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp | 2 +- src/vmime/object.cpp | 1 + 8 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/vmime/net/folderAttributes.cpp b/src/vmime/net/folderAttributes.cpp index 027efddf..1a283764 100644 --- a/src/vmime/net/folderAttributes.cpp +++ b/src/vmime/net/folderAttributes.cpp @@ -45,7 +45,8 @@ folderAttributes::folderAttributes() folderAttributes::folderAttributes(const folderAttributes& attribs) - : m_type(attribs.m_type), + : object(), + m_type(attribs.m_type), m_flags(attribs.m_flags), m_userFlags(attribs.m_userFlags), m_specialUse(attribs.m_specialUse) diff --git a/src/vmime/net/imap/IMAPUtils.cpp b/src/vmime/net/imap/IMAPUtils.cpp index 45545954..578e1379 100644 --- a/src/vmime/net/imap/IMAPUtils.cpp +++ b/src/vmime/net/imap/IMAPUtils.cpp @@ -456,6 +456,10 @@ void IMAPUtils::mailboxFlagsToFolderAttributes specialUse = folderAttributes::SPECIALUSE_IMPORTANT; break; + + default: + + break; } } diff --git a/src/vmime/net/maildir/maildirStore.cpp b/src/vmime/net/maildir/maildirStore.cpp index 606fbead..b6efa62d 100644 --- a/src/vmime/net/maildir/maildirStore.cpp +++ b/src/vmime/net/maildir/maildirStore.cpp @@ -123,7 +123,7 @@ bool maildirStore::isValidFolderName(const folder::path::component& name) const // Name cannot start with '.' const size_t length = buf.length(); - int pos = 0; + size_t pos = 0; while ((pos < length) && (buf[pos] == '.')) ++pos; diff --git a/src/vmime/net/pop3/POP3Folder.cpp b/src/vmime/net/pop3/POP3Folder.cpp index 435a57e9..17c6bf9e 100644 --- a/src/vmime/net/pop3/POP3Folder.cpp +++ b/src/vmime/net/pop3/POP3Folder.cpp @@ -672,11 +672,14 @@ shared_ptr POP3Folder::getStatus() throw exceptions::command_error("STAT", response->getFirstLine()); - unsigned int count = 0; + int count = 0; std::istringstream iss(response->getText()); iss >> count; + if (count < 0) + throw exceptions::invalid_response("STAT", response->getText()); + shared_ptr status = make_shared (); status->setMessageCount(count); diff --git a/src/vmime/net/pop3/POP3Message.cpp b/src/vmime/net/pop3/POP3Message.cpp index 888415e3..07684dce 100644 --- a/src/vmime/net/pop3/POP3Message.cpp +++ b/src/vmime/net/pop3/POP3Message.cpp @@ -156,7 +156,7 @@ void POP3Message::extract try { POP3Response::readLargeResponse - (store->getConnection(), os, progress, m_size == -1 ? 0 : m_size); + (store->getConnection(), os, progress, m_size == static_cast (-1) ? 0 : m_size); } catch (exceptions::command_error& e) { diff --git a/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp b/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp index 5faafdbe..94503948 100644 --- a/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp +++ b/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp @@ -601,7 +601,7 @@ int TLSSocket_OpenSSL::bio_puts(BIO* bio, const char* str) // static -long TLSSocket_OpenSSL::bio_ctrl(BIO* bio, int cmd, long num, void* ptr) +long TLSSocket_OpenSSL::bio_ctrl(BIO* bio, int cmd, long num, void* /* ptr */) { long ret = 1; diff --git a/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp b/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp index b4b90098..34324b8c 100644 --- a/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp +++ b/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp @@ -118,7 +118,7 @@ private: SSL* m_ssl; - unsigned long m_status; + unsigned int m_status; // Last exception thrown from C BIO functions scoped_ptr m_ex; diff --git a/src/vmime/object.cpp b/src/vmime/object.cpp index d07c3c19..1c0d331f 100644 --- a/src/vmime/object.cpp +++ b/src/vmime/object.cpp @@ -35,6 +35,7 @@ object::object() object::object(const object&) + : enable_shared_from_this () { }