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
if(btn>=buttons.size())
buttons.resize(btn+1, false);
- if(state!=buttons[btn])
+ if(state!=static_cast<bool>(buttons[btn]))
{
buttons[btn] = state;