mirror of https://github.com/aria2/aria2
Fix compiler warning
parent
9f5758570a
commit
80df934955
|
@ -59,7 +59,7 @@ DHTPeerAnnounceStorage::DHTPeerAnnounceStorage()
|
||||||
|
|
||||||
bool DHTPeerAnnounceStorage::InfoHashLess::
|
bool DHTPeerAnnounceStorage::InfoHashLess::
|
||||||
operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
|
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;
|
return memcmp(lhs->getInfoHash(), rhs->getInfoHash(), DHT_ID_LENGTH) < 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ private:
|
||||||
class InfoHashLess {
|
class InfoHashLess {
|
||||||
public:
|
public:
|
||||||
bool operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
|
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>
|
typedef std::set<std::shared_ptr<DHTPeerAnnounceEntry>, InfoHashLess>
|
||||||
DHTPeerAnnounceEntrySet;
|
DHTPeerAnnounceEntrySet;
|
||||||
|
|
|
@ -143,7 +143,10 @@ namespace {
|
||||||
template <typename T> class Unique {
|
template <typename T> class Unique {
|
||||||
typedef T type;
|
typedef T type;
|
||||||
struct PointerCmp {
|
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;
|
std::set<const type*, PointerCmp> known;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue