From 47a1e2b2303d4d7adabad9a56acc26cd79b70ef5 Mon Sep 17 00:00:00 2001 From: Ravomavain Date: Fri, 26 Aug 2011 08:05:39 +0200 Subject: [PATCH] Fix banmaster compilation. Fix some sign-compare warnings --- src/banmaster/banmaster.cpp | 10 +++++----- src/engine/server/server.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/banmaster/banmaster.cpp b/src/banmaster/banmaster.cpp index e2e6c2f0d..c0fc2249c 100644 --- a/src/banmaster/banmaster.cpp +++ b/src/banmaster/banmaster.cpp @@ -134,7 +134,7 @@ void PurgeBans() } } -void ConBan(IConsole::IResult *pResult, void *pUser, int ClientID) +void ConBan(IConsole::IResult *pResult, void *pUser) { NETADDR Addr; const char *pStr = pResult->GetString(0); @@ -149,12 +149,12 @@ void ConBan(IConsole::IResult *pResult, void *pUser, int ClientID) dbg_msg("banmaster", "invalid network address to ban, str='%s'", pStr); } -void ConUnbanAll(IConsole::IResult *pResult, void *pUser, int ClientID) +void ConUnbanAll(IConsole::IResult *pResult, void *pUser) { ClearBans(); } -void ConSetBindAddr(IConsole::IResult *pResult, void *pUser, int ClientID) +void ConSetBindAddr(IConsole::IResult *pResult, void *pUser) { if(m_aBindAddr[0]) return; @@ -177,7 +177,7 @@ int main(int argc, const char **argv) // ignore_convention IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); // ignore_convention m_pConsole = CreateConsole(CFGFLAG_BANMASTER); - m_pConsole->RegisterPrintCallback(StandardOutput, 0); + m_pConsole->RegisterPrintCallback(2, StandardOutput, 0); m_pConsole->Register("ban", "s?r", CFGFLAG_BANMASTER, ConBan, 0, "Bans the specified ip"); m_pConsole->Register("unban_all", "", CFGFLAG_BANMASTER, ConUnbanAll, 0, "Unbans all ips"); m_pConsole->Register("bind", "s", CFGFLAG_BANMASTER, ConSetBindAddr, 0, "Binds to the specified address"); @@ -222,7 +222,7 @@ int main(int argc, const char **argv) // ignore_convention char aAddressStr[NETADDR_MAXSTRSIZE]; net_addr_str(&Packet.m_Address, aAddressStr, sizeof(aAddressStr)); - if(Packet.m_DataSize >= sizeof(BANMASTER_IPCHECK) && mem_comp(Packet.m_pData, BANMASTER_IPCHECK, sizeof(BANMASTER_IPCHECK)) == 0) + if((unsigned)Packet.m_DataSize >= sizeof(BANMASTER_IPCHECK) && mem_comp(Packet.m_pData, BANMASTER_IPCHECK, sizeof(BANMASTER_IPCHECK)) == 0) { char *pAddr = (char *)Packet.m_pData + sizeof(BANMASTER_IPCHECK); NETADDR CheckAddr; diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 8dc6bc484..42ffc8041 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1111,7 +1111,7 @@ void CServer::PumpNetwork() { }*/ - if(Packet.m_DataSize >= sizeof(BANMASTER_IPBAN) && + if((unsigned)Packet.m_DataSize >= sizeof(BANMASTER_IPBAN) && mem_comp(Packet.m_pData, BANMASTER_IPBAN, sizeof(BANMASTER_IPBAN)) == 0) { if(!g_Config.m_SvGlobalBantime)