Fixed various minor warnings

This commit is contained in:
Laurent Gomila 2012-03-17 17:00:19 +01:00
parent 78e7dcea38
commit ee7cd94220
18 changed files with 96 additions and 89 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -37,11 +37,11 @@ height(0)
////////////////////////////////////////////////////////////
template <typename T>
Rect<T>::Rect(T left, T top, T width, T height) :
left (left),
top (top),
width (width),
height(height)
Rect<T>::Rect(T rectLeft, T rectTop, T rectWidth, T rectHeight) :
left (rectLeft),
top (rectTop),
width (rectWidth),
height(rectHeight)
{
}

View File

@ -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

View File

@ -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

View File

@ -519,7 +519,7 @@ Out Utf<16>::toUtf32(In begin, In end, Out output)
////////////////////////////////////////////////////////////
template <typename In>
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 <typename Out>
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 <typename In>
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<Uint32>(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<wchar_t>(codepoint)) >= 0)
*output++ = character;

View File

@ -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

View File

@ -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));

View File

@ -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

View File

@ -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)
{
}

View File

@ -95,8 +95,8 @@ Texture::~Texture()
{
ensureGlContext();
GLuint Texture = static_cast<GLuint>(m_texture);
glCheck(glDeleteTextures(1, &Texture));
GLuint texture = static_cast<GLuint>(m_texture);
glCheck(glDeleteTextures(1, &texture));
}
}

View File

@ -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)
{
}

View File

@ -272,4 +272,4 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ
} // namespace priv
} // namespace sf
} // namespace sf

View File

@ -120,4 +120,4 @@ public :
} // namespace sf
#endif // SFML_INPUTIMPLX11_HPP
#endif // SFML_INPUTIMPLX11_HPP

View File

@ -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)
{
}

View File

@ -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;