summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command.cpp2
-rw-r--r--src/config.c4
-rw-r--r--src/core/bs_badwords.c2
-rw-r--r--src/core/ns_recover.c2
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/hashcomp.cpp1
-rw-r--r--src/init.c2
-rw-r--r--src/main.c6
-rw-r--r--src/users.c8
-rw-r--r--src/windows.cpp10
10 files changed, 24 insertions, 15 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 11a945136..5c754cd8d 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -70,4 +70,4 @@ void Command::UnsetFlag(CommandFlags flag)
bool Command::HasFlag(CommandFlags flag) const
{
return this->flags & flag;
-} \ No newline at end of file
+}
diff --git a/src/config.c b/src/config.c
index 0a230533e..60847e116 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1159,7 +1159,11 @@ int ServerConfig::Read(bool bail)
if (ConfValue(config_data, static_cast<std::string>(MultiValues[Index].tag),
static_cast<std::string>(MultiValues[Index].items[valuenum]),
static_cast<std::string>(MultiValues[Index].items_default[valuenum]), tagnum, item, allow_newlines)) {
+#ifdef _WIN32
+ long time = static_cast<long>(dotime(item.c_str()));
+#else
time_t time = dotime(item.c_str());
+#endif
vl.push_back(ValueItem(time));
}
else vl.push_back(ValueItem(0));
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index ad1bb7e49..5c6c77199 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -68,7 +68,7 @@ class CommandBSBadwords : public Command
return MOD_CONT;
}
- pos = strrchr(word, ' ');
+ pos = strrchr(const_cast<char *>(word), ' '); // XXX - Potentially unsafe cast
if (pos)
{
opt = pos + 1;
diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c
index b4e3b9d44..98e4a9512 100644
--- a/src/core/ns_recover.c
+++ b/src/core/ns_recover.c
@@ -89,7 +89,7 @@ class CommandNSRecover : public Command
duration(u->nc, relstr, sizeof(relstr), NSReleaseTimeout);
notice_help(s_NickServ, u, NICK_HELP_RECOVER, relstr);
- do_help_limited(s_NickServ, u, this);
+ //do_help_limited(s_NickServ, u, this);
return MOD_CONT;
}
diff --git a/src/core/ns_release.c b/src/core/ns_release.c
index 3767fbbb8..d2ce4c57e 100644
--- a/src/core/ns_release.c
+++ b/src/core/ns_release.c
@@ -77,7 +77,7 @@ class CommandNSRelease : public Command
duration(u->nc, relstr, sizeof(relstr), NSReleaseTimeout);
notice_help(s_NickServ, u, NICK_HELP_RELEASE, relstr);
- do_help_limited(s_NickServ, u, this);
+ //do_help_limited(s_NickServ, u, this);
return true;
}
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 4ec68832a..fe892c0e1 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -11,6 +11,7 @@
*
*/
+#include "services.h"
#include "hashcomp.h"
sepstream::sepstream(const std::string &source, char seperator) : tokens(source), sep(seperator)
diff --git a/src/init.c b/src/init.c
index 79633d0ec..e80f52c59 100644
--- a/src/init.c
+++ b/src/init.c
@@ -477,7 +477,9 @@ int init_secondary(int ac, char **av)
/* Set signal handlers. Catch certain signals to let us do things or
* panic as necessary, and ignore all others.
*/
+#ifndef _WIN32
signal(SIGHUP, sighandler);
+#endif
signal(SIGTERM, sighandler);
signal(SIGINT, sighandler);
diff --git a/src/main.c b/src/main.c
index 3968c4014..6515bd7a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,8 +33,10 @@
#include "modules.h"
// getrlimit.
-#include <sys/time.h>
-#include <sys/resource.h>
+#ifndef _WIN32
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
/******** Global variables! ********/
diff --git a/src/users.c b/src/users.c
index 4be186909..94d8d35ed 100644
--- a/src/users.c
+++ b/src/users.c
@@ -149,7 +149,7 @@ void User::SetVIdent(const std::string &sident)
update_host(this);
}
-const std::string &User::GetVIdent() const
+const std::string &User::GetVIdent() const
{
if (ircd->vhostmode && (this->mode & ircd->vhostmode))
return this->vident;
@@ -597,7 +597,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const
"DEFCON AKILL");
check_akill(nick, username, host, vhost, ipbuf);
}
-
+
/* As with akill checks earlier, we can't not add the user record, as the user may be exempt from bans.
* Instead, we'll just wait for the IRCd to tell us they are gone.
*/
@@ -1005,7 +1005,7 @@ char *create_mask(User * u)
// XXX: someone needs to rewrite this godawful kitten murdering pile of crap.
if (strspn(mhost.c_str(), "0123456789.") == mhost.length()
- && (s = strchr(mhost.c_str(), '.'))
+ && (s = strchr(const_cast<char *>(mhost.c_str()), '.')) // XXX - Potentially unsafe cast
&& (s = strchr(s + 1, '.'))
&& (s = strchr(s + 1, '.'))
&& (!strchr(s + 1, '.')))
@@ -1018,7 +1018,7 @@ char *create_mask(User * u)
}
else
{
- if ((s = strchr(mhost.c_str(), '.')) && strchr(s + 1, '.')) {
+ if ((s = strchr(const_cast<char *>(mhost.c_str()), '.')) && strchr(s + 1, '.')) {
s = sstrdup(strchr(mhost.c_str(), '.') - 1);
*s = '*';
strcpy(end, s);
diff --git a/src/windows.cpp b/src/windows.cpp
index 29a2131d1..988256838 100644
--- a/src/windows.cpp
+++ b/src/windows.cpp
@@ -10,18 +10,18 @@
*
* $Id$
*
- */
+ */
#ifdef WIN32
+#include <windows.h>
+
const char *dlerror()
{
static char errbuf[513];
DWORD err = GetLastError();
- if (err == 0)
+ if (!err)
return NULL;
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512,
- NULL);
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512, NULL);
return errbuf;
}
#endif