From a8bdf9887f5be40fae774d8bea93e99b5a0932c5 Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 9 May 2008 04:08:27 +0000 Subject: Add defaults for SQLHost since comparing depends on them being initialised. Add also overload for operator!= for SQLhost. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9675 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sqlv2.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_sqlv2.h b/src/modules/extra/m_sqlv2.h index 2e0ab2a19..cd3ea0eca 100644 --- a/src/modules/extra/m_sqlv2.h +++ b/src/modules/extra/m_sqlv2.h @@ -440,11 +440,12 @@ class SQLhost bool ssl; /* If we should require SSL */ SQLhost() + : id(""), host(""), ip(""), port(0), name(""), user(""), pass(""), ssl(0) { } SQLhost(const std::string& i, const std::string& h, unsigned int p, const std::string& n, const std::string& u, const std::string& pa, bool s) - : id(i), host(h), port(p), name(n), user(u), pass(pa), ssl(s) + : id(i), host(h), ip(""), port(p), name(n), user(u), pass(pa), ssl(s) { } @@ -460,6 +461,12 @@ bool operator== (const SQLhost& l, const SQLhost& r) { return (l.id == r.id && l.host == r.host && l.port == r.port && l.name == r.name && l.user == l.user && l.pass == r.pass && l.ssl == r.ssl); } +/** Overload operator!= for two SQLhost objects for easy comparison. + */ +bool operator!= (const SQLhost& l, const SQLhost& r) +{ + return (l.id != r.id || l.host != r.host || l.port != r.port || l.name != r.name || l.user != l.user || l.pass != r.pass || l.ssl != r.ssl); +} /** QueryQueue, a queue of queries waiting to be executed. -- cgit v1.2.3