]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqlite3.cpp
Remove unneeded ProtocolInterface::Introduce
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlite3.cpp
index c4d1cc799ef98ea8195b023cdcbed7f376c80cac..ea76fbc1de84c09732d643a5c4faca7c2b8b81df 100644 (file)
@@ -3,7 +3,7 @@
  *              +------------------------------------+
  *
  *     InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *                       the file COPYING for details.
@@ -34,7 +34,7 @@ typedef std::deque<SQLite3Result*> ResultQueue;
 unsigned long count(const char * const str, char a)
 {
        unsigned long n = 0;
-       for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+       for (const char *p = str; *p; ++p)
        {
                if (*p == '?')
                        ++n;
@@ -306,9 +306,6 @@ class SQLConn : public classbase
                /* Total length of the unescaped parameters */
                unsigned long maxparamlen, paramcount;
 
-               /* Total length of query, used for binary-safety */
-               unsigned long querylength = 0;
-
                /* The length of the longest parameter */
                maxparamlen = 0;
 
@@ -404,7 +401,6 @@ class SQLConn : public classbase
                                *queryend = req.query.q[i];
                                queryend++;
                        }
-                       querylength++;
                }
                *queryend = 0;
                req.query.q = query;
@@ -458,7 +454,7 @@ class SQLConn : public classbase
 
        int OpenDB()
        {
-               return sqlite3_open(host.host.c_str(), &conn);
+               return sqlite3_open_v2(host.host.c_str(), &conn, SQLITE_OPEN_READWRITE, 0);
        }
 
        void CloseDB()
@@ -715,7 +711,7 @@ class ModuleSQLite3 : public Module
                }
        }
 
-       virtual void OnRehash(User* user, const std::string &parameter)
+       virtual void OnRehash(User* user)
        {
                ReadConf();
        }