From 0a2cde31f777ec41893222f71bceb799bb78e590 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Feb 2017 16:13:30 +0300 Subject: Add restrict into virtfstools. --- src/utils/virtfstools.cpp | 7 ++++--- src/utils/virtfstools.h | 3 ++- 2 files changed, 6 insertions(+), 4 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); diff --git a/src/utils/virtfstools.h b/src/utils/virtfstools.h index be16dddea..fccacbec1 100644 --- a/src/utils/virtfstools.h +++ b/src/utils/virtfstools.h @@ -31,7 +31,8 @@ struct VirtFile; namespace VirtFs { - void *loadFile(const std::string &fileName, int &fileSize); + void *loadFile(const std::string &restrict fileName, + int &restrict fileSize); void searchAndAddArchives(const std::string &restrict path, const std::string &restrict ext, const Append append); -- cgit v1.2.3-60-g2f50