From 964ffbb9b6ed5246b14a7d0c0d065f7d38af0912 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 27 Mar 2011 21:41:20 +0300 Subject: Fix some warnings and improve code from gcc 4.6 compilation. --- src/gui/widgets/browserbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets/browserbox.cpp') diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 8546cbd7e..bc5583148 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -178,7 +178,7 @@ void BrowserBox::addRow(const std::string &row, bool atTop) unsigned int nextChar; const char *hyphen = "~"; int hyphenWidth = font->getWidth(hyphen); - int x = 0; + unsigned x = 0; for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); ++i) { @@ -197,7 +197,7 @@ void BrowserBox::addRow(const std::string &row, bool atTop) if (nextSpacePos <= 0) nextSpacePos = static_cast(row.size()) - 1; - int nextWordWidth = font->getWidth( + unsigned nextWordWidth = font->getWidth( row.substr(nextChar, (nextSpacePos - nextChar))); @@ -335,7 +335,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) int BrowserBox::calcHeight() { - int x = 0, y = 0; + unsigned x = 0, y = 0; int wrappedLines = 0; int link = 0; gcn::Font *font = getFont(); @@ -360,7 +360,7 @@ int BrowserBox::calcHeight() if (row.find("---", 0) == 0) { const int dashWidth = fontWidthMinus; - for (x = 0; x < getWidth(); x++) + for (x = 0; x < (unsigned)getWidth(); x++) { mLineParts.push_back(LinePart(x, y, selColor, "-")); x += dashWidth - 2; -- cgit v1.2.3-60-g2f50