mu-contacts: fix some compiler warnings
This commit is contained in:
@ -37,7 +37,6 @@ AM_CFLAGS= \
|
|||||||
$(json_flag) \
|
$(json_flag) \
|
||||||
-Wno-format-nonliteral \
|
-Wno-format-nonliteral \
|
||||||
-Wno-switch-enum \
|
-Wno-switch-enum \
|
||||||
-Wno-suggest-attribute=format \
|
|
||||||
-Wno-deprecated-declarations \
|
-Wno-deprecated-declarations \
|
||||||
-Wno-inline
|
-Wno-inline
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
#include "mu-contacts.hh"
|
#include "mu-contacts.hh"
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -90,7 +89,7 @@ struct ContactInfoLessThan {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using ContactUMap = std::unordered_map<std::string, ContactInfo, EmailHash, EmailEqual>;
|
using ContactUMap = std::unordered_map<const std::string, ContactInfo, EmailHash, EmailEqual>;
|
||||||
//using ContactUSet = std::unordered_set<ContactInfo, ContactInfoHash, ContactInfoEqual>;
|
//using ContactUSet = std::unordered_set<ContactInfo, ContactInfoHash, ContactInfoEqual>;
|
||||||
using ContactSet = std::set<std::reference_wrapper<const ContactInfo>, ContactInfoLessThan>;
|
using ContactSet = std::set<std::reference_wrapper<const ContactInfo>, ContactInfoLessThan>;
|
||||||
|
|
||||||
@ -150,7 +149,7 @@ Contacts::serialize() const
|
|||||||
std::lock_guard<std::mutex> l_{priv_->mtx_};
|
std::lock_guard<std::mutex> l_{priv_->mtx_};
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
||||||
for (const auto& item: priv_->contacts_) {
|
for (auto& item: priv_->contacts_) {
|
||||||
const auto& ci{item.second};
|
const auto& ci{item.second};
|
||||||
s += Mux::format("%s%s"
|
s += Mux::format("%s%s"
|
||||||
"%s%s"
|
"%s%s"
|
||||||
@ -188,9 +187,9 @@ Contacts::add (ContactInfo&& ci)
|
|||||||
if (!ci.name.empty())
|
if (!ci.name.empty())
|
||||||
ci2.name = std::move(ci.name);
|
ci2.name = std::move(ci.name);
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
priv_->contacts_.emplace(std::move(email), std::move(ci));
|
priv_->contacts_.emplace(
|
||||||
}
|
ContactUMap::value_type(std::move(email), std::move(ci)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <string>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user