diff --git a/examples/shader/Shader.cpp b/examples/shader/Shader.cpp index 3c9891782..9a48e9d76 100644 --- a/examples/shader/Shader.cpp +++ b/examples/shader/Shader.cpp @@ -225,9 +225,10 @@ public : // Update the position of the moving entities for (std::size_t i = 0; i < m_entities.size(); ++i) { - float x = std::cos(0.25f * (time * i + (m_entities.size() - i))) * 300 + 350; - float y = std::sin(0.25f * (time * (m_entities.size() - i) + i)) * 200 + 250; - m_entities[i].setPosition(x, y); + sf::Vector2f position; + position.x = std::cos(0.25f * (time * i + (m_entities.size() - i))) * 300 + 350; + position.y = std::sin(0.25f * (time * (m_entities.size() - i) + i)) * 200 + 250; + m_entities[i].setPosition(position); } // Render the updated scene to the off-screen surface diff --git a/include/SFML/Audio/SoundStream.hpp b/include/SFML/Audio/SoundStream.hpp index 4e396a89b..e4c2f2b17 100644 --- a/include/SFML/Audio/SoundStream.hpp +++ b/include/SFML/Audio/SoundStream.hpp @@ -210,7 +210,7 @@ private : /// only when the sound is stopped. /// //////////////////////////////////////////////////////////// - void stream(); + void streamData(); //////////////////////////////////////////////////////////// /// \brief Request a new chunk of audio samples from the stream source diff --git a/include/SFML/Graphics/Font.hpp b/include/SFML/Graphics/Font.hpp index 80f747be1..066b5a615 100644 --- a/include/SFML/Graphics/Font.hpp +++ b/include/SFML/Graphics/Font.hpp @@ -219,7 +219,7 @@ private : //////////////////////////////////////////////////////////// struct Row { - Row(unsigned int top, unsigned int height) : width(0), top(top), height(height) {} + Row(unsigned int rowTop, unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {} unsigned int width; ///< Current width of the row unsigned int top; ///< Y position of the row into the texture diff --git a/include/SFML/Graphics/Rect.hpp b/include/SFML/Graphics/Rect.hpp index 7d21f28b7..12b732ecc 100644 --- a/include/SFML/Graphics/Rect.hpp +++ b/include/SFML/Graphics/Rect.hpp @@ -58,13 +58,13 @@ public : /// Be careful, the last two parameters are the width /// and height, not the right and bottom coordinates! /// - /// \param left Left coordinate of the rectangle - /// \param top Top coordinate of the rectangle - /// \param width Width of the rectangle - /// \param height Height of the rectangle + /// \param rectLeft Left coordinate of the rectangle + /// \param rectTop Top coordinate of the rectangle + /// \param rectWidth Width of the rectangle + /// \param rectHeight Height of the rectangle /// //////////////////////////////////////////////////////////// - Rect(T left, T top, T width, T height); + Rect(T rectLeft, T rectTop, T rectWidth, T rectHeight); //////////////////////////////////////////////////////////// /// \brief Construct the rectangle from position and size diff --git a/include/SFML/Graphics/Rect.inl b/include/SFML/Graphics/Rect.inl index 4b0c64a30..b8f23aac4 100644 --- a/include/SFML/Graphics/Rect.inl +++ b/include/SFML/Graphics/Rect.inl @@ -37,11 +37,11 @@ height(0) //////////////////////////////////////////////////////////// template -Rect::Rect(T left, T top, T width, T height) : -left (left), -top (top), -width (width), -height(height) +Rect::Rect(T rectLeft, T rectTop, T rectWidth, T rectHeight) : +left (rectLeft), +top (rectTop), +width (rectWidth), +height(rectHeight) { } diff --git a/include/SFML/Graphics/RenderStates.hpp b/include/SFML/Graphics/RenderStates.hpp index 03775fbbd..86b307186 100644 --- a/include/SFML/Graphics/RenderStates.hpp +++ b/include/SFML/Graphics/RenderStates.hpp @@ -63,46 +63,46 @@ public : //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom blend mode /// - /// \param blendMode Blend mode to use + /// \param theBlendMode Blend mode to use /// //////////////////////////////////////////////////////////// - RenderStates(BlendMode blendMode); + RenderStates(BlendMode theBlendMode); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom transform /// - /// \param transform Transform to use + /// \param theTransform Transform to use /// //////////////////////////////////////////////////////////// - RenderStates(const Transform& transform); + RenderStates(const Transform& theTransform); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom texture /// - /// \param texture Texture to use + /// \param theTexture Texture to use /// //////////////////////////////////////////////////////////// - RenderStates(const Texture* texture); + RenderStates(const Texture* theTexture); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom shader /// - /// \param shader Shader to use + /// \param theShader Shader to use /// //////////////////////////////////////////////////////////// - RenderStates(const Shader* shader); + RenderStates(const Shader* theShader); //////////////////////////////////////////////////////////// /// \brief Construct a set of render states with all its attributes /// - /// \param blendMode Blend mode to use - /// \param transform Transform to use - /// \param texture Texture to use - /// \param shader Shader to use + /// \param theBlendMode Blend mode to use + /// \param theTransform Transform to use + /// \param theTexture Texture to use + /// \param theShader Shader to use /// //////////////////////////////////////////////////////////// - RenderStates(BlendMode blendMode, const Transform& transform, - const Texture* texture, const Shader* shader); + RenderStates(BlendMode theBlendMode, const Transform& theTransform, + const Texture* theTexture, const Shader* theShader); //////////////////////////////////////////////////////////// // Static member data diff --git a/include/SFML/Graphics/Vertex.hpp b/include/SFML/Graphics/Vertex.hpp index 8d5a97828..c09f0662f 100644 --- a/include/SFML/Graphics/Vertex.hpp +++ b/include/SFML/Graphics/Vertex.hpp @@ -54,42 +54,42 @@ public : /// /// The vertex color is white and texture coordinates are (0, 0). /// - /// \param position Vertex position + /// \param thePosition Vertex position /// //////////////////////////////////////////////////////////// - Vertex(const Vector2f& position); + Vertex(const Vector2f& thePosition); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position and color /// /// The texture coordinates are (0, 0). /// - /// \param position Vertex position - /// \param color Vertex color + /// \param thePosition Vertex position + /// \param theColor Vertex color /// //////////////////////////////////////////////////////////// - Vertex(const Vector2f& position, const Color& color); + Vertex(const Vector2f& thePosition, const Color& theColor); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position and texture coordinates /// /// The vertex color is white. /// - /// \param position Vertex position - /// \param texCoords Vertex texture coordinates + /// \param thePosition Vertex position + /// \param theTexCoords Vertex texture coordinates /// //////////////////////////////////////////////////////////// - Vertex(const Vector2f& position, const Vector2f& texCoords); + Vertex(const Vector2f& thePosition, const Vector2f& theTexCoords); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position, color and texture coordinates /// - /// \param position Vertex position - /// \param color Vertex color - /// \param texCoords Vertex texture coordinates + /// \param thePosition Vertex position + /// \param theColor Vertex color + /// \param theTexCoords Vertex texture coordinates /// //////////////////////////////////////////////////////////// - Vertex(const Vector2f& position, const Color& color, const Vector2f& texCoords); + Vertex(const Vector2f& thePosition, const Color& theColor, const Vector2f& theTexCoords); //////////////////////////////////////////////////////////// // Member data diff --git a/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl index 0d45b85e9..8dbceabb9 100644 --- a/include/SFML/System/Utf.inl +++ b/include/SFML/System/Utf.inl @@ -519,7 +519,7 @@ Out Utf<16>::toUtf32(In begin, In end, Out output) //////////////////////////////////////////////////////////// template -In Utf<32>::decode(In begin, In end, Uint32& output, Uint32) +In Utf<32>::decode(In begin, In /*end*/, Uint32& output, Uint32 /*replacement*/) { output = *begin++; return begin; @@ -528,7 +528,7 @@ In Utf<32>::decode(In begin, In end, Uint32& output, Uint32) //////////////////////////////////////////////////////////// template -Out Utf<32>::encode(Uint32 input, Out output, Uint32 replacement) +Out Utf<32>::encode(Uint32 input, Out output, Uint32 /*replacement*/) { *output++ = input; return output; @@ -537,7 +537,7 @@ Out Utf<32>::encode(Uint32 input, Out output, Uint32 replacement) //////////////////////////////////////////////////////////// template -In Utf<32>::next(In begin, In end) +In Utf<32>::next(In begin, In /*end*/) { return ++begin; } @@ -669,6 +669,8 @@ Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale) (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ + (void)locale; // to avoid warnings + wchar_t character = 0; mbtowc(&character, &input, 1); return static_cast(character); @@ -712,6 +714,8 @@ Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, const st (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ + (void)locale; // to avoid warnings + char character = 0; if (wctomb(&character, static_cast(codepoint)) >= 0) *output++ = character; diff --git a/include/SFML/Window/VideoMode.hpp b/include/SFML/Window/VideoMode.hpp index 2ef929067..4f0978a5f 100644 --- a/include/SFML/Window/VideoMode.hpp +++ b/include/SFML/Window/VideoMode.hpp @@ -53,12 +53,12 @@ public : //////////////////////////////////////////////////////////// /// \brief Construct the video mode with its attributes /// - /// \param width Width in pixels - /// \param height Height in pixels - /// \param bitsPerPixel Pixel depths in bits per pixel + /// \param modeWidth Width in pixels + /// \param modeHeight Height in pixels + /// \param modeBitsPerPixel Pixel depths in bits per pixel /// //////////////////////////////////////////////////////////// - VideoMode(unsigned int width, unsigned int height, unsigned int bitsPerPixel = 32); + VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel = 32); //////////////////////////////////////////////////////////// /// \brief Get the current desktop video mode diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 6364bdc6c..4b2f2d4f0 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -40,7 +40,7 @@ namespace sf { //////////////////////////////////////////////////////////// SoundStream::SoundStream() : -m_thread (&SoundStream::stream, this), +m_thread (&SoundStream::streamData, this), m_isStreaming (false), m_channelCount (0), m_sampleRate (0), @@ -190,7 +190,7 @@ bool SoundStream::getLoop() const //////////////////////////////////////////////////////////// -void SoundStream::stream() +void SoundStream::streamData() { // Create the buffers alCheck(alGenBuffers(BufferCount, m_buffers)); diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 5e198ad8a..19e450058 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -489,11 +489,11 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) c } // Write the pixels to the texture - unsigned int x = glyph.textureRect.left + padding; - unsigned int y = glyph.textureRect.top + padding; - unsigned int width = glyph.textureRect.width - 2 * padding; - unsigned int height = glyph.textureRect.height - 2 * padding; - page.texture.update(&m_pixelBuffer[0], width, height, x, y); + unsigned int x = glyph.textureRect.left + padding; + unsigned int y = glyph.textureRect.top + padding; + unsigned int w = glyph.textureRect.width - 2 * padding; + unsigned int h = glyph.textureRect.height - 2 * padding; + page.texture.update(&m_pixelBuffer[0], w, h, x, y); } // Delete the FT glyph diff --git a/src/SFML/Graphics/RenderStates.cpp b/src/SFML/Graphics/RenderStates.cpp index f5f2bf9b0..0ef1eddee 100644 --- a/src/SFML/Graphics/RenderStates.cpp +++ b/src/SFML/Graphics/RenderStates.cpp @@ -46,9 +46,9 @@ shader (NULL) //////////////////////////////////////////////////////////// -RenderStates::RenderStates(const Transform& transform) : +RenderStates::RenderStates(const Transform& theTransform) : blendMode(BlendAlpha), -transform(transform), +transform(theTransform), texture (NULL), shader (NULL) { @@ -56,8 +56,8 @@ shader (NULL) //////////////////////////////////////////////////////////// -RenderStates::RenderStates(BlendMode blendMode) : -blendMode(blendMode), +RenderStates::RenderStates(BlendMode theBlendMode) : +blendMode(theBlendMode), transform(), texture (NULL), shader (NULL) @@ -66,32 +66,32 @@ shader (NULL) //////////////////////////////////////////////////////////// -RenderStates::RenderStates(const Texture* texture) : +RenderStates::RenderStates(const Texture* theTexture) : blendMode(BlendAlpha), transform(), -texture (texture), +texture (theTexture), shader (NULL) { } //////////////////////////////////////////////////////////// -RenderStates::RenderStates(const Shader* shader) : +RenderStates::RenderStates(const Shader* theShader) : blendMode(BlendAlpha), transform(), texture (NULL), -shader (shader) +shader (theShader) { } //////////////////////////////////////////////////////////// -RenderStates::RenderStates(BlendMode blendMode, const Transform& transform, - const Texture* texture, const Shader* shader) : -blendMode(blendMode), -transform(transform), -texture (texture), -shader (shader) +RenderStates::RenderStates(BlendMode theBlendMode, const Transform& theTransform, + const Texture* theTexture, const Shader* theShader) : +blendMode(theBlendMode), +transform(theTransform), +texture (theTexture), +shader (theShader) { } diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 8dd262f87..fcd9cca21 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -95,8 +95,8 @@ Texture::~Texture() { ensureGlContext(); - GLuint Texture = static_cast(m_texture); - glCheck(glDeleteTextures(1, &Texture)); + GLuint texture = static_cast(m_texture); + glCheck(glDeleteTextures(1, &texture)); } } diff --git a/src/SFML/Graphics/Vertex.cpp b/src/SFML/Graphics/Vertex.cpp index 89df41389..df017d065 100644 --- a/src/SFML/Graphics/Vertex.cpp +++ b/src/SFML/Graphics/Vertex.cpp @@ -40,8 +40,8 @@ texCoords(0, 0) //////////////////////////////////////////////////////////// -Vertex::Vertex(const Vector2f& position) : -position (position), +Vertex::Vertex(const Vector2f& thePosition) : +position (thePosition), color (255, 255, 255), texCoords(0, 0) { @@ -49,28 +49,28 @@ texCoords(0, 0) //////////////////////////////////////////////////////////// -Vertex::Vertex(const Vector2f& position, const Color& color) : -position (position), -color (color), +Vertex::Vertex(const Vector2f& thePosition, const Color& theColor) : +position (thePosition), +color (theColor), texCoords(0, 0) { } //////////////////////////////////////////////////////////// -Vertex::Vertex(const Vector2f& position, const Vector2f& texCoords) : -position (position), +Vertex::Vertex(const Vector2f& thePosition, const Vector2f& theTexCoords) : +position (thePosition), color (255, 255, 255), -texCoords(texCoords) +texCoords(theTexCoords) { } //////////////////////////////////////////////////////////// -Vertex::Vertex(const Vector2f& position, const Color& color, const Vector2f& texCoords) : -position (position), -color (color), -texCoords(texCoords) +Vertex::Vertex(const Vector2f& thePosition, const Color& theColor, const Vector2f& theTexCoords) : +position (thePosition), +color (theColor), +texCoords(theTexCoords) { } diff --git a/src/SFML/Window/Linux/InputImpl.cpp b/src/SFML/Window/Linux/InputImpl.cpp index b3456f202..5925be535 100644 --- a/src/SFML/Window/Linux/InputImpl.cpp +++ b/src/SFML/Window/Linux/InputImpl.cpp @@ -272,4 +272,4 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ } // namespace priv -} // namespace sf \ No newline at end of file +} // namespace sf diff --git a/src/SFML/Window/Linux/InputImpl.hpp b/src/SFML/Window/Linux/InputImpl.hpp index c61d72361..e1a8a415e 100644 --- a/src/SFML/Window/Linux/InputImpl.hpp +++ b/src/SFML/Window/Linux/InputImpl.hpp @@ -120,4 +120,4 @@ public : } // namespace sf -#endif // SFML_INPUTIMPLX11_HPP \ No newline at end of file +#endif // SFML_INPUTIMPLX11_HPP diff --git a/src/SFML/Window/VideoMode.cpp b/src/SFML/Window/VideoMode.cpp index aaeebe6c6..522901111 100644 --- a/src/SFML/Window/VideoMode.cpp +++ b/src/SFML/Window/VideoMode.cpp @@ -44,10 +44,10 @@ bitsPerPixel(0) //////////////////////////////////////////////////////////// -VideoMode::VideoMode(unsigned int width, unsigned int height, unsigned int bitsPerPixel) : -width (width), -height (height), -bitsPerPixel(bitsPerPixel) +VideoMode::VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel) : +width (modeWidth), +height (modeHeight), +bitsPerPixel(modeBitsPerPixel) { } diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index 5aef6c5a3..7e9ad8b8a 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -42,6 +42,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key) int vkey = 0; switch (key) { + default: vkey = 0; break; case Keyboard::A: vkey = 'A'; break; case Keyboard::B: vkey = 'B'; break; case Keyboard::C: vkey = 'C'; break; @@ -155,6 +156,7 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button) int vkey = 0; switch (button) { + default: vkey = 0; break; case Mouse::Left: vkey = VK_LBUTTON; break; case Mouse::Right: vkey = VK_RBUTTON; break; case Mouse::Middle: vkey = VK_MBUTTON; break;