From f209cce90b394acd26e22eacef0bff61e8f5b4e1 Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 14 Feb 2009 21:14:36 +0000 Subject: Nuke trailing spaces git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11105 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sqloper.cpp | 1 - src/modules/extra/m_sqlutils.h | 14 ++++---- src/modules/extra/m_ssl_gnutls.cpp | 8 ++--- src/modules/m_alias.cpp | 8 ++--- src/modules/m_chanprotect.cpp | 2 +- src/modules/m_dccallow.cpp | 7 ++-- src/modules/m_filter.cpp | 7 ++-- src/modules/m_operprefix.cpp | 5 ++- src/modules/m_override.cpp | 2 +- src/modules/m_regex.h | 2 +- src/modules/m_satopic.cpp | 2 +- src/modules/m_services_account.cpp | 2 +- src/modules/m_servprotect.cpp | 2 +- src/modules/m_spanningtree/treeserver.cpp | 2 -- src/modules/m_spanningtree/treeserver.h | 6 ++-- src/modules/m_spanningtree/treesocket2.cpp | 4 +-- src/modules/rpc.h | 58 +++++++++++++++--------------- src/modules/transport.h | 3 +- 18 files changed, 63 insertions(+), 72 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index c7c2e0c0d..b16ebd12b 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -73,7 +73,6 @@ public: ServerInstance->Modules->Attach(eventlist, this, 3); } - bool OneOfMatches(const char* host, const char* ip, const char* hostlist) { std::stringstream hl(hostlist); diff --git a/src/modules/extra/m_sqlutils.h b/src/modules/extra/m_sqlutils.h index dab9c721a..6fb741531 100644 --- a/src/modules/extra/m_sqlutils.h +++ b/src/modules/extra/m_sqlutils.h @@ -34,12 +34,12 @@ public: /** User */ User* user; - + AssociateUser(Module* s, Module* d, unsigned long i, User* u) : Request(s, d, SQLUTILAU), id(i), user(u) { } - + AssociateUser& S() { Send(); @@ -58,12 +58,12 @@ public: /** Channel */ Channel* chan; - + AssociateChan(Module* s, Module* d, unsigned long i, Channel* u) : Request(s, d, SQLUTILAC), id(i), chan(u) { } - + AssociateChan& S() { Send(); @@ -84,7 +84,7 @@ public: : Request(s, d, SQLUTILUA), id(i) { } - + UnAssociate& S() { Send(); @@ -108,7 +108,7 @@ public: : Request(s, d, SQLUTILGU), id(i), user(NULL) { } - + GetAssocUser& S() { Send(); @@ -132,7 +132,7 @@ public: : Request(s, d, SQLUTILGC), id(i), chan(NULL) { } - + GetAssocChan& S() { Send(); diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 1a8da4da3..4d3c8fd86 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -240,7 +240,7 @@ class ModuleSSLGnuTLS : public Module keyfile = confdir + keyfile; int ret; - + if (cred_alloc) { // Deallocate the old credentials @@ -249,13 +249,13 @@ class ModuleSSLGnuTLS : public Module } else cred_alloc = true; - + if((ret = gnutls_certificate_allocate_credentials(&x509_cred)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials: %s", gnutls_strerror(ret)); - + if((ret = gnutls_dh_params_init(&dh_params)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters: %s", gnutls_strerror(ret)); - + if((ret =gnutls_certificate_set_x509_trust_file(x509_cred, cafile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 1d601127a..39d19b2bc 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -68,7 +68,7 @@ class ModuleAlias : public Module ConfigReader MyConf(ServerInstance); AllowBots = MyConf.ReadFlag("fantasy", "allowbots", "no", 0); - + std::string fpre = MyConf.ReadValue("fantasy","prefix",0); fprefix = fpre.empty() ? '!' : fpre[0]; @@ -231,7 +231,7 @@ class ModuleAlias : public Module if (i == Aliases.end()) return 0; - + /* Avoid iterating on to other aliases if no patterns match */ std::multimap::iterator upperbound = Aliases.upper_bound(fcommand); @@ -255,7 +255,7 @@ class ModuleAlias : public Module i++; } - + return 0; } @@ -361,7 +361,7 @@ class ModuleAlias : public Module if (c) { /* Channel specific variables */ - SearchAndReplace(newline, std::string("$chan"), c->name); + SearchAndReplace(newline, std::string("$chan"), c->name); } irc::tokenstream ss(newline); diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 892c18bd1..85c8660a2 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -194,7 +194,7 @@ class ChanFounder : public ModeHandler, public FounderProtectBase { return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter); } - + char isoverride=0; Module *Override = ServerInstance->Modules->FindFeature("Override"); if (Override) diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index beb2b32e5..0382ea836 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -135,7 +135,7 @@ class CommandDccallow : public Command user->WriteNumeric(996, "%s %s :You cannot add yourself to your own DCCALLOW list!", user->nick.c_str(), user->nick.c_str()); return CMD_FAILURE; } - + if (!user->GetExt("dccallow_list", dl)) { dl = new dccallowlist; @@ -143,7 +143,7 @@ class CommandDccallow : public Command // add this user to the userlist ul.push_back(user); } - + for (dccallowlist::const_iterator k = dl->begin(); k != dl->end(); ++k) { if (k->nickname == target->nick) @@ -356,7 +356,7 @@ class ModuleDCCAllow : public Module return 0; } } - + user->WriteServ("NOTICE %s :The user %s is not accepting DCC SENDs from you. Your file %s was not sent.", user->nick.c_str(), u->nick.c_str(), filename.c_str()); u->WriteServ("NOTICE %s :%s (%s@%s) attempted to send you a file named %s, which was blocked.", u->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), filename.c_str()); u->WriteServ("NOTICE %s :If you trust %s and were expecting this, you can type /DCCALLOW HELP for information on the DCCALLOW system.", u->nick.c_str(), user->nick.c_str()); @@ -476,4 +476,3 @@ class ModuleDCCAllow : public Module }; MODULE_INIT(ModuleDCCAllow) - diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 71742d596..60ae7e891 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -281,7 +281,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri if (i != exemptfromfilter.end()) return 0; } if (f->action == "block") - { + { ServerInstance->SNO->WriteToSnoMask('A', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered and opers notified: "+f->reason); } @@ -318,7 +318,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector &par std::string checkline; int replacepoint = 0; bool parting = false; - + if (command == "QUIT") { /* QUIT with no reason: nothing to do */ @@ -348,7 +348,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector &par return 0; FilterResult* f = NULL; - + if (flags) f = this->FilterMatch(user, checkline, flags); @@ -683,4 +683,3 @@ class ModuleFilter : public FilterBase }; MODULE_INIT(ModuleFilter) - diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp index bb0b3ac63..27c749b3d 100644 --- a/src/modules/m_operprefix.cpp +++ b/src/modules/m_operprefix.cpp @@ -14,7 +14,7 @@ /* * Originally by Chernov-Phoenix Alexey (Phoenix@RusNet) mailto:phoenix /email address separator/ pravmail.ru */ - + /* $ModDesc: Gives opers cmode +y which provides a staff prefix. */ #include "inspircd.h" @@ -118,7 +118,7 @@ class ModuleOperPrefixMode : public Module opm = new OperPrefixMode(ServerInstance); if ((!ServerInstance->Modes->AddMode(opm))) throw ModuleException("Could not add a new mode!"); - + Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart, I_OnOper }; ServerInstance->Modules->Attach(eventlist, this, 6); } @@ -239,4 +239,3 @@ class ModuleOperPrefixMode : public Module }; MODULE_INIT(ModuleOperPrefixMode) - diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index cf2723bec..3010e1e46 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -131,7 +131,7 @@ class ModuleOverride : public Module { // If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice if ((chan->GetStatus(source) < chan->GetStatus(user)) || (chan->GetStatus(source) <= STATUS_VOICE)) - { + { ServerInstance->SNO->WriteToSnoMask('G',std::string(source->nick)+" used oper override to kick "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")"); } /* Returning -1 explicitly allows the kick */ diff --git a/src/modules/m_regex.h b/src/modules/m_regex.h index 85f52c4d8..3880be342 100644 --- a/src/modules/m_regex.h +++ b/src/modules/m_regex.h @@ -45,7 +45,7 @@ class RegexFactoryRequest : public Request { private: std::string regex; - + public: Regex* result; diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 6c976d6ba..d71807c69 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -37,7 +37,7 @@ class CommandSATopic : public Command if(target) { std::string newTopic = parameters[1]; - + // 3rd parameter overrides access checks target->SetTopic(user, newTopic, true); ServerInstance->SNO->WriteToSnoMask('A', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index ebe1b1220..6789d26d8 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -229,7 +229,7 @@ class ModuleServicesAccount : public Module // user is ulined, won't be stopped from joining return 0; } - + if (chan->IsModeSet('R')) { if (!is_registered) diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 12484e195..7f0500fe5 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -24,7 +24,7 @@ class ServProtectMode : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { - /* Because this returns MODEACTION_DENY all the time, there is only ONE + /* Because this returns MODEACTION_DENY all the time, there is only ONE * way to add this mode and that is at client introduction in the UID command, * as this calls OnModeChange for each mode but disregards the return values. * The mode cannot be manually added or removed, not even by a server or by a remote diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index f4939c00e..49d345383 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -369,5 +369,3 @@ TreeServer::~TreeServer() if (iter != Utils->sidlist.end()) Utils->sidlist.erase(iter); } - - diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 528414261..fea17b7d2 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -56,7 +56,7 @@ class TreeServer : public classbase bool Warned; /* True if we've warned opers about high latency on this server */ bool bursting; /* whether or not this server is bursting */ - + /** We don't use this constructor. Its a dummy, and won't cause any insertion * of the TreeServer into the hash_map. See below for the two we DO use. */ @@ -67,7 +67,7 @@ class TreeServer : public classbase * no socket associated with it. Its version string is our own local version. */ TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id); - + /** When we create a new server, we call this constructor to initialize it. * This constructor initializes the server's Route and Parent, and sets up * its ping counters so that it will be pinged one minute from now. @@ -121,7 +121,7 @@ class TreeServer : public classbase /** Round trip time of last ping */ unsigned long rtt; - + /** When we recieved BURST from this server, used to calculate total burst time at ENDBURST. */ unsigned long StartBurst; diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 4d87c450c..c006344ba 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -250,7 +250,7 @@ bool TreeSocket::ProcessLine(std::string &line) * "miscreant" servers, though, so let's check anyway. -- w * * We also check here for totally invalid prefixes (prefixes that are neither - * a valid SID or a valid UUID, so that invalid UUID or SID never makes it + * a valid SID or a valid UUID, so that invalid UUID or SID never makes it * to the higher level functions. -- B */ std::string direction = prefix; @@ -694,5 +694,3 @@ void TreeSocket::OnClose() this->ServerInstance->SNO->WriteToSnoMask('l', "Connection to '\2%s\2' was established for %s", quitserver.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str()); } } - - diff --git a/src/modules/rpc.h b/src/modules/rpc.h index 75a7efd62..36f1c031a 100644 --- a/src/modules/rpc.h +++ b/src/modules/rpc.h @@ -25,27 +25,27 @@ class RPCValue : public classbase protected: RPCValueType type; void *value; - + double *CastInteger() { return (double*)value; } - + std::string *CastString() { return (std::string*)value; } - + RPCObjectContainer *CastObject() { return (RPCObjectContainer*)value; } - + RPCArrayContainer *CastArray() { return (RPCArrayContainer*)value; } - + void DestroyValue() { // Some versions of GCC complain about declaration in switch statements @@ -74,10 +74,10 @@ class RPCValue : public classbase default: break; } - + value = NULL; } - + void InitValue() { switch (type) @@ -100,9 +100,9 @@ class RPCValue : public classbase break; } } - + RPCValue(const RPCValue &v) { } - + public: RPCValue *parent; @@ -111,30 +111,30 @@ class RPCValue : public classbase RPCValue(bool nvalue, RPCValue *rparent = NULL) : type(RPCBoolean), value((void*)nvalue), parent(rparent) { } RPCValue(double nvalue, RPCValue *rparent = NULL) : type(RPCInteger), parent(rparent) { value = new double(nvalue); } RPCValue(const std::string &nvalue, RPCValue *rparent = NULL) : type(RPCString), parent(rparent) { value = new std::string(nvalue); } - + virtual ~RPCValue() { DestroyValue(); } - + RPCValueType GetType() { return type; } - + void SetNull() { DestroyValue(); type = RPCNull; } - + void SetBoolean(bool nvalue) { DestroyValue(); value = (void*)nvalue; type = RPCBoolean; } - + void SetInteger(double nvalue) { if (type == RPCInteger) @@ -148,7 +148,7 @@ class RPCValue : public classbase type = RPCInteger; } } - + void SetString(const std::string &nvalue) { if (type == RPCString) @@ -162,7 +162,7 @@ class RPCValue : public classbase type = RPCString; } } - + void SetArray() { if (type == RPCArray) @@ -176,7 +176,7 @@ class RPCValue : public classbase InitValue(); } } - + void SetObject() { if (type == RPCObject) @@ -190,7 +190,7 @@ class RPCValue : public classbase InitValue(); } } - + void ArrayAdd(RPCValue *nvalue) { if (type != RPCArray) @@ -199,7 +199,7 @@ class RPCValue : public classbase a->push_back(nvalue); nvalue->parent = this; } - + void ObjectAdd(const std::string &key, RPCValue *nvalue) { if (type != RPCObject) @@ -208,7 +208,7 @@ class RPCValue : public classbase o->insert(std::make_pair(key, nvalue)); nvalue->parent = this; } - + RPCValue *GetArray(int i) { if (type != RPCArray) @@ -218,7 +218,7 @@ class RPCValue : public classbase return NULL; return a->at(i); } - + int ArraySize() { if (type != RPCArray) @@ -226,7 +226,7 @@ class RPCValue : public classbase RPCArrayContainer *a = this->CastArray(); return a->size(); } - + RPCValue *GetObject(const std::string &key) { if (type != RPCObject) @@ -237,7 +237,7 @@ class RPCValue : public classbase return NULL; return it->second; } - + std::pair GetObjectIterator() { if (type != RPCObject) @@ -245,21 +245,21 @@ class RPCValue : public classbase RPCObjectContainer *o = this->CastObject(); return std::make_pair(o->begin(), o->end()); } - + std::string GetString() { if (type != RPCString) return std::string(); return *this->CastString(); } - + double GetInt() { if (type != RPCInteger) return 0; return *this->CastInteger(); } - + bool GetBool() { if (type != RPCBoolean) @@ -271,7 +271,7 @@ class RPCValue : public classbase class RPCRequest : public classbase { protected: - + public: std::string method; RPCValue *parameters; @@ -279,13 +279,13 @@ class RPCRequest : public classbase std::string provider; bool claimed; std::string error; - + RPCRequest(const std::string &sprovider, const std::string &smethod, RPCValue *rparameters) : method(smethod), parameters(rparameters), provider(sprovider), claimed(false) { result = new RPCValue(); } - + ~RPCRequest() { if (result) diff --git a/src/modules/transport.h b/src/modules/transport.h index 269880b75..1ca3e9470 100644 --- a/src/modules/transport.h +++ b/src/modules/transport.h @@ -50,7 +50,7 @@ class ssl_cert : public Extensible ssl_cert() : empty("") { } - + /** Get certificate distinguished name * @return Certificate DN */ @@ -228,4 +228,3 @@ class BufferedSocketNameRequest : public ISHRequest }; #endif - -- cgit v1.2.3