summaryrefslogtreecommitdiff
path: root/src
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
parenta7bddc674892b81de9471a7b8ee8da19ed8e1e90 (diff)
downloadmana-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.gz
mana-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.bz2
mana-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.tar.xz
mana-fa8a4bf49100c0a1d5b96e00803f43bbbb861100.zip
Fixed some compiler warnings
Superfluous semicolons, initialization order and signed/unsigned mismatches.
Diffstat (limited to 'src')
-rw-r--r--src/gui/item_amount.cpp4
-rw-r--r--src/gui/palette.cpp17
-rw-r--r--src/gui/palette.h2
3 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index b440dfc0..9398dc47 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -35,7 +35,9 @@
ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
Window("", true, parent),
- mItem(item), mUsage(usage), mMax(mItem->getQuantity())
+ mItem(item),
+ mMax(mItem->getQuantity()),
+ mUsage(usage)
{
// Integer field
mItemAmountTextField = new IntTextField(1);
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) %
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 77ead4f6..e56bf9c5 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -77,7 +77,7 @@ class Palette : public gcn::ListModel
ENTRY(MISS)\
ENTRY(TYPE_COUNT)\
- TEXTENUM(ColorType, COLOR_TYPE);
+ TEXTENUM(ColorType, COLOR_TYPE)
/** Colors can be static or can alter over time. */
enum GradientType {