From 7e53a47d6f3e2dfb1446384e674f9d391bd23f7a Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sat, 10 Dec 2016 19:38:50 +0300
Subject: Add restrict and noexcept in dye and dyepalette.

---
 src/resources/dye/dye.cpp        | 2 +-
 src/resources/dye/dye.h          | 6 +++---
 src/resources/dye/dyepalette.cpp | 6 +++---
 src/resources/dye/dyepalette.h   | 6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp
index eac52f638..789c711c4 100644
--- a/src/resources/dye/dye.cpp
+++ b/src/resources/dye/dye.cpp
@@ -141,7 +141,7 @@ void Dye::instantiate(std::string &restrict target,
     target = s.str();
 }
 
-int Dye::getType() const restrict2
+int Dye::getType() const restrict2 noexcept2
 {
     if (mDyePalettes[sPaleteIndex])
         return 1;
diff --git a/src/resources/dye/dye.h b/src/resources/dye/dye.h
index 44052822b..6313fa255 100644
--- a/src/resources/dye/dye.h
+++ b/src/resources/dye/dye.h
@@ -63,19 +63,19 @@ class Dye final
         /**
          * Return special dye palete (S)
          */
-        const DyePalette *getSPalete() const A_WARN_UNUSED
+        const DyePalette *getSPalete() const restrict2 noexcept2 A_WARN_UNUSED
         { return mDyePalettes[sPaleteIndex]; }
 
         /**
          * Return special dye palete (A)
          */
-        const DyePalette *getAPalete() const A_WARN_UNUSED
+        const DyePalette *getAPalete() const restrict2 noexcept2 A_WARN_UNUSED
         { return mDyePalettes[aPaleteIndex]; }
 
         /**
          * Return dye type for S - 1, for A - 2, 0 for other
          */
-        int getType() const restrict2 A_WARN_UNUSED;
+        int getType() const restrict2 noexcept2 A_WARN_UNUSED;
 
         void normalDye(uint32_t *restrict pixels,
                        const int bufSize) const restrict2;
diff --git a/src/resources/dye/dyepalette.cpp b/src/resources/dye/dyepalette.cpp
index b2b2d9832..dbb8e4973 100644
--- a/src/resources/dye/dyepalette.cpp
+++ b/src/resources/dye/dyepalette.cpp
@@ -97,9 +97,9 @@ DyePalette::DyePalette(const std::string &restrict description,
     logger->log("Error, invalid embedded palette: %s", description.c_str());
 }
 
-void DyePalette::hexToColor(const std::string &hexStr,
+void DyePalette::hexToColor(const std::string &restrict hexStr,
                             const uint8_t blockSize,
-                            DyeColor &color)
+                            DyeColor &color) noexcept2
 {
     for (size_t i = 0, colorIdx = 0;
          i < blockSize && colorIdx < 4;
@@ -111,7 +111,7 @@ void DyePalette::hexToColor(const std::string &hexStr,
     }
 }
 
-unsigned int DyePalette::hexDecode(const signed char c)
+unsigned int DyePalette::hexDecode(const signed char c) noexcept2
 {
     if ('0' <= c && c <= '9')
         return c - '0';
diff --git a/src/resources/dye/dyepalette.h b/src/resources/dye/dyepalette.h
index f7258b4ec..5f71180de 100644
--- a/src/resources/dye/dyepalette.h
+++ b/src/resources/dye/dyepalette.h
@@ -84,11 +84,11 @@ class DyePalette final
                               const int bufSize) const restrict2;
 
         static unsigned int hexDecode(const signed char c)
-                                      A_CONST A_WARN_UNUSED;
+                                      noexcept2 A_CONST A_WARN_UNUSED;
 
-        static void hexToColor(const std::string &hexStr,
+        static void hexToColor(const std::string &restrict hexStr,
                                const uint8_t blockSize,
-                               DyeColor &color);
+                               DyeColor &color) noexcept2;
 
 #ifndef UNITTESTS
     private:
-- 
cgit v1.2.3-70-g09d2