summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2019-09-15 11:26:48 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2019-09-15 11:26:48 +0900
commit80df934955720d2b5102bed93b4612d288038113 (patch)
treef5161b03248d2f4befb9c1b20e6495e59064b8eb
parent9f5758570a51feca6a468aea6a29377566addd87 (diff)
Fix compiler warning
-rw-r--r--src/DHTPeerAnnounceStorage.cc2
-rw-r--r--src/DHTPeerAnnounceStorage.h2
-rw-r--r--src/SessionSerializer.cc5
3 files changed, 6 insertions, 3 deletions
diff --git a/src/DHTPeerAnnounceStorage.cc b/src/DHTPeerAnnounceStorage.cc
index 1bbb1778..37b4bf82 100644
--- a/src/DHTPeerAnnounceStorage.cc
+++ b/src/DHTPeerAnnounceStorage.cc
@@ -59,7 +59,7 @@ DHTPeerAnnounceStorage::DHTPeerAnnounceStorage()
bool DHTPeerAnnounceStorage::InfoHashLess::
operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
- const std::shared_ptr<DHTPeerAnnounceEntry>& rhs)
+ const std::shared_ptr<DHTPeerAnnounceEntry>& rhs) const
{
return memcmp(lhs->getInfoHash(), rhs->getInfoHash(), DHT_ID_LENGTH) < 0;
}
diff --git a/src/DHTPeerAnnounceStorage.h b/src/DHTPeerAnnounceStorage.h
index b966b599..94fd6be0 100644
--- a/src/DHTPeerAnnounceStorage.h
+++ b/src/DHTPeerAnnounceStorage.h
@@ -54,7 +54,7 @@ private:
class InfoHashLess {
public:
bool operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
- const std::shared_ptr<DHTPeerAnnounceEntry>& rhs);
+ const std::shared_ptr<DHTPeerAnnounceEntry>& rhs) const;
};
typedef std::set<std::shared_ptr<DHTPeerAnnounceEntry>, InfoHashLess>
DHTPeerAnnounceEntrySet;
diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc
index 86c815d8..363cb6ff 100644
--- a/src/SessionSerializer.cc
+++ b/src/SessionSerializer.cc
@@ -143,7 +143,10 @@ namespace {
template <typename T> class Unique {
typedef T type;
struct PointerCmp {
- inline bool operator()(const type* x, const type* y) { return *x < *y; }
+ inline bool operator()(const type* x, const type* y) const
+ {
+ return *x < *y;
+ }
};
std::set<const type*, PointerCmp> known;