summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-26 20:08:44 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-28 21:17:59 +0300
commitc430b75e370a21a17f80d4ba3acd84111828a462 (patch)
tree6d4ea8421de26c623c4196a7dd2aa3d86c5add01 /src/net
parent1dcb42c708c92216c7c9cacd3d3c9301e71e6006 (diff)
downloadmanaverse-c430b75e370a21a17f80d4ba3acd84111828a462.tar.gz
manaverse-c430b75e370a21a17f80d4ba3acd84111828a462.tar.bz2
manaverse-c430b75e370a21a17f80d4ba3acd84111828a462.tar.xz
manaverse-c430b75e370a21a17f80d4ba3acd84111828a462.zip
add const for methods return values.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp2
-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/loginhandler.h4
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/messageout.h2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 71169d207..9dd90a1d1 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -194,7 +194,7 @@ void Download::cancel()
mThread = nullptr;
}
-char *Download::getError() const
+const char *Download::getError() const
{
return mError;
}
diff --git a/src/net/download.h b/src/net/download.h
index 33f7ae3b3..8850b3512 100644
--- a/src/net/download.h
+++ b/src/net/download.h
@@ -87,7 +87,7 @@ class Download final
*/
void cancel();
- char *getError() const A_WARN_UNUSED;
+ const char *getError() const A_WARN_UNUSED;
void setIgnoreError(const bool n)
{ mIgnoreError = n; }
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 23f9f91c0..59d72dd78 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -121,7 +121,7 @@ void LoginHandler::registerAccount(LoginData *const loginData1) const
sendLoginRegister(username, loginData1->password, loginData1->email);
}
-Worlds LoginHandler::getWorlds() const
+const Worlds &LoginHandler::getWorlds() const
{
return mWorlds;
}
diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h
index 994029247..e84da5ce4 100644
--- a/src/net/ea/loginhandler.h
+++ b/src/net/ea/loginhandler.h
@@ -60,7 +60,7 @@ class LoginHandler : public Net::LoginHandler
virtual void registerAccount(LoginData *const loginData)
const override;
- virtual Worlds getWorlds() const override A_WARN_UNUSED;
+ virtual const Worlds &getWorlds() const override A_WARN_UNUSED;
virtual void clearWorlds() override;
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 019e9b846..229e9a4c6 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -52,7 +52,7 @@ class LoginHandler
void setServer(const ServerInfo &server)
{ mServer = server; }
- ServerInfo getServer() const A_WARN_UNUSED
+ const ServerInfo &getServer() const A_WARN_UNUSED
{ return mServer; }
virtual void connect() = 0;
@@ -99,7 +99,7 @@ class LoginHandler
virtual void unregisterAccount(const std::string &username,
const std::string &password) const = 0;
- virtual Worlds getWorlds() const A_WARN_UNUSED = 0;
+ virtual const Worlds &getWorlds() const A_WARN_UNUSED = 0;
virtual void clearWorlds() = 0;
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index ab279020f..1a295a066 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -110,7 +110,7 @@ void MessageOut::writeStringNoLog(const std::string &string, int length)
PacketCounters::incOutBytes(length);
}
-char *MessageOut::getData() const
+const char *MessageOut::getData() const
{
return mData;
}
diff --git a/src/net/messageout.h b/src/net/messageout.h
index 68d4b53a3..0fcd6ce15 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -62,7 +62,7 @@ class MessageOut
/**
* Returns the content of the message.
*/
- virtual char *getData() const A_WARN_UNUSED;
+ virtual const char *getData() const A_WARN_UNUSED;
/**
* Returns the length of the data.