diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-17 16:34:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-17 16:34:36 +0300 |
commit | c6c4eef4e49bb4de90845408af9f642a1a4e224b (patch) | |
tree | 81d192e85b3c075cb2e52671bea4c3c0499dc3f2 /src/gui/charcreatedialog.cpp | |
parent | 093e392dd84c920d26bca17d48ac6611393d087c (diff) | |
download | plus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.gz plus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.bz2 plus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.xz plus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.zip |
Improve size calculations.
Diffstat (limited to 'src/gui/charcreatedialog.cpp')
-rw-r--r-- | src/gui/charcreatedialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp index 1ef29c93f..5c27b7440 100644 --- a/src/gui/charcreatedialog.cpp +++ b/src/gui/charcreatedialog.cpp @@ -268,7 +268,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event) mCreateButton->setEnabled(false); std::vector<int> atts; - for (unsigned i = 0; i < mAttributeSlider.size(); i++) + for (size_t i = 0, sz = mAttributeSlider.size(); i < sz; i++) { atts.push_back(static_cast<int>( mAttributeSlider[i]->getValue())); @@ -362,7 +362,7 @@ std::string CharCreateDialog::getName() const void CharCreateDialog::updateSliders() { - for (unsigned i = 0; i < mAttributeSlider.size(); i++) + for (size_t i = 0, sz = mAttributeSlider.size(); i < sz; i++) { // Update captions mAttributeValue[i]->setCaption( @@ -404,7 +404,7 @@ int CharCreateDialog::getDistributedPoints() const { int points = 0; - for (unsigned i = 0; i < mAttributeSlider.size(); i++) + for (size_t i = 0, sz = mAttributeSlider.size(); i < sz; i++) points += static_cast<int>(mAttributeSlider[i]->getValue()); return points; } @@ -434,7 +434,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels, int w = 480; int h = 350; - for (unsigned i = 0; i < labels.size(); i++) + for (unsigned i = 0, sz = labels.size(); i < sz; i++) { mAttributeLabel[i] = new Label(labels[i]); mAttributeLabel[i]->setWidth(70); |