From 7c79aa2b8e484319e3e511fa21db6d2448347024 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 27 Aug 2012 21:18:46 +0300 Subject: Add const to more classes. --- src/gui/palette.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui/palette.cpp') diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index f0380153f..94604c128 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -52,7 +52,7 @@ const gcn::Color Palette::RAINBOW_COLORS[7] = /** Number of Elemets of RAINBOW_COLORS */ const int Palette::RAINBOW_COLOR_COUNT = 7; -Palette::Palette(int size) : +Palette::Palette(const int size) : mRainbowTime(tick_time), mColors(Colors(size)) { @@ -64,9 +64,9 @@ Palette::~Palette() mInstances.erase(this); } -const gcn::Color& Palette::getColor(char c, bool &valid) +const gcn::Color& Palette::getColor(const char c, bool &valid) { - CharColors::const_iterator it = mCharColors.find(c); + const CharColors::const_iterator it = mCharColors.find(c); if (it != mCharColors.end()) { valid = true; @@ -94,7 +94,7 @@ void Palette::advanceGradient() // For slower systems, advance can be greater than one (advance > 1 // skips advance-1 steps). Should make gradient look the same // independent of the framerate. - int advance = get_elapsed_time(mRainbowTime) / 5; + const int advance = get_elapsed_time(mRainbowTime) / 5; double startColVal, destColVal; for (size_t i = 0, sz = mGradVector.size(); i < sz; i++) @@ -121,7 +121,7 @@ void Palette::advanceGradient() else colIndex = mGradVector[i]->gradientIndex; - ColorElem *elem = mGradVector[i]; + ColorElem *const elem = mGradVector[i]; gcn::Color &color = elem->color; if (elem->grad == PULSE) -- cgit v1.2.3-70-g09d2