if((funcs>>i)&2)
cmd[4]|=(1<<i);
}
- control.command(string(cmd,5));
+ control.command(string(cmd, 5));
}
void Locomotive::status_reply(Error err, const string &reply)
{
if(err==ERR_NO_ERROR)
{
- if((unsigned char)reply[0]<=1)
+ if(static_cast<unsigned char>(reply[0])<=1)
speed=0;
else
- speed=(unsigned char)reply[0]*2/19+1;
+ speed=static_cast<unsigned char>(reply[0])*2/19+1;
reverse=(reply[1]&0x20)?false:true;
funcs=(reply[1]&0xF)<<1;
if(reply[1]&0x10)