From 7900408adc2b6db601373de2730a80707ec4c837 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Dec 2012 01:34:04 +0300 Subject: Fix different warnings from previous commits. --- src/gui/sdlfont.cpp | 7 ++++--- src/gui/serverdialog.cpp | 4 ---- src/gui/skilldialog.cpp | 4 ++-- src/gui/widgets/button.cpp | 4 ++-- src/gui/widgets/namesmodel.cpp | 2 +- src/gui/widgets/setupitem.cpp | 3 ++- src/resources/sdlimagehelper.cpp | 3 ++- 7 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 3ece4b849..181bcef87 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -96,7 +96,6 @@ class SDLTextChunk final || color.b != color2.b) { // outlining SDL_Color sdlCol2; - const SDL_PixelFormat * const format = surface->format; SDL_Surface *background = imageHelper->create32BitSurface( width, height); if (!background) @@ -120,8 +119,10 @@ class SDLTextChunk final } SDL_Rect rect = { - OUTLINE_SIZE, 0, - surface->w, surface->h + OUTLINE_SIZE, + 0, + static_cast(surface->w), + static_cast(surface->h) }; // SDL_SetAlpha(surface2, 0, SDL_ALPHA_OPAQUE); SDL_gfxBlitRGBA(surface2, nullptr, background, &rect); diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 4ba2bca1d..5e7c80515 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -476,10 +476,6 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mDeleteButton->setEnabled(false); return; } - - // Update the server and post fields according to the new selection - const ServerInfo &myServer = mServersListModel->getServer(index); - mDeleteButton->setEnabled(true); } diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 00d26b17c..35e3e7422 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -726,9 +726,9 @@ SkillData *SkillInfo::getData(const int level1) return (*it).second; } -SkillData *SkillInfo::getData1(const int level) +SkillData *SkillInfo::getData1(const int lev) { - SkillDataMapIter it = dataMap.find(level); + SkillDataMapIter it = dataMap.find(lev); if (it == dataMap.end()) return dataMap[0]; return (*it).second; diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index f0337766f..265815929 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -377,8 +377,8 @@ void Button::draw(gcn::Graphics *graphics) const int width = font->getWidth(mCaption); if (mImages) { - const int width = width + mImageWidth + spacing; - imageX = getWidth() / 2 - width / 2; + const int w = width + mImageWidth + spacing; + imageX = (getWidth() - w) / 2; textX = imageX + mImageWidth + spacing - width / 2; } else diff --git a/src/gui/widgets/namesmodel.cpp b/src/gui/widgets/namesmodel.cpp index 299eed355..186976d13 100644 --- a/src/gui/widgets/namesmodel.cpp +++ b/src/gui/widgets/namesmodel.cpp @@ -52,6 +52,6 @@ std::string NamesModel::getElementAt(int i) void NamesModel::fillFromArray(const char *const *const arr, std::size_t sz) { - for (int f = 0; f < sz; f ++) + for (size_t f = 0; f < sz; f ++) mNames.push_back(gettext(arr[f])); } diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index d3c46e0ec..dd2d16caf 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -562,7 +562,8 @@ SetupItemDropDown::SetupItemDropDown(std::string text, mHorizont(nullptr), mLabel(nullptr), mModel(model), - mDropDown(nullptr) + mDropDown(nullptr), + mWidth(width) { mValueType = VSTR; createControls(); diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index abc9ca068..fb613d9cf 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -129,7 +129,8 @@ Image *SDLImageHelper::load(SDL_Surface *const tmpImage) } Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage, - int width, int height, + int width A_UNUSED, + int height A_UNUSED, const float alpha) { if (!tmpImage) -- cgit v1.2.3-60-g2f50