diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-17 20:17:52 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-17 20:17:52 +0000 |
| commit | ad7b5bdd30405b92042c4a1872175be80d8d111f (patch) | |
| tree | 8cdcd0509d935c1606f14a3f89f407897e2bc3d0 /include | |
| parent | c4a8cc7e2f3890b8d82051c89748bea80350e8d4 (diff) | |
A few GCC 3.4.x and MSVC++ warning fixes.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1839 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
| -rw-r--r-- | include/configreader.h | 20 | ||||
| -rw-r--r-- | include/services.h | 20 |
2 files changed, 13 insertions, 27 deletions
diff --git a/include/configreader.h b/include/configreader.h index d7786e11d..0cd1bf362 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -282,9 +282,6 @@ class ServerConfig * recursively included. */ std::vector<std::string> include_stack; - /** Process an include directive - */ - bool DoInclude(ConfigDataHash &, const std::string &, std::ostringstream &); /** Check that there is only one of each configuration item */ bool CheckOnce(const char *); @@ -381,31 +378,20 @@ class ServerConfig * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time. */ -class ConfigException : public std::exception +class ConfigException : public CoreException { - protected: - /** Holds the error message to be displayed - */ - const std::string err; public: /** Default constructor, just uses the error mesage 'Config threw an exception'. */ - ConfigException() : err("Config threw an exception") { } + ConfigException() : CoreException("Config threw an exception", "Config Parser") {} /** This constructor can be used to specify an error message before throwing. */ - ConfigException(const std::string &message) : err(message) {} + ConfigException(const std::string &message) : CoreException(message, "Config Parser") {} /** This destructor solves world hunger, cancels the world debt, and causes the world to end. * Actually no, it does nothing. Never mind. * @throws Nothing! */ virtual ~ConfigException() throw() { }; - /** Returns the reason for the exception. - * The module should probably put something informative here as the user will see this upon failure. - */ - virtual const char *GetReason() - { - return err.c_str(); - } }; #define CONF_NO_ERROR 0x000000 diff --git a/include/services.h b/include/services.h index 7d504e3a2..d27fc5f52 100644 --- a/include/services.h +++ b/include/services.h @@ -198,11 +198,11 @@ extern int strncasecmp(const char *, const char *, size_t); #ifdef _WIN32 #define MODULE_INIT(x, y) \ extern "C" DllExport Module *init_module(const std::string &, const std::string &); \ - extern "C" Module *init_module(const std::string &modname, const std::string &creator) \ + extern "C" Module *init_module(const std::string &, const std::string &creator) \ { \ return new y(x, creator); \ } \ - BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) \ + BOOLEAN WINAPI DllMain(HINSTANCE, DWORD nReason, LPVOID) \ { \ switch ( nReason ) \ { \ @@ -220,7 +220,7 @@ extern int strncasecmp(const char *, const char *, size_t); #else #define MODULE_INIT(x, y) \ - extern "C" DllExport Module *init_module(const std::string &modname, const std::string &creator) \ + extern "C" DllExport Module *init_module(const std::string &, const std::string &creator) \ { \ return new y(x, creator); \ } \ @@ -253,10 +253,10 @@ class CoreExport CoreException : public std::exception protected: /** Holds the error message to be displayed */ - const std::string err; + std::string err; /** Source of the exception */ - const std::string source; + std::string source; public: /** Default constructor, just uses the error mesage 'Core threw an exception'. */ @@ -272,16 +272,16 @@ class CoreExport CoreException : public std::exception * Actually no, it does nothing. Never mind. * @throws Nothing! */ - virtual ~CoreException() throw() {}; + virtual ~CoreException() throw() {} /** Returns the reason for the exception. * The module should probably put something informative here as the user will see this upon failure. */ - virtual const char* GetReason() + virtual const char* GetReason() const { return err.c_str(); } - virtual const char* GetSource() + virtual const char* GetSource() const { return source.c_str(); } @@ -301,7 +301,7 @@ class CoreExport ModuleException : public CoreException * Actually no, it does nothing. Never mind. * @throws Nothing! */ - virtual ~ModuleException() throw() {}; + virtual ~ModuleException() throw() {} }; /** Class with the ability to be extended with key:value pairs. @@ -1405,7 +1405,7 @@ private: * Thanks. * -- w00t */ - virtual void SendQuit(const char *nick, const char *buf) MARK_DEPRECATED + virtual void SendQuit(const char *nick, const char *) MARK_DEPRECATED { send_cmd(nick, "QUIT"); } |
