]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_mysql.cpp
Replace some C-isms with C++-isms.
[user/henk/code/inspircd.git] / src / modules / extra / m_mysql.cpp
index 570e7d9ecbf3c17023e668de38d1758d0de1d59a..2a7e2f8787d2547ed66472ed14954ad53b27707d 100644 (file)
@@ -25,9 +25,9 @@
 
 #include "inspircd.h"
 #include <mysql.h>
-#include "sql.h"
+#include "modules/sql.h"
 
-#ifdef WINDOWS
+#ifdef _WIN32
 # pragma comment(lib, "mysqlclient.lib")
 # pragma comment(lib, "advapi32.lib")
 # pragma comment(linker, "/NODEFAULTLIB:LIBCMT")
@@ -189,10 +189,6 @@ class MySQLresult : public SQLResult
 
        }
 
-       ~MySQLresult()
-       {
-       }
-
        virtual int Rows()
        {
                return rows;
@@ -291,7 +287,7 @@ class SQLConnection : public SQLProvider
                {
                        /* XXX: See /usr/include/mysql/mysqld_error.h for a list of
                         * possible error numbers and error messages */
-                       SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + std::string(": ") + mysql_error(connection));
+                       SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + ": " + mysql_error(connection));
                        return new MySQLresult(e);
                }
        }
@@ -383,7 +379,7 @@ void ModuleSQL::init()
        ServerInstance->Threads->Start(Dispatcher);
 
        Implementation eventlist[] = { I_OnRehash, I_OnUnloadModule };
-       ServerInstance->Modules->Attach(eventlist, this, 2);
+       ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
 
        OnRehash(NULL);
 }