summaryrefslogtreecommitdiff
path: root/src/utils/virtfstools.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-13 16:13:30 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-13 16:13:30 +0300
commit0a2cde31f777ec41893222f71bceb799bb78e590 (patch)
treef964a7d9490e7ecc8636602f45b856e3b1b21c9b /src/utils/virtfstools.cpp
parentea8d6570615bf71937295aa670b59e4155a563e4 (diff)
downloadmanaplus-0a2cde31f777ec41893222f71bceb799bb78e590.tar.gz
manaplus-0a2cde31f777ec41893222f71bceb799bb78e590.tar.bz2
manaplus-0a2cde31f777ec41893222f71bceb799bb78e590.tar.xz
manaplus-0a2cde31f777ec41893222f71bceb799bb78e590.zip
Add restrict into virtfstools.
Diffstat (limited to 'src/utils/virtfstools.cpp')
-rw-r--r--src/utils/virtfstools.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils/virtfstools.cpp b/src/utils/virtfstools.cpp
index 528a9533e..7b7a42647 100644
--- a/src/utils/virtfstools.cpp
+++ b/src/utils/virtfstools.cpp
@@ -31,10 +31,11 @@
namespace VirtFs
{
- void *loadFile(const std::string &fileName, int &fileSize)
+ void *loadFile(const std::string &restrict fileName,
+ int &restrict fileSize)
{
// Attempt to open the specified file using PhysicsFS
- VirtFile *const file = VirtFs::openRead(fileName.c_str());
+ VirtFile *restrict const file = VirtFs::openRead(fileName.c_str());
if (!file)
{
@@ -50,7 +51,7 @@ namespace VirtFs
fileSize = CAST_S32(VirtFs::fileLength(file));
// Allocate memory and load the file
- void *const buffer = calloc(fileSize, 1);
+ void *restrict const buffer = calloc(fileSize, 1);
VirtFs::read(file, buffer, 1, fileSize);
VirtFs::close(file);