From 5aa20a895f64dd38f0c7ad9e79c1b2dcb0c76474 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Dec 2013 13:46:48 +0300 Subject: add restrict into chathandler. --- src/net/chathandler.h | 8 ++++---- src/net/eathena/chathandler.cpp | 11 ++++++----- src/net/eathena/chathandler.h | 11 ++++++----- src/net/tmwa/chathandler.cpp | 11 ++++++----- src/net/tmwa/chathandler.h | 11 ++++++----- 5 files changed, 28 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/net/chathandler.h b/src/net/chathandler.h index f5cf03f9f..aab74e85a 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -36,16 +36,16 @@ class ChatHandler virtual ~ChatHandler() { } - virtual void talk(const std::string &text, - const std::string &channel) const = 0; + virtual void talk(const std::string &restrict text, + const std::string &restrict channel) const = 0; virtual void talkRaw(const std::string &text) const = 0; virtual void me(const std::string &restrict text, const std::string &restrict channel) const = 0; - virtual void privateMessage(const std::string &recipient, - const std::string &text) = 0; + virtual void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) = 0; virtual void who() const = 0; diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 53b98f6a9..331b2b630 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -92,8 +92,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) } } -void ChatHandler::talk(const std::string &text, - const std::string &channel A_UNUSED) const +void ChatHandler::talk(const std::string &restrict text, + const std::string &restrict channel A_UNUSED) const { if (!player_node) return; @@ -114,8 +114,8 @@ void ChatHandler::talkRaw(const std::string &mes) const outMsg.writeString(mes, static_cast(mes.length())); } -void ChatHandler::privateMessage(const std::string &recipient, - const std::string &text) +void ChatHandler::privateMessage(const std::string &restrict recipient, + const std::string &restrict text) { MessageOut outMsg(CMSG_CHAT_WHISPER); outMsg.writeInt16(static_cast(text.length() + 28)); @@ -165,7 +165,8 @@ void ChatHandler::sendRaw(const std::string &args) const delete outMsg; } -void ChatHandler::processRaw(MessageOut &outMsg, const std::string &line) +void ChatHandler::processRaw(MessageOut &restrict outMsg, + const std::string &restrict line) { size_t pos = line.find(":"); if (pos == std::string::npos) diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index 9e6f1608d..db782e3c7 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -40,13 +40,13 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void handleMessage(Net::MessageIn &msg) override final; - void talk(const std::string &text, - const std::string &channel) const override final; + void talk(const std::string &restrict text, + const std::string &restrict channel) const override final; void talkRaw(const std::string &text) const override final; - void privateMessage(const std::string &recipient, - const std::string &text) override final; + void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) override final; void who() const override final; @@ -56,7 +56,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void unIgnoreAll() const override final; - static void processRaw(MessageOut &outMsg, const std::string &line); + static void processRaw(MessageOut &restrict outMsg, + const std::string &restrict line); }; } // namespace EAthena diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 164b0ddc3..766d014ff 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -107,8 +107,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("ChatHandler::handleMessage") } -void ChatHandler::talk(const std::string &text, - const std::string &channel) const +void ChatHandler::talk(const std::string &restrict text, + const std::string &restrict channel) const { if (!player_node) return; @@ -142,8 +142,8 @@ void ChatHandler::talkRaw(const std::string &mes) const outMsg.writeString(mes, static_cast(mes.length())); } -void ChatHandler::privateMessage(const std::string &recipient, - const std::string &text) +void ChatHandler::privateMessage(const std::string &restrict recipient, + const std::string &restrict text) { MessageOut outMsg(CMSG_CHAT_WHISPER); outMsg.writeInt16(static_cast(text.length() + 28)); @@ -193,7 +193,8 @@ void ChatHandler::sendRaw(const std::string &args) const delete outMsg; } -void ChatHandler::processRaw(MessageOut &outMsg, const std::string &line) +void ChatHandler::processRaw(MessageOut &restrict outMsg, + const std::string &restrict line) { size_t pos = line.find(":"); if (pos == std::string::npos) diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index a21c0afe1..1c691397e 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -40,13 +40,13 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void handleMessage(Net::MessageIn &msg) override final; - void talk(const std::string &text, - const std::string &channel) const override final; + void talk(const std::string &restrict text, + const std::string &restrict channel) const override final; void talkRaw(const std::string &text) const override final; - void privateMessage(const std::string &recipient, - const std::string &text) override final; + void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) override final; void who() const override final; @@ -56,7 +56,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void unIgnoreAll() const override final; - static void processRaw(MessageOut &outMsg, const std::string &line); + static void processRaw(MessageOut &restrict outMsg, + const std::string &restrict line); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2