From 7e0e54eba331339606265a8a4e11417bb2f832ba Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 16 Jul 2014 12:32:47 +0200 Subject: [PATCH] Move typedef OperIndex to ServerConfig::OperIndex --- include/configreader.h | 4 ++++ include/typedefs.h | 3 --- src/coremods/core_oper/cmd_oper.cpp | 2 +- src/coremods/core_stats.cpp | 2 +- src/modules/m_ldapoper.cpp | 4 ++-- src/modules/m_spanningtree/opertype.cpp | 2 +- src/modules/m_sqloper.cpp | 2 +- src/modules/m_sslinfo.cpp | 4 ++-- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/configreader.h b/include/configreader.h index 8615388d5..f3137ec0a 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -231,6 +231,10 @@ class CoreExport ServerConfig */ typedef std::vector > ClassVector; + /** Index of valid oper blocks and types + */ + typedef std::map > OperIndex; + /** Get a configuration tag * @param tag The name of the tag to get */ diff --git a/include/typedefs.h b/include/typedefs.h index 85d86504f..8f9a64888 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -82,9 +82,6 @@ typedef ConfigDataHash::const_iterator ConfigIter; /** Iterator pair, used for tag-name ranges */ typedef std::pair ConfigTagList; -/** Index of valid oper blocks and types */ -typedef std::map > OperIndex; - /** Files read by the configuration */ typedef std::map ConfigFileCache; diff --git a/src/coremods/core_oper/cmd_oper.cpp b/src/coremods/core_oper/cmd_oper.cpp index 8c0d05ce2..e4ba69549 100644 --- a/src/coremods/core_oper/cmd_oper.cpp +++ b/src/coremods/core_oper/cmd_oper.cpp @@ -37,7 +37,7 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L const std::string userHost = user->ident + "@" + user->host; const std::string userIP = user->ident + "@" + user->GetIPString(); - OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); + ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); if (i != ServerInstance->Config->oper_blocks.end()) { OperInfo* ifo = i->second; diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index f9cd78ddd..a6df511d9 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -317,7 +317,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results) break; case 'O': { - for (OperIndex::const_iterator i = ServerInstance->Config->OperTypes.begin(); i != ServerInstance->Config->OperTypes.end(); ++i) + for (ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->OperTypes.begin(); i != ServerInstance->Config->OperTypes.end(); ++i) { OperInfo* tag = i->second; tag->init(); diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp index 36238f846..9deb9a203 100644 --- a/src/modules/m_ldapoper.cpp +++ b/src/modules/m_ldapoper.cpp @@ -83,7 +83,7 @@ class BindInterface : public LDAPOperBase void OnResult(const LDAPResult& r) CXX11_OVERRIDE { User* user = ServerInstance->FindUUID(uid); - OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(opername); + ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->oper_blocks.find(opername); if (!user || iter == ServerInstance->Config->oper_blocks.end()) { @@ -208,7 +208,7 @@ class ModuleLDAPAuth : public Module const std::string& opername = parameters[0]; const std::string& password = parameters[1]; - OperIndex::iterator it = ServerInstance->Config->oper_blocks.find(opername); + ServerConfig::OperIndex::const_iterator it = ServerInstance->Config->oper_blocks.find(opername); if (it == ServerInstance->Config->oper_blocks.end()) return MOD_RES_PASSTHRU; diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp index 1a9e36f72..16d752966 100644 --- a/src/modules/m_spanningtree/opertype.cpp +++ b/src/modules/m_spanningtree/opertype.cpp @@ -35,7 +35,7 @@ CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector& ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER); u->SetMode(opermh, true); - OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(opertype); + ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(opertype); if (iter != ServerInstance->Config->OperTypes.end()) u->oper = iter->second; else diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 3d5551eb0..d6581682c 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -78,7 +78,7 @@ class OpMeQuery : public SQLQuery bool OperUser(User* user, const std::string &pattern, const std::string &type) { - OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(type); + ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(type); if (iter == ServerInstance->Config->OperTypes.end()) { ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "bad type '%s' in returned row for oper %s", type.c_str(), username.c_str()); diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 656a9a432..cac09a412 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -168,7 +168,7 @@ class ModuleSSLInfo : public Module { if ((command == "OPER") && (validated)) { - OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); + ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); if (i != ServerInstance->Config->oper_blocks.end()) { OperInfo* ifo = i->second; @@ -208,7 +208,7 @@ class ModuleSSLInfo : public Module if (!cert || cert->fingerprint.empty()) return; // find an auto-oper block for this user - for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++) + for (ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); ++i) { OperInfo* ifo = i->second; std::string fp = ifo->oper_block->getString("fingerprint"); -- 2.39.5