From 13b064998c0f7142a134817c9dde08ad29db97fe Mon Sep 17 00:00:00 2001 From: Steve Cotton Date: Mon, 16 Mar 2009 19:04:38 +0000 Subject: Code reformatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picking changes from Bjørn's 1b3cb122be1a418ce82b66fb9ce1ecf3aa5813fb Mainly making sure 'const std::string &' is used everywhere instead of 'std::string const &'. The former has always been the preferred order in this project. --- src/resources/dye.cpp | 6 +++--- src/resources/dye.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources') diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index a5998017..92176852 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -26,7 +26,7 @@ #include "../log.h" -Palette::Palette(std::string const &description) +Palette::Palette(const std::string &description) { int size = description.length(); if (size == 0) return; @@ -109,7 +109,7 @@ void Palette::getColor(int intensity, int color[3]) const color[2] = ((255 - t) * b1 + t * b2) / 255; } -Dye::Dye(std::string const &description) +Dye::Dye(const std::string &description) { for (int i = 0; i < 7; ++i) mPalettes[i] = 0; @@ -175,7 +175,7 @@ void Dye::update(int color[3]) const mPalettes[i - 1]->getColor(cmax, color); } -void Dye::instantiate(std::string &target, std::string const &palettes) +void Dye::instantiate(std::string &target, const std::string &palettes) { std::string::size_type next_pos = target.find('|'); if (next_pos == std::string::npos || palettes.empty()) return; diff --git a/src/resources/dye.h b/src/resources/dye.h index 48254b6f..ef867058 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -38,7 +38,7 @@ class Palette * The string is either a file name or a sequence of hexadecimal RGB * values separated by ',' and starting with '#'. */ - Palette(std::string const &pallete); + Palette(const std::string &pallete); /** * Gets a pixel color depending on its intensity. @@ -65,7 +65,7 @@ class Dye * 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. */ - Dye(std::string const &dye); + Dye(const std::string &dye); /** * Destroys the associated palettes. @@ -81,7 +81,7 @@ class Dye * Fills the blank in a dye placeholder with some palette names. */ static void instantiate(std::string &target, - std::string const &palettes); + const std::string &palettes); private: -- cgit v1.2.3-70-g09d2