Fix conversion and other warnings, mainly on Windows

This commit is contained in:
Jan Haller 2021-04-19 17:12:58 +02:00 committed by Lukas Dürrenberger
parent 761d9d81d0
commit 5bed29dd19
5 changed files with 9 additions and 9 deletions

View File

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

View File

@ -83,7 +83,7 @@ private:
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

View File

@ -142,7 +142,7 @@ bool CursorImpl::loadFromSystem(Cursor::Type type)
{
release();
LPCTSTR shape;
LPCTSTR shape = NULL;
switch (type)
{
case Cursor::Arrow: shape = IDC_ARROW; break;

View File

@ -157,7 +157,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
////////////////////////////////////////////////////////////
void InputImpl::setVirtualKeyboardVisible(bool visible)
void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)
{
// Not applicable
}

View File

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