summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-22 20:27:48 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-22 20:27:48 +0100
commitfa8a4bf49100c0a1d5b96e00803f43bbbb861100 (patch)
tree940186a707e4257407ed39bee858680a0478372d /src/gui/palette.cpp
parenta7bddc674892b81de9471a7b8ee8da19ed8e1e90 (diff)
downloadmana-client-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.gz
mana-client-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.bz2
mana-client-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.xz
mana-client-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.zip
Fixed some compiler warnings
Superfluous semicolons, initialization order and signed/unsigned mismatches.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index bb2245ce..fec04145 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -44,14 +44,14 @@ const gcn::Color Palette::RAINBOW_COLORS[8] = {
/** Number of Elemets of RAINBOW_COLORS */
const int Palette::RAINBOW_COLOR_COUNT = 7;
-std::string Palette::getConfigName(const std::string& typeName)
+std::string Palette::getConfigName(const std::string &typeName)
{
std::string res = "Color" + typeName;
int pos = 5;
- for (int i = 0; i < typeName.length(); i++)
+ for (size_t i = 0; i < typeName.length(); i++)
{
- if (i==0 || typeName[i] == '_')
+ if (i == 0 || typeName[i] == '_')
{
if (i > 0)
{
@@ -70,12 +70,13 @@ std::string Palette::getConfigName(const std::string& typeName)
return res;
}
-DEFENUMNAMES(ColorType, COLOR_TYPE);
+DEFENUMNAMES(ColorType, COLOR_TYPE)
const int Palette::GRADIENT_DELAY = 20;
-Palette::Palette() : mColVector(ColVector(TYPE_COUNT)), mGradVector(),
- mRainbowTime(tick_time)
+Palette::Palette() :
+ mRainbowTime(tick_time),
+ mColVector(ColVector(TYPE_COUNT))
{
std::string indent = " ";
addColor(TEXT, 0x000000, STATIC, _("Text"));
@@ -160,7 +161,7 @@ void Palette::setGradient(ColorType type, GradientType grad)
ColorElem *elem = &mColVector[type];
if (elem->grad != STATIC && grad == STATIC)
{
- for (int i = 0; i < mGradVector.size(); i++)
+ for (size_t i = 0; i < mGradVector.size(); i++)
{
if (mGradVector[i] == elem)
{
@@ -251,7 +252,7 @@ void Palette::advanceGradient ()
int advance = get_elapsed_time(mRainbowTime) / 5;
double startColVal, destColVal;
- for (int i = 0; i < mGradVector.size(); i++)
+ for (size_t i = 0; i < mGradVector.size(); i++)
{
mGradVector[i]->gradientIndex =
(mGradVector[i]->gradientIndex + advance) %