diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-26 23:26:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-26 23:26:41 +0300 |
commit | b1032f8fde46889a3b9bdb25333f26225a28d0f4 (patch) | |
tree | 807badec9e8bc7181fbb1dfcb89cb4f3440c61cd | |
parent | a8acf366d3e943fb636e24b69c8c67152770d2cc (diff) | |
download | manaverse-b1032f8fde46889a3b9bdb25333f26225a28d0f4.tar.gz manaverse-b1032f8fde46889a3b9bdb25333f26225a28d0f4.tar.bz2 manaverse-b1032f8fde46889a3b9bdb25333f26225a28d0f4.tar.xz manaverse-b1032f8fde46889a3b9bdb25333f26225a28d0f4.zip |
Add restrict keyword into dye.
-rw-r--r-- | src/resources/dye/dye.cpp | 10 | ||||
-rw-r--r-- | src/resources/dye/dye.h | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp index 3b7904122..e2544590f 100644 --- a/src/resources/dye/dye.cpp +++ b/src/resources/dye/dye.cpp @@ -34,7 +34,7 @@ #include "debug.h" -Dye::Dye(const std::string &description) +Dye::Dye(const std::string &restrict description) { for (int i = 0; i < dyePalateSize; ++i) mDyePalettes[i] = nullptr; @@ -139,7 +139,7 @@ void Dye::instantiate(std::string &restrict target, target = s.str(); } -int Dye::getType() const +int Dye::getType() const restrict2 { if (mDyePalettes[sPaleteIndex]) return 1; @@ -148,7 +148,8 @@ int Dye::getType() const return 0; } -void Dye::normalDye(uint32_t *restrict pixels, const int bufSize) const +void Dye::normalDye(uint32_t *restrict pixels, + const int bufSize) const restrict2 { if (!pixels) return; @@ -266,7 +267,8 @@ endlabel:{} #endif // ENABLE_CILKPLUS } -void Dye::normalOGLDye(uint32_t *restrict pixels, const int bufSize) const +void Dye::normalOGLDye(uint32_t *restrict pixels, + const int bufSize) const restrict2 { if (!pixels) return; diff --git a/src/resources/dye/dye.h b/src/resources/dye/dye.h index 02e1b3f05..d3d9ef654 100644 --- a/src/resources/dye/dye.h +++ b/src/resources/dye/dye.h @@ -45,7 +45,7 @@ class Dye final * The parts of string are separated by semi-colons. Each part starts * by an uppercase letter, followed by a colon and then a palette name. */ - explicit Dye(const std::string &dye); + explicit Dye(const std::string &restrict dye); A_DELETE_COPY(Dye) @@ -75,11 +75,13 @@ class Dye final /** * Return dye type for S - 1, for A - 2, 0 for other */ - int getType() const A_WARN_UNUSED; + int getType() const restrict2 A_WARN_UNUSED; - void normalDye(uint32_t *restrict pixels, const int bufSize) const; + void normalDye(uint32_t *restrict pixels, + const int bufSize) const restrict2; - void normalOGLDye(uint32_t *restrict pixels, const int bufSize) const; + void normalOGLDye(uint32_t *restrict pixels, + const int bufSize) const restrict2; private: /** @@ -87,7 +89,7 @@ class Dye final * * Red, Green, Yellow, Blue, Magenta, White (or rather gray), Simple. */ - DyePalette *mDyePalettes[dyePalateSize]; + DyePalette *restrict mDyePalettes[dyePalateSize]; }; #endif // RESOURCES_DYE_DYE_H |