diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-20 07:55:08 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-20 07:55:08 +0000 |
commit | 9ede59892d06b57dea0c9ef90dd88062417b0202 (patch) | |
tree | 2ccdc38aea544cad41352bc724fd00988f1bf098 /src | |
parent | 7f9c6c5118261eac40d9bae22ac2c0ede670512d (diff) |
Const refs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5505 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_blockamsg.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_dccallow.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_randquote.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_silence.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_svshold.cpp | 2 |
7 files changed, 14 insertions, 21 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index c9d926e65..3dadd5873 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -408,16 +408,9 @@ class SQLConnection : public classbase QueryQueue queue; ResultQueue rq; - // This constructor creates an SQLConnection object with the given credentials, and creates the underlying - // MYSQL struct, but does not connect yet. - SQLConnection(std::string thishost, std::string thisuser, std::string thispass, std::string thisdb, const std::string &myid) - { - this->Enabled = true; - this->host = thishost; - this->user = thisuser; - this->pass = thispass; - this->db = thisdb; - this->id = myid; + // This constructor creates an SQLConnection object with the given credentials, but does not connect yet. + SQLConnection(const std::string &thishost, const std::string &thisuser, const std::string &thispass, const std::string &thisdb, const std::string &myid) : host(thishost), user(thisuser), pass(thispass), db(thisdb), Enabled(true), id(myid) + { } // This method connects to the database using the credentials supplied to the constructor, and returns diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index ba0d2f73b..1b5fee40b 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -39,8 +39,8 @@ public: std::string message; irc::string target; time_t sent; - - BlockedMessage(std::string msg, irc::string tgt, time_t when) : message(msg), target(tgt), sent(when) + + BlockedMessage(const std::string &msg, const irc::string &tgt, time_t when) : message(msg), target(tgt), sent(when) { } }; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 1b14d098e..5fb64a27e 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -31,7 +31,7 @@ class DCCAllow DCCAllow() { } - DCCAllow(std::string nick, std::string hm, time_t so, long ln) : nickname(nick), hostmask(hm), set_on(so), length(ln) { } + DCCAllow(const std::string &nick, const std::string &hm, const time_t so, const long ln) : nickname(nick), hostmask(hm), set_on(so), length(ln) { } }; typedef std::vector<userrec *> userlist; @@ -132,7 +132,7 @@ class cmd_dccallow : public command_t if (!dl) { dl = new dccallowlist; - user->Extend(std::string("dccallow_list"), dl); + user->Extend("dccallow_list", dl); // add this user to the userlist ul.push_back(user); } diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index b254fb541..7354420a9 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -36,7 +36,7 @@ std::string suffix = ""; class cmd_randquote : public command_t { public: - cmd_randquote (InspIRCd* Instance) : command_t(Instance,"RANDQUOTE", 0, 0) + cmd_randquote (InspIRCd* Instance) : command_t(Instance,"RANDQUOTE", 0, 0) { this->source = "m_randquote.so"; } @@ -66,13 +66,13 @@ class cmd_randquote : public command_t class RandquoteException : public ModuleException { private: - std::string err; + const std::string err; public: - RandquoteException(std::string message) : err(message) { } + RandquoteException(const std::string &message) : err(message) { } virtual const char* GetReason() { - return (char*)err.c_str(); + return err.c_str(); } }; diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index ad66f6667..6d51c718c 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -117,7 +117,7 @@ class cmd_silence : public command_t if (!sl) { sl = new silencelist; - user->Extend(std::string("silence_list"), sl); + user->Extend("silence_list", sl); } for (silencelist::iterator n = sl->begin(); n != sl->end(); n++) { diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ae9df6161..0df9ebf86 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -438,7 +438,7 @@ class TreeServer : public classbase return Parent; } - void SetVersion(std::string Version) + void SetVersion(const std::string &Version) { VersionString = Version; } diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 614c0fec4..81dcacd0c 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -39,7 +39,7 @@ public: { } - SVSHold(std::string nn, std::string sb, time_t so, long ln, std::string rs) : nickname(nn), set_by(sb), set_on(so), length(ln), reason(rs) + SVSHold(const std::string &nn, const std::string &sb, const time_t so, const long ln, const std::string &rs) : nickname(nn), set_by(sb), set_on(so), length(ln), reason(rs) { } }; |