Skip to content

Commit

Permalink
Fix conversion and other warnings, mainly on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Apr 19, 2021
1 parent 2c8ff29 commit c400952
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/SFML/System/Utf.inl
Expand Up @@ -675,7 +675,7 @@ Uint32 Utf<32>::decodeWide(In input)
// In both cases, a simple copy is enough (UCS-2 is a subset of UCS-4,
// and UCS-4 *is* UTF-32).

return input;
return static_cast<Uint32>(input);
}


Expand Down
2 changes: 1 addition & 1 deletion src/SFML/System/Err.cpp
Expand Up @@ -83,7 +83,7 @@ class DefaultErrStreamBuf : public std::streambuf
if (pbase() != pptr())
{
// Print the contents of the write buffer into the standard error output
std::size_t size = static_cast<int>(pptr() - pbase());
std::size_t size = static_cast<std::size_t>(pptr() - pbase());
fwrite(pbase(), 1, size, stderr);

// Reset the pointer position to the beginning of the write buffer
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/Window/Win32/CursorImpl.cpp
Expand Up @@ -140,7 +140,7 @@ bool CursorImpl::loadFromSystem(Cursor::Type type)
{
release();

LPCTSTR shape;
LPCTSTR shape = NULL;
switch (type)
{
case Cursor::Arrow: shape = IDC_ARROW; break;
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/Window/Win32/InputImpl.cpp
Expand Up @@ -157,7 +157,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)


////////////////////////////////////////////////////////////
void InputImpl::setVirtualKeyboardVisible(bool visible)
void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)
{
// Not applicable
}
Expand Down
10 changes: 5 additions & 5 deletions src/SFML/Window/Win32/JoystickImpl.cpp
Expand Up @@ -523,12 +523,12 @@ bool JoystickImpl::openDInput(unsigned int index)
m_buffered = false;

// Search for a joystick with the given index in the connected list
for (std::vector<JoystickRecord>::iterator i = joystickList.begin(); i != joystickList.end(); ++i)
for (std::vector<JoystickRecord>::iterator it = joystickList.begin(); it != joystickList.end(); ++it)
{
if (i->index == index)
if (it->index == index)
{
// Create device
HRESULT result = directInput->CreateDevice(i->guid, &m_device, NULL);
HRESULT result = directInput->CreateDevice(it->guid, &m_device, NULL);

if (FAILED(result))
{
Expand Down Expand Up @@ -905,7 +905,7 @@ JoystickState JoystickImpl::updateDInputBuffered()
// Get the current state of each axis
for (int j = 0; j < Joystick::AxisCount; ++j)
{
if (m_axes[j] == events[i].dwOfs)
if (m_axes[j] == static_cast<int>(events[i].dwOfs))
{
if ((j == Joystick::PovX) || (j == Joystick::PovY))
{
Expand Down Expand Up @@ -941,7 +941,7 @@ JoystickState JoystickImpl::updateDInputBuffered()
// Get the current state of each button
for (int j = 0; j < Joystick::ButtonCount; ++j)
{
if (m_buttons[j] == events[i].dwOfs)
if (m_buttons[j] == static_cast<int>(events[i].dwOfs))
m_state.buttons[j] = (events[i].dwData != 0);
}
}
Expand Down

0 comments on commit c400952

Please sign in to comment.