From a69a87c5a81ddbf25a25c5549259da550d207bda Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Jun 2012 02:46:01 +0300 Subject: Improve a bit iterators again. --- src/guichan/widgets/textbox.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/guichan/widgets/textbox.cpp') diff --git a/src/guichan/widgets/textbox.cpp b/src/guichan/widgets/textbox.cpp index 2c6066976..0103cdb99 100644 --- a/src/guichan/widgets/textbox.cpp +++ b/src/guichan/widgets/textbox.cpp @@ -114,8 +114,6 @@ namespace gcn void TextBox::draw(Graphics* graphics) { - unsigned int i; - if (mOpaque) { graphics->setColor(getBackgroundColor()); @@ -132,7 +130,7 @@ namespace gcn graphics->setColor(getForegroundColor()); graphics->setFont(getFont()); - for (i = 0; i < mTextRows.size(); i++) + for (size_t i = 0; i < mTextRows.size(); i++) { // Move the text one pixel so we can have a caret before a letter. graphics->drawText(mTextRows[i], 1, i * getFont()->getHeight()); @@ -170,9 +168,8 @@ namespace gcn void TextBox::adjustSize() { - unsigned int i; int width = 0; - for (i = 0; i < mTextRows.size(); ++i) + for (size_t i = 0; i < mTextRows.size(); ++i) { int w = getFont()->getWidth(mTextRows[i]); if (width < w) -- cgit v1.2.3-70-g09d2