diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-18 01:18:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-18 01:18:56 +0300 |
commit | f9a8845bbbfd5403a720dec46c7327c45dade4ea (patch) | |
tree | 1c52fede31d584274c05485359c3a3d6f6c9d5bd /src | |
parent | 479e48f8e65ffdbc6ceae3189e71ac40b5d85d8e (diff) | |
download | manaplus-f9a8845bbbfd5403a720dec46c7327c45dade4ea.tar.gz manaplus-f9a8845bbbfd5403a720dec46c7327c45dade4ea.tar.bz2 manaplus-f9a8845bbbfd5403a720dec46c7327c45dade4ea.tar.xz manaplus-f9a8845bbbfd5403a720dec46c7327c45dade4ea.zip |
add restrict into files.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/files.cpp | 15 | ||||
-rw-r--r-- | src/utils/files.h | 16 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 2d7994f8a..cb43ff5df 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -75,8 +75,8 @@ void Files::setCopyCallBack(Files::CopyFileCallbackPtr callback) mCallbackPtr = callback; } -void Files::copyPhysFsFile(const std::string &inFile, - const std::string &outFile) +void Files::copyPhysFsFile(const std::string &restrict inFile, + const std::string &restrict outFile) { int size = 0; void *const buf = ResourceManager::loadFile(inFile, size); @@ -93,7 +93,8 @@ void Files::copyPhysFsFile(const std::string &inFile, #endif } -void Files::copyPhysFsDir(const std::string &inDir, const std::string &outDir) +void Files::copyPhysFsDir(const std::string &restrict inDir, + const std::string &restrict outDir) { mkdir_r(outDir.c_str()); char **files = PhysFs::enumerateFiles(inDir.c_str()); @@ -109,8 +110,9 @@ void Files::copyPhysFsDir(const std::string &inDir, const std::string &outDir) PhysFs::freeList(files); } -void Files::extractZip(const std::string &zipName, const std::string &inDir, - const std::string &outDir) +void Files::extractZip(const std::string &restrict zipName, + const std::string &restrict inDir, + const std::string &restrict outDir) { const ResourceManager *const resman = ResourceManager::getInstance(); resman->addToSearchPath(zipName, false); @@ -121,7 +123,8 @@ void Files::extractZip(const std::string &zipName, const std::string &inDir, #endif // ANDROID __native_client__ -int Files::renameFile(const std::string &srcName, const std::string &dstName) +int Files::renameFile(const std::string &restrict srcName, + const std::string &restrict dstName) { FILE *srcFile = fopen(srcName.c_str(), "rb"); if (srcFile == nullptr) diff --git a/src/utils/files.h b/src/utils/files.h index f356d7688..5eb29031e 100644 --- a/src/utils/files.h +++ b/src/utils/files.h @@ -23,6 +23,8 @@ #include <string> +#include "localconsts.h" + namespace Files { #ifdef ANDROID @@ -34,15 +36,19 @@ namespace Files void setCopyCallBack(CopyFileCallbackPtr callback); - void copyPhysFsFile(const std::string &inFile, const std::string &outFile); + void copyPhysFsFile(const std::string &restrict inFile, + const std::string &restrict outFile); - void copyPhysFsDir(const std::string &inDir, const std::string &outDir); + void copyPhysFsDir(const std::string &restrict inDir, + const std::string &restrict outDir); - void extractZip(const std::string &zipName, const std::string &inDir, - const std::string &outDir); + void extractZip(const std::string &restrict zipName, + const std::string &restrict inDir, + const std::string &restrict outDir); #endif // ANDROID __native_client__ - int renameFile(const std::string &pFrom, const std::string &pTo); + int renameFile(const std::string &restrict pFrom, + const std::string &restrict pTo); } // namespace Files #endif // UTILS_FILES_H |