From 17dcb835103ac05012c5a7eafa8c7702cef53390 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 11 Mar 2013 18:09:33 +0300 Subject: Add some fixes after automatic checks. --- src/gui/widgets/browserbox.cpp | 2 +- src/gui/widgets/guitable.cpp | 2 +- src/gui/widgets/shopitems.cpp | 4 +--- src/gui/widgets/shoplistbox.cpp | 4 ---- src/gui/widgets/shoplistbox.h | 2 -- 5 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index bbd31cee7..93c65e356 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -536,7 +536,7 @@ int BrowserBox::calcHeight() { const signed char c = row.at(start + 2); - bool valid; + bool valid(false); const gcn::Color col[2] = { getThemeCharColor(c, valid), diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 8b6722a59..e40248121 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -382,7 +382,7 @@ void GuiTable::draw(gcn::Graphics* graphics) if (mTopWidget) { - const gcn::Rectangle bounds = mTopWidget->getDimension(); + const gcn::Rectangle &bounds = mTopWidget->getDimension(); graphics->pushClipArea(bounds); mTopWidget->draw(graphics); graphics->popClipArea(); diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp index f97767064..22049e944 100644 --- a/src/gui/widgets/shopitems.cpp +++ b/src/gui/widgets/shopitems.cpp @@ -116,13 +116,11 @@ void ShopItems::clear() ShopItem *ShopItems::findItem(const int id, const unsigned char color) const { - ShopItem *item; - std::vector::const_iterator it = mShopItems.begin(); const std::vector::const_iterator e = mShopItems.end(); while (it != e) { - item = *(it); + ShopItem *const item = *it; if (item->getId() == id && item->getColor() == color) return item; diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index d2868f3d2..45891f202 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -73,10 +73,6 @@ ShopListBox::ShopListBox(const Widget2 *const widget, mForegroundColor = getThemeColor(Theme::LISTBOX); } -void ShopListBox::init() -{ -} - void ShopListBox::setPlayersMoney(const int money) { mPlayerMoney = money; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 16f54e78a..ad58ea413 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -85,8 +85,6 @@ class ShopListBox final : public ListBox void mouseExited(gcn::MouseEvent& mouseEvent) override; private: - void init(); - int mPlayerMoney; /** -- cgit v1.2.3-60-g2f50