summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-09 20:00:06 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-09 20:00:06 +0300
commit14c89c0f50dd04c1187819abcc24490fa975574e (patch)
treecddff3ba490b5115c5c71d90a1898bb97f9ee06b /src
parent7e3bd20e9675202e30fac741f3d3acb4f19b109d (diff)
downloadplus-14c89c0f50dd04c1187819abcc24490fa975574e.tar.gz
plus-14c89c0f50dd04c1187819abcc24490fa975574e.tar.bz2
plus-14c89c0f50dd04c1187819abcc24490fa975574e.tar.xz
plus-14c89c0f50dd04c1187819abcc24490fa975574e.zip
Small fix to code style and compilation warning.
Diffstat (limited to 'src')
-rw-r--r--src/graphics.cpp15
-rw-r--r--src/gui/sdlfont.cpp4
-rw-r--r--src/utils/stringutils.cpp2
3 files changed, 11 insertions, 10 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 1e2fc0fb4..9912a3e7b 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -620,7 +620,7 @@ int Graphics::SDL_FakeUpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
}
/* clip the source rectangle to the source surface */
- if(srcrect)
+ if (srcrect)
{
int maxw, maxh;
@@ -650,7 +650,8 @@ int Graphics::SDL_FakeUpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
}
else
{
- srcx = srcy = 0;
+ srcx = 0;
+ srcy = 0;
w = src->w;
h = src->h;
}
@@ -661,29 +662,29 @@ int Graphics::SDL_FakeUpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
int dx, dy;
dx = clip->x - dstrect->x;
- if(dx > 0)
+ if (dx > 0)
{
w -= dx;
dstrect->x += dx;
srcx += dx;
}
dx = dstrect->x + w - clip->x - clip->w;
- if(dx > 0)
+ if (dx > 0)
w -= dx;
dy = clip->y - dstrect->y;
- if(dy > 0)
+ if (dy > 0)
{
h -= dy;
dstrect->y += dy;
srcy += dy;
}
dy = dstrect->y + h - clip->y - clip->h;
- if(dy > 0)
+ if (dy > 0)
h -= dy;
}
- if(w > 0 && h > 0)
+ if (w > 0 && h > 0)
{
srcrect->x = srcx;
srcrect->y = srcy;
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index ab20eee97..862ec8434 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -181,8 +181,8 @@ void SDLFont::clear()
}
void SDLFont::drawString(gcn::Graphics *graphics,
- const std::string &text,
- int x, int y)
+ const std::string &text,
+ int x, int y)
{
if (text.empty())
return;
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index a7e1b6c7d..8ae155bf7 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -448,7 +448,7 @@ std::string getLang()
std::string lang(lng);
int dot = lang.find(".");
- if (dot == std::string::npos && dot > 0)
+ if (dot == (signed)std::string::npos)
return lang;
return lang.substr(0, dot);