summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-22 17:23:36 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-22 17:23:36 +0300
commit505d65fa57be4af4ecf5b1b5c6582403e984bc19 (patch)
tree91de08793ef181152293f56a66247344c836bb3e /src/gui/windows
parent908c8cf42783133861d734dc0de1b170d9507564 (diff)
downloadmanaplus-505d65fa57be4af4ecf5b1b5c6582403e984bc19.tar.gz
manaplus-505d65fa57be4af4ecf5b1b5c6582403e984bc19.tar.bz2
manaplus-505d65fa57be4af4ecf5b1b5c6582403e984bc19.tar.xz
manaplus-505d65fa57be4af4ecf5b1b5c6582403e984bc19.zip
Add restrict keyword in some functions in whoisonline.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/whoisonline.cpp8
-rw-r--r--src/gui/windows/whoisonline.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 1651f4ea0..f6d7173d0 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -488,13 +488,15 @@ void WhoIsOnline::loadWebList()
mEnemy.clear();
}
-size_t WhoIsOnline::memoryWrite(void *ptr, size_t size,
- size_t nmemb, FILE *stream)
+size_t WhoIsOnline::memoryWrite(void *restrict ptr,
+ size_t size,
+ size_t nmemb,
+ FILE *restrict stream)
{
if (!stream)
return 0;
- WhoIsOnline *const wio = reinterpret_cast<WhoIsOnline *>(stream);
+ WhoIsOnline *restrict const wio = reinterpret_cast<WhoIsOnline *restrict>(stream);
const size_t totalMem = size * nmemb;
wio->mMemoryBuffer = static_cast<char*>(realloc(wio->mMemoryBuffer,
static_cast<size_t>(wio->mDownloadedBytes) + totalMem));
diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h
index f5183ad92..ff5811ed8 100644
--- a/src/gui/windows/whoisonline.h
+++ b/src/gui/windows/whoisonline.h
@@ -116,9 +116,10 @@ class WhoIsOnline final : public Window,
/**
* A libcurl callback for writing to memory.
*/
- static size_t memoryWrite(void *ptr, size_t size,
+ static size_t memoryWrite(void *restrict ptr,
+ size_t size,
size_t nmemb,
- FILE *stream);
+ FILE *restrict stream);
#endif
const std::string prepareNick(const std::string &restrict nick,