Device *Device::find_subdevice(const string &n)
{
- return (n==name ? this : 0);
+ return (n==name ? this : nullptr);
}
Device *Device::find_subdevice(DeviceType t, unsigned i)
{
- return (t==type && i==0 ? this : 0);
+ return (t==type && i==0 ? this : nullptr);
}
bool Device::get_button_state(unsigned btn) const
return axes[axis];
}
-std::string Device::get_button_name(unsigned btn) const
+string Device::get_button_name(unsigned btn) const
{
return format("Button %d", btn);
}
-std::string Device::get_axis_name(unsigned axis) const
+string Device::get_axis_name(unsigned axis) const
{
return format("Axis %d", axis);
}
if(btn>=buttons.size())
buttons.resize(btn+1, false);
- if(state!=buttons[btn])
+ if(state!=static_cast<bool>(buttons[btn]))
{
buttons[btn] = state;