]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqlite3.cpp
Remove current time parameter of the Timer constructor
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlite3.cpp
index 254adf1025ce98dbe3548106cfcd50c211d7837e..f86e08fb33acf8ec6f6a767789aa314a3e7ce343 100644 (file)
 
 
 #include "inspircd.h"
-#include <sqlite3.h>
 #include "modules/sql.h"
 
+// Fix warnings about the use of `long long` on C++03.
+#if defined __clang__
+# pragma clang diagnostic ignored "-Wc++11-long-long"
+#elif defined __GNUC__
+# pragma GCC diagnostic ignored "-Wlong-long"
+#endif
+
+#include <sqlite3.h>
+
 #ifdef _WIN32
 # pragma comment(lib, "sqlite3.lib")
 #endif
 
-/* $ModDesc: sqlite3 provider */
 /* $CompileFlags: pkgconfversion("sqlite3","3.3") pkgconfincludes("sqlite3","/sqlite3.h","") */
 /* $LinkerFlags: pkgconflibs("sqlite3","/libsqlite3.so","-lsqlite3") */
-/* $NoPedantic */
 
 class SQLConn;
 typedef std::map<std::string, SQLConn*> ConnMap;
@@ -85,7 +91,7 @@ class SQLConn : public SQLProvider
                std::string host = tag->getString("hostname");
                if (sqlite3_open_v2(host.c_str(), &conn, SQLITE_OPEN_READWRITE, 0) != SQLITE_OK)
                {
-                       ServerInstance->Logs->Log("m_sqlite3", LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
+                       ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
                        conn = NULL;
                }
        }
@@ -204,14 +210,6 @@ class ModuleSQLite3 : public Module
        ConnMap conns;
 
  public:
-       void init() CXX11_OVERRIDE
-       {
-               ReadConf();
-
-               Implementation eventlist[] = { I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
-
        ~ModuleSQLite3()
        {
                ClearConns();
@@ -228,7 +226,7 @@ class ModuleSQLite3 : public Module
                conns.clear();
        }
 
-       void ReadConf()
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ClearConns();
                ConfigTagList tags = ServerInstance->Config->ConfTags("database");
@@ -242,11 +240,6 @@ class ModuleSQLite3 : public Module
                }
        }
 
-       void OnRehash(User* user) CXX11_OVERRIDE
-       {
-               ReadConf();
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("sqlite3 provider", VF_VENDOR);