Skip to content

Commit

Permalink
Fix Lint and compilation warnings + build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Filoppi committed May 2, 2021
1 parent 6cc4e68 commit 132a86d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ int AddOnStateChangedCallback(StateChangedCallbackFunc callback)

bool RemoveOnStateChangedCallback(int* handle)
{
if (handle && *handle >= 0 && s_on_state_changed_callbacks.size() > *handle)
if (handle && *handle >= 0 && s_on_state_changed_callbacks.size() > static_cast<size_t>(*handle))
{
s_on_state_changed_callbacks[*handle] = StateChangedCallbackFunc();
*handle = -1;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/FreeLookManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ ControllerEmu::ControlGroup* GetInputGroup(int pad_num, FreeLookGroup group)

void UpdateInput()
{
for (size_t i = 0; i < s_config.GetControllerCount(); i++)
for (int i = 0; i < s_config.GetControllerCount(); i++)
{
static_cast<FreeLookController*>(s_config.GetController(int(i)))->Update();
static_cast<FreeLookController*>(s_config.GetController(i))->Update();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ void Attachments::AddAttachment(std::unique_ptr<EmulatedController> att)

u32 Attachments::GetSelectedAttachment() const
{
// This is originally an int, treat it as such
const int value = m_selection_value.GetValue();

if (value > 0 && value < m_attachments.size())
if (value > 0 && value < static_cast<int>(m_attachments.size()))
return u32(value);

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
// nothing needed
#endif
#ifdef CIFACE_USE_OSX
if (m_wsi.type == WindowSystemType::MacOS)
ciface::OSX::Init(wsi.render_window);
// nothing needed for Quartz
// nothing needed for OSX and Quartz
#endif
#ifdef CIFACE_USE_SDL
ciface::SDL::Init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static void HotplugThreadFunc()
{
using namespace std::chrono;
using namespace std::chrono_literals;

const auto now = SteadyClock::now();
if (now >= s_next_listports_time)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ Device::Device(std::unique_ptr<WiimoteReal::Wiimote> wiimote) : m_wiimote(std::m
AddInput(new UndetectableAnalogInput<float>(&m_battery, "Battery", 1.f));
AddInput(new UndetectableAnalogInput<WiimoteEmu::ExtensionNumber>(
&m_extension_number_input, "Attached Extension", WiimoteEmu::ExtensionNumber(1)));
AddInput(new UndetectableAnalogInput<bool>(
&m_mplus_attached_input, "Attached MotionPlus", 1));
AddInput(new UndetectableAnalogInput<bool>(&m_mplus_attached_input, "Attached MotionPlus", 1));

AddOutput(new Motor(&m_rumble_level));
}
Expand Down

0 comments on commit 132a86d

Please sign in to comment.