summaryrefslogtreecommitdiff
path: root/src/gui/whoisonline.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-16 19:28:16 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-16 19:28:16 +0300
commitcd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 (patch)
treefdda7e2c3d93b35771f6eb79c22dce9301082f19 /src/gui/whoisonline.cpp
parentf8fc3380197c078a6dcff02351d835c3022411e1 (diff)
downloadplus-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.gz
plus-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.bz2
plus-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.xz
plus-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.zip
Add const to variables with type size_t.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r--src/gui/whoisonline.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 0747b4276..747691ad3 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -241,7 +241,7 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
void WhoIsOnline::loadList(std::vector<OnlinePlayer*> &list)
{
mBrowserBox->clearRows();
- size_t numOnline = list.size();
+ const size_t numOnline = list.size();
std::vector<OnlinePlayer*> friends;
std::vector<OnlinePlayer*> neutral;
std::vector<OnlinePlayer*> disregard;
@@ -353,13 +353,10 @@ void WhoIsOnline::loadWebList()
trim(lineStr);
if (listStarted == true)
{
- size_t found;
- found = lineStr.find(" users are online.");
- if (found == std::string::npos)
+ if (lineStr.find(" users are online.") == std::string::npos)
{
int level = 0;
- size_t pos = 0;
if (lineStr.length() > 24)
{
nick = lineStr.substr(0, 24);
@@ -373,7 +370,7 @@ void WhoIsOnline::loadWebList()
trim(nick);
bool isGM(false);
- pos = lineStr.find(gmText, 0);
+ size_t pos = lineStr.find(gmText, 0);
if (pos != std::string::npos)
{
lineStr = lineStr.substr(pos + gmText.length());
@@ -477,7 +474,7 @@ size_t WhoIsOnline::memoryWrite(void *ptr, size_t size,
return 0;
WhoIsOnline *wio = reinterpret_cast<WhoIsOnline *>(stream);
- size_t totalMem = size * nmemb;
+ const size_t totalMem = size * nmemb;
wio->mMemoryBuffer = static_cast<char*>(realloc(wio->mMemoryBuffer,
wio->mDownloadedBytes + totalMem));
if (wio->mMemoryBuffer)