From f09ab3acb547b786289cd78b51577df6ef669fc6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 27 Oct 2012 00:13:42 +0300 Subject: Fix code style. --- src/client.cpp | 4 +-- src/flooritem.h | 2 +- src/graphicsmanager.cpp | 2 +- src/gui/widgets/tabbedarea.cpp | 4 +-- src/guichan/widgets/textfield.cpp | 2 +- src/mobileopenglgraphics.cpp | 57 +++++++++++++++++++-------------------- src/resources/beinginfo.h | 2 +- 7 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 5dd417670..3d433dc04 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -356,9 +356,9 @@ void Client::gameInit() #endif if (config.getBoolValue("allowscreensaver")) - putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1"); + putenv(const_cast("SDL_VIDEO_ALLOW_SCREENSAVER=1")); else - putenv("SDL_VIDEO_ALLOW_SCREENSAVER=0"); + putenv(const_cast("SDL_VIDEO_ALLOW_SCREENSAVER=0")); chatLogger = new ChatLogger; if (mOptions.chatLogDir == "") diff --git a/src/flooritem.h b/src/flooritem.h index 0542d2f11..e497d0bc6 100644 --- a/src/flooritem.h +++ b/src/flooritem.h @@ -97,7 +97,7 @@ class FloorItem final : public ActorSprite void disableHightlight() { mHighlight = false; } - Cursor::Cursor getHoverCursor() + Cursor::Cursor getHoverCursor() const { return mCursor; } private: diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 4ffe48042..67bfa8847 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -798,7 +798,7 @@ void GraphicsManager::detectVideoSettings() static CALLBACK void debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, - const GLchar *text, GLvoid *userParam) + const GLchar *text, GLvoid *userParam A_UNUSED) { std::string message("OPENGL:"); switch (source) diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 39dfade9a..0321e5044 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -365,7 +365,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) gcn::Widget *const w = getCurrentWidget(); if (w) { - ScrollArea* scr = dynamic_cast(w); + ScrollArea *const scr = dynamic_cast(w); if (scr) { if (mFollowDownScroll && height != 0) @@ -378,7 +378,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) && scr->getVerticalScrollAmount() <= scr->getVerticalMaxScroll() + 2) { - int newScroll = scr->getVerticalScrollAmount() + const int newScroll = scr->getVerticalScrollAmount() + rect.height - height; w->setSize(mWidgetContainer->getWidth() - frameSize, mWidgetContainer->getHeight() - frameSize); diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp index c0575eace..7decc5c6b 100644 --- a/src/guichan/widgets/textfield.cpp +++ b/src/guichan/widgets/textfield.cpp @@ -125,7 +125,7 @@ namespace gcn { } - void TextField::setCaretPosition(unsigned int position) + void TextField::setCaretPosition(unsigned int position A_UNUSED) { } diff --git a/src/mobileopenglgraphics.cpp b/src/mobileopenglgraphics.cpp index 1cc1fae8a..564f9be82 100644 --- a/src/mobileopenglgraphics.cpp +++ b/src/mobileopenglgraphics.cpp @@ -312,7 +312,7 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, const unsigned int vLimit = mMaxVertices * 4; // Draw a set of textured rectangles // if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) - { +// { float texX1 = static_cast(srcX) / tw; float texY1 = static_cast(srcY) / th; @@ -346,23 +346,23 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, mFloatTexArray[vp + 10] = texX2; //3 mFloatTexArray[vp + 11] = texY2; - mShortVertArray[vp + 0] = dstX; - mShortVertArray[vp + 1] = dstY; + mShortVertArray[vp + 0] = static_cast(dstX); + mShortVertArray[vp + 1] = static_cast(dstY); - mShortVertArray[vp + 2] = dstX + width; - mShortVertArray[vp + 3] = dstY; + mShortVertArray[vp + 2] = static_cast(dstX + width); + mShortVertArray[vp + 3] = static_cast(dstY); - mShortVertArray[vp + 4] = dstX + width; - mShortVertArray[vp + 5] = dstY + height; + mShortVertArray[vp + 4] = static_cast(dstX + width); + mShortVertArray[vp + 5] = static_cast(dstY + height); - mShortVertArray[vp + 6] = dstX; - mShortVertArray[vp + 7] = dstY; + mShortVertArray[vp + 6] = static_cast(dstX); + mShortVertArray[vp + 7] = static_cast(dstY); - mShortVertArray[vp + 8] = dstX; - mShortVertArray[vp + 9] = dstY + height; + mShortVertArray[vp + 8] = static_cast(dstX); + mShortVertArray[vp + 9] = static_cast(dstY + height); - mShortVertArray[vp + 10] = dstX + width; - mShortVertArray[vp + 11] = dstY + height; + mShortVertArray[vp + 10] = static_cast(dstX + width); + mShortVertArray[vp + 11] = static_cast(dstY + height); vp += 12; if (vp >= vLimit) @@ -374,7 +374,7 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, } if (vp > 0) drawTriangleArrayfs(vp); - } +// } } void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, @@ -411,7 +411,7 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, // Draw a set of textured rectangles // if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) - { +// { const float tw = static_cast(image->mTexWidth); const float th = static_cast(image->mTexHeight); @@ -456,24 +456,23 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, mFloatTexArray[vp + 10] = texX2; mFloatTexArray[vp + 11] = texY2; + mShortVertArray[vp + 0] = static_cast(dstX); + mShortVertArray[vp + 1] = static_cast(dstY); - mShortVertArray[vp + 0] = dstX; - mShortVertArray[vp + 1] = dstY; + mShortVertArray[vp + 2] = static_cast(dstX + width); + mShortVertArray[vp + 3] = static_cast(dstY); - mShortVertArray[vp + 2] = dstX + width; - mShortVertArray[vp + 3] = dstY; + mShortVertArray[vp + 4] = static_cast(dstX + width); + mShortVertArray[vp + 5] = static_cast(dstY + height); - mShortVertArray[vp + 4] = dstX + width; - mShortVertArray[vp + 5] = dstY + height; + mShortVertArray[vp + 6] = static_cast(dstX); + mShortVertArray[vp + 7] = static_cast(dstY); - mShortVertArray[vp + 6] = dstX; - mShortVertArray[vp + 7] = dstY; + mShortVertArray[vp + 8] = static_cast(dstX); + mShortVertArray[vp + 9] = static_cast(dstY + height); - mShortVertArray[vp + 8] = dstX; - mShortVertArray[vp + 9] = dstY + height; - - mShortVertArray[vp + 10] = dstX + width; - mShortVertArray[vp + 11] = dstY + height; + mShortVertArray[vp + 10] = static_cast(dstX + width); + mShortVertArray[vp + 11] = static_cast(dstY + height); vp += 12; if (vp >= vLimit) @@ -485,7 +484,7 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, } if (vp > 0) drawTriangleArrayfs(vp); - } +// } } void MobileOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index ed73f576a..e3cfc6581 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -112,7 +112,7 @@ class BeingInfo final void setHoverCursor(const Cursor::Cursor &cursor) { mHoverCursor = cursor; } - Cursor::Cursor getHoverCursor() + Cursor::Cursor getHoverCursor() const { return mHoverCursor; } ActorSprite::TargetCursorSize getTargetCursorSize() const -- cgit v1.2.3-70-g09d2