mirror of https://github.com/djcb/mu.git
build: fix some compiler warnings
This commit is contained in:
parent
1f9172a008
commit
cade7493fd
|
@ -129,6 +129,8 @@ struct Contact {
|
||||||
* @return the field-id or Nothing.
|
* @return the field-id or Nothing.
|
||||||
*/
|
*/
|
||||||
constexpr Option<Field::Id> field_id() const noexcept {
|
constexpr Option<Field::Id> field_id() const noexcept {
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Type::Bcc:
|
case Type::Bcc:
|
||||||
return Field::Id::Bcc;
|
return Field::Id::Bcc;
|
||||||
|
@ -141,6 +143,7 @@ struct Contact {
|
||||||
default:
|
default:
|
||||||
return Nothing;
|
return Nothing;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,6 +170,8 @@ private:
|
||||||
constexpr Option<Contact::Type>
|
constexpr Option<Contact::Type>
|
||||||
contact_type_from_field_id(Field::Id id) noexcept {
|
contact_type_from_field_id(Field::Id id) noexcept {
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case Field::Id::Bcc:
|
case Field::Id::Bcc:
|
||||||
return Contact::Type::Bcc;
|
return Contact::Type::Bcc;
|
||||||
|
@ -179,6 +184,7 @@ contact_type_from_field_id(Field::Id id) noexcept {
|
||||||
default:
|
default:
|
||||||
return Nothing;
|
return Nothing;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
using Contacts = std::vector<Contact>;
|
using Contacts = std::vector<Contact>;
|
||||||
|
|
|
@ -490,6 +490,9 @@ handle_object(const MimeObject& parent,
|
||||||
info.flags |= Flags::Encrypted;
|
info.flags |= Flags::Encrypted;
|
||||||
} else if (obj.is_mime_application_pkcs7_mime()) {
|
} else if (obj.is_mime_application_pkcs7_mime()) {
|
||||||
MimeApplicationPkcs7Mime smime(obj);
|
MimeApplicationPkcs7Mime smime(obj);
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
|
// CompressedData, CertsOnly, Unknown
|
||||||
switch (smime.smime_type()) {
|
switch (smime.smime_type()) {
|
||||||
case Mu::MimeApplicationPkcs7Mime::SecureMimeType::SignedData:
|
case Mu::MimeApplicationPkcs7Mime::SecureMimeType::SignedData:
|
||||||
info.flags |= Flags::Signed;
|
info.flags |= Flags::Signed;
|
||||||
|
@ -500,6 +503,7 @@ handle_object(const MimeObject& parent,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,6 +722,7 @@ fill_document(Message::Private& priv)
|
||||||
break;
|
break;
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
case Field::Id::_count_:
|
case Field::Id::_count_:
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,6 +331,7 @@ address_type(Contact::Type ctype)
|
||||||
return GMIME_ADDRESS_TYPE_REPLY_TO;
|
return GMIME_ADDRESS_TYPE_REPLY_TO;
|
||||||
case Contact::Type::Sender:
|
case Contact::Type::Sender:
|
||||||
return GMIME_ADDRESS_TYPE_SENDER;
|
return GMIME_ADDRESS_TYPE_SENDER;
|
||||||
|
case Contact::Type::None:
|
||||||
default:
|
default:
|
||||||
return Nothing;
|
return Nothing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,18 +71,6 @@ Result<void> maildir_link(const std::string& src, const std::string& targetpath)
|
||||||
*/
|
*/
|
||||||
Result<void> maildir_clear_links(const std::string& dir);
|
Result<void> maildir_clear_links(const std::string& dir);
|
||||||
|
|
||||||
/**
|
|
||||||
* get the maildir for a certain message path, ie, the path *before*
|
|
||||||
* cur/ or new/ and *after* the root.
|
|
||||||
*
|
|
||||||
* @param path path for some message
|
|
||||||
* @param root filesystem root for the maildir
|
|
||||||
*
|
|
||||||
* @return the maildir or an Error
|
|
||||||
*/
|
|
||||||
Result<std::string> maildir_from_path(const std::string& path,
|
|
||||||
const std::string& root);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move a message file to another maildir. If the target file already exists, it
|
* Move a message file to another maildir. If the target file already exists, it
|
||||||
* is overwritten.
|
* is overwritten.
|
||||||
|
|
|
@ -96,6 +96,8 @@ process_value(const std::string& field, const std::string& value)
|
||||||
{
|
{
|
||||||
const auto id_opt{field_from_name(field)};
|
const auto id_opt{field_from_name(field)};
|
||||||
if (id_opt) {
|
if (id_opt) {
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
switch (id_opt->id) {
|
switch (id_opt->id) {
|
||||||
case Field::Id::Priority: {
|
case Field::Id::Priority: {
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
|
@ -108,6 +110,7 @@ process_value(const std::string& field, const std::string& value)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
return value; // XXX prio/flags, etc. alias
|
return value; // XXX prio/flags, etc. alias
|
||||||
|
|
|
@ -415,6 +415,9 @@ operator<<(std::ostream& os, Sexp::Type id)
|
||||||
case Sexp::Type::Symbol:
|
case Sexp::Type::Symbol:
|
||||||
os << "symbol";
|
os << "symbol";
|
||||||
break;
|
break;
|
||||||
|
case Sexp::Type::Raw:
|
||||||
|
os << "raw";
|
||||||
|
break;
|
||||||
case Sexp::Type::Empty:
|
case Sexp::Type::Empty:
|
||||||
os << "empty";
|
os << "empty";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
#include "mu-error.hh"
|
#include "mu-error.hh"
|
||||||
#include "mu-option.hh"
|
#include "mu-option.hh"
|
||||||
|
|
||||||
#include "message/mu-message-file.hh"
|
|
||||||
|
|
||||||
using namespace Mu;
|
using namespace Mu;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
Loading…
Reference in New Issue