summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-01 23:56:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-02 14:28:17 +0300
commit520a495c466793c29f3e721634dfe6cc616b8ede (patch)
tree749b67f5d4df83f6f4997dabeb66ec394eabccd7 /src/net
parentf9030497b6196ce2fadb6b6ada5d784be227d9a6 (diff)
downloadplus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.gz
plus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.bz2
plus-520a495c466793c29f3e721634dfe6cc616b8ede.tar.xz
plus-520a495c466793c29f3e721634dfe6cc616b8ede.zip
Add missing const.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp4
-rw-r--r--src/net/download.h2
-rw-r--r--src/net/ea/loginhandler.cpp2
-rw-r--r--src/net/ea/loginhandler.h2
-rw-r--r--src/net/eathena/partyhandler.cpp4
-rw-r--r--src/net/eathena/partyhandler.h4
-rw-r--r--src/net/loginhandler.h3
-rw-r--r--src/net/partyhandler.h4
-rw-r--r--src/net/tmwa/partyhandler.cpp4
-rw-r--r--src/net/tmwa/partyhandler.h4
10 files changed, 16 insertions, 17 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index cf5a1d0b3..86a6a88e8 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -138,8 +138,6 @@ unsigned long Download::fadler32(FILE *const file)
// Calculate Adler-32 checksum
char *const buffer = new char[fileSize];
- if (!buffer)
- return 0;
const uInt read = static_cast<uInt>(fread(buffer, 1, fileSize, file));
unsigned long adler = adler32(0L, Z_NULL, 0);
adler = adler32(static_cast<uInt>(adler),
@@ -148,7 +146,7 @@ unsigned long Download::fadler32(FILE *const file)
return adler;
}
-unsigned long Download::adlerBuffer(char *const buffer, int size)
+unsigned long Download::adlerBuffer(const char *const buffer, int size)
{
unsigned long adler = adler32(0L, Z_NULL, 0);
return adler32(static_cast<uInt>(adler),
diff --git a/src/net/download.h b/src/net/download.h
index 3628a8f3a..d9a88f8a5 100644
--- a/src/net/download.h
+++ b/src/net/download.h
@@ -106,7 +106,7 @@ class Download final
static void addHeaders(CURL *const curl);
- static unsigned long adlerBuffer(char *const buffer, int size);
+ static unsigned long adlerBuffer(const char *const buffer, int size);
static std::string getUploadResponse()
{ return mUploadResponse; }
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 174263dcd..af86aaf93 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -93,7 +93,7 @@ void LoginHandler::chooseServer(const unsigned int server) const
client->setState(STATE_UPDATE);
}
-void LoginHandler::registerAccount(LoginData *const loginData1) const
+void LoginHandler::registerAccount(const LoginData *const loginData1) const
{
if (!loginData1)
return;
diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h
index a6e7160cb..8619d4c34 100644
--- a/src/net/ea/loginhandler.h
+++ b/src/net/ea/loginhandler.h
@@ -63,7 +63,7 @@ class LoginHandler : public Net::LoginHandler
virtual void chooseServer(const unsigned int server) const override;
- virtual void registerAccount(LoginData *const loginData)
+ virtual void registerAccount(const LoginData *const loginData)
const override final;
virtual const Worlds &getWorlds() const override final A_WARN_UNUSED;
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index dc65fb3ad..6d39fe85b 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -110,7 +110,7 @@ void PartyHandler::create(const std::string &name) const
outMsg.writeString(name.substr(0, 23), 24);
}
-void PartyHandler::invite(Being *const being) const
+void PartyHandler::invite(const Being *const being) const
{
if (being)
{
@@ -149,7 +149,7 @@ void PartyHandler::leave() const
MessageOut outMsg(CMSG_PARTY_LEAVE);
}
-void PartyHandler::kick(Being *const being) const
+void PartyHandler::kick(const Being *const being) const
{
if (being)
{
diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h
index d24c46683..0c69f5da9 100644
--- a/src/net/eathena/partyhandler.h
+++ b/src/net/eathena/partyhandler.h
@@ -44,7 +44,7 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void create(const std::string &name) const override final;
- void invite(Being *const being) const override final;
+ void invite(const Being *const being) const override final;
void invite(const std::string &name) const override final;
@@ -53,7 +53,7 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void leave() const override final;
- void kick(Being *const being) const override final;
+ void kick(const Being *const being) const override final;
void kick(const std::string &name) const override final;
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 6e832aeda..caad082ae 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -90,7 +90,8 @@ class LoginHandler
virtual void chooseServer(unsigned int server) const = 0;
- virtual void registerAccount(LoginData *const loginData) const = 0;
+ virtual void registerAccount(const LoginData *const loginData)
+ const = 0;
virtual void unregisterAccount(const std::string &username,
const std::string &password) const = 0;
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index f92c148c4..4a4e8ec82 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -52,7 +52,7 @@ class PartyHandler
virtual void join(const int partyId) const = 0;
- virtual void invite(Being *const player) const = 0;
+ virtual void invite(const Being *const player) const = 0;
virtual void invite(const std::string &name) const = 0;
@@ -61,7 +61,7 @@ class PartyHandler
virtual void leave() const = 0;
- virtual void kick(Being *const player) const = 0;
+ virtual void kick(const Being *const player) const = 0;
virtual void kick(const std::string &name) const = 0;
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index ba18a9efa..a7088e33b 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -112,7 +112,7 @@ void PartyHandler::create(const std::string &name) const
outMsg.writeString(name.substr(0, 23), 24);
}
-void PartyHandler::invite(Being *const being) const
+void PartyHandler::invite(const Being *const being) const
{
if (being)
{
@@ -151,7 +151,7 @@ void PartyHandler::leave() const
MessageOut outMsg(CMSG_PARTY_LEAVE);
}
-void PartyHandler::kick(Being *const being) const
+void PartyHandler::kick(const Being *const being) const
{
if (being)
{
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 1de9c63b7..6a52c3321 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -44,7 +44,7 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void create(const std::string &name) const override final;
- void invite(Being *const being) const override final;
+ void invite(const Being *const being) const override final;
void invite(const std::string &name) const override final;
@@ -53,7 +53,7 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void leave() const override final;
- void kick(Being *const being) const override final;
+ void kick(const Being *const being) const override final;
void kick(const std::string &name) const override final;