diff options
author | Peter Powell <petpow@saberuk.com> | 2017-11-17 00:02:03 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-11-17 15:33:01 +0000 |
commit | 36040be2952186d56a6646ee7d972aaafdd4e31a (patch) | |
tree | 72be7108a94dd6bd0ea2842c53ba8890c44d12d8 /src/modules/m_spanningtree | |
parent | 3b51dfb1d611a874c3f1138d1c1ec1bb8984334c (diff) |
Fix a ton of -Wsign-conversion warnings.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/link.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree/server.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.h | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/modules/m_spanningtree/link.h b/src/modules/m_spanningtree/link.h index 632982623..465e65ff8 100644 --- a/src/modules/m_spanningtree/link.h +++ b/src/modules/m_spanningtree/link.h @@ -33,7 +33,7 @@ class Link : public refcountbase std::vector<std::string> AllowMasks; bool HiddenFromStats; std::string Hook; - int Timeout; + unsigned int Timeout; std::string Bind; bool Hidden; Link(ConfigTag* Tag) : tag(Tag) {} diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 2d76102bc..4acd15d62 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -273,12 +273,12 @@ void ModuleSpanningTree::AutoConnectServers(time_t curtime) void ModuleSpanningTree::DoConnectTimeout(time_t curtime) { - std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = Utils->timeoutlist.begin(); + SpanningTreeUtilities::TimeoutList::iterator i = Utils->timeoutlist.begin(); while (i != Utils->timeoutlist.end()) { TreeSocket* s = i->first; - std::pair<std::string, int> p = i->second; - std::map<TreeSocket*, std::pair<std::string, int> >::iterator me = i; + std::pair<std::string, unsigned int> p = i->second; + SpanningTreeUtilities::TimeoutList::iterator me = i; i++; if (s->GetLinkState() == DYING) { @@ -287,7 +287,7 @@ void ModuleSpanningTree::DoConnectTimeout(time_t curtime) } else if (curtime > s->age + p.second) { - ServerInstance->SNO->WriteToSnoMask('l',"CONNECT: Error connecting \002%s\002 (timeout of %d seconds)",p.first.c_str(),p.second); + ServerInstance->SNO->WriteToSnoMask('l',"CONNECT: Error connecting \002%s\002 (timeout of %u seconds)",p.first.c_str(),p.second); Utils->timeoutlist.erase(me); s->Close(); } diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 50f63e117..ecdad87f8 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -86,7 +86,7 @@ void CommandServer::HandleExtra(TreeServer* newserver, const std::vector<std::st } if (key == "burst") - newserver->BeginBurst(ConvToUInt64(val)); + newserver->BeginBurst(ConvToNum<uint64_t>(val)); } } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 370c38d2c..f9dccf7ce 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -46,7 +46,7 @@ TreeSocket::TreeSocket(Link* link, Autoconnect* myac, const std::string& ipaddr) capab->capab_phase = 0; DoConnect(ipaddr, link->Port, link->Timeout, link->Bind); - Utils->timeoutlist[this] = std::pair<std::string, int>(linkID, link->Timeout); + Utils->timeoutlist[this] = std::pair<std::string, unsigned int>(linkID, link->Timeout); SendCapabilities(1); } @@ -77,7 +77,7 @@ TreeSocket::TreeSocket(int newfd, ListenSocket* via, irc::sockets::sockaddrs* cl SendCapabilities(1); - Utils->timeoutlist[this] = std::pair<std::string, int>(linkID, 30); + Utils->timeoutlist[this] = std::pair<std::string, unsigned int>(linkID, 30); } void TreeSocket::CleanNegotiationInfo() diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 79dc24e6a..0a96ecfcd 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -118,7 +118,7 @@ CullResult SpanningTreeUtilities::cull() sock->Close(); } - for(std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = timeoutlist.begin(); i != timeoutlist.end(); ++i) + for(TimeoutList::iterator i = timeoutlist.begin(); i != timeoutlist.end(); ++i) { TreeSocket* s = i->first; s->Close(); @@ -235,7 +235,7 @@ void SpanningTreeUtilities::ReadConfiguration() if (PingFreq == 0) PingFreq = 60; - if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1) + if (PingWarnTime > PingFreq - 1) PingWarnTime = 0; AutoconnectBlocks.clear(); diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index f262f9a48..3d34b93a6 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -48,7 +48,7 @@ class SpanningTreeUtilities : public classbase public: typedef std::set<TreeSocket*> TreeSocketSet; - typedef std::map<TreeSocket*, std::pair<std::string, int> > TimeoutList; + typedef std::map<TreeSocket*, std::pair<std::string, unsigned int> > TimeoutList; /** Creator module */ @@ -75,7 +75,7 @@ class SpanningTreeUtilities : public classbase /* Number of seconds that a server can go without ping * before opers are warned of high latency. */ - int PingWarnTime; + unsigned int PingWarnTime; /** This variable represents the root of the server tree */ TreeServer *TreeRoot; @@ -100,7 +100,7 @@ class SpanningTreeUtilities : public classbase /** Ping frequency of server to server links */ - int PingFreq; + unsigned int PingFreq; /** Initialise utility class */ |