summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-22 04:18:57 -0400
committerAdam <Adam@anope.org>2010-10-22 04:20:34 -0400
commiteb8f3a799ca006ac4ca03b77df9bad5f2b6cd3d5 (patch)
treed9c47c3c6928be86cd07d1258b66623a1d2708bb /src
parent791c2b89a5b09d3e3e3785669b29438ffec26295 (diff)
Fixed some Windows problems
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
-rw-r--r--src/mail.cpp2
-rw-r--r--src/messages.cpp13
-rw-r--r--src/send.cpp4
4 files changed, 13 insertions, 8 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 841fdc55e..239b9df48 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -299,6 +299,8 @@ void Init(int ac, char **av)
throw FatalException("Unable to chdir to " + services_dir + ": " + Anope::LastError());
}
+ init_core_messages();
+
Log(LOG_TERMINAL) << "Anope " << Anope::Version() << ", " << Anope::Build();
#ifdef _WIN32
Log(LOG_TERMINAL) << "Using configuration file " << services_dir << "\\" << services_conf;
diff --git a/src/mail.cpp b/src/mail.cpp
index d59903726..fdbd05dd9 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1,6 +1,6 @@
#include "services.h"
-MailThread::MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), Success(false), DontQuoteAddresses(Config->DontQuoteAddresses)
+MailThread::MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), DontQuoteAddresses(Config->DontQuoteAddresses), Success(false)
{
}
diff --git a/src/messages.cpp b/src/messages.cpp
index e22f856c6..6d93aeb13 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -225,7 +225,7 @@ bool m_stats(const Anope::string &source, const std::vector<Anope::string> &para
if (u && is_oper(u))
{
ircdproto->SendNumeric(Config->ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
- ircdproto->SendNumeric(Config->ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, Anope::CurTime - start_time);
+ ircdproto->SendNumeric(Config->ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, static_cast<long>(Anope::CurTime - start_time));
}
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", params[0][0]);
@@ -289,7 +289,7 @@ int m_whois(const Anope::string &source, const Anope::string &who)
ircdproto->SendNumeric(Config->ServerName, 311, source, "%s %s %s * :%s", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
ircdproto->SendNumeric(Config->ServerName, 307, source, "%s :is a registered nick", bi->nick.c_str());
ircdproto->SendNumeric(Config->ServerName, 312, source, "%s %s :%s", bi->nick.c_str(), Config->ServerName.c_str(), Config->ServerDesc.c_str());
- ircdproto->SendNumeric(Config->ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), Anope::CurTime - bi->lastmsg, start_time);
+ ircdproto->SendNumeric(Config->ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(start_time));
ircdproto->SendNumeric(Config->ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str());
}
else if (!ircd->svshold && (u = finduser(who)) && u->server == Me)
@@ -304,7 +304,10 @@ int m_whois(const Anope::string &source, const Anope::string &who)
return MOD_CONT;
}
-Message message_stats("STATS", m_stats);
-Message message_time("TIME", m_time);
-Message message_verssion("VERSION", m_version);
+void init_core_messages()
+{
+ static Message message_stats("STATS", m_stats);
+ static Message message_time("TIME", m_time);
+ static Message message_verssion("VERSION", m_version);
+}
diff --git a/src/send.cpp b/src/send.cpp
index b7f7821ae..550bcab7c 100644
--- a/src/send.cpp
+++ b/src/send.cpp
@@ -46,8 +46,8 @@ void send_cmd(const Anope::string &source, const char *fmt, ...)
}
else
{
- UplinkSock->Write("%s", buf);
- Log(LOG_RAWIO) << "Sent: "<< buf;
+ UplinkSock->Write(buf);
+ Log(LOG_RAWIO) << "Sent: " << buf;
}
va_end(args);