1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-17 10:06:21 +00:00

Updates C-style (bool) casts.

This commit is contained in:
Thomas Harte 2018-09-11 20:37:15 -04:00
parent 1739d18433
commit 36ff2105fb
4 changed files with 4 additions and 4 deletions

View File

@ -278,7 +278,7 @@ void DriveVIA::set_activity_observer(Activity::Observer *observer) {
void SerialPort::set_input(::Commodore::Serial::Line line, ::Commodore::Serial::LineLevel level) { void SerialPort::set_input(::Commodore::Serial::Line line, ::Commodore::Serial::LineLevel level) {
std::shared_ptr<SerialPortVIA> serialPortVIA = serial_port_VIA_.lock(); std::shared_ptr<SerialPortVIA> serialPortVIA = serial_port_VIA_.lock();
if(serialPortVIA) serialPortVIA->set_serial_line_state(line, (bool)level); if(serialPortVIA) serialPortVIA->set_serial_line_state(line, static_cast<bool>(level));
} }
void SerialPort::set_serial_port_via(const std::shared_ptr<SerialPortVIA> &serialPortVIA) { void SerialPort::set_serial_port_via(const std::shared_ptr<SerialPortVIA> &serialPortVIA) {

View File

@ -45,7 +45,7 @@ void Bus::set_line_output_did_change(Line line) {
for(std::weak_ptr<Port> port : ports_) { for(std::weak_ptr<Port> port : ports_) {
std::shared_ptr<Port> locked_port = port.lock(); std::shared_ptr<Port> locked_port = port.lock();
if(locked_port) { if(locked_port) {
new_line_level = (LineLevel)((bool)new_line_level & (bool)locked_port->get_output(line)); new_line_level = (LineLevel)(static_cast<bool>(new_line_level) & static_cast<bool>(locked_port->get_output(line)));
} }
} }

View File

@ -214,7 +214,7 @@ class SerialPort : public ::Commodore::Serial::Port {
/// Receives an input change from the base serial port class, and communicates it to the user-port VIA. /// Receives an input change from the base serial port class, and communicates it to the user-port VIA.
void set_input(::Commodore::Serial::Line line, ::Commodore::Serial::LineLevel level) { void set_input(::Commodore::Serial::Line line, ::Commodore::Serial::LineLevel level) {
std::shared_ptr<UserPortVIA> userPortVIA = user_port_via_.lock(); std::shared_ptr<UserPortVIA> userPortVIA = user_port_via_.lock();
if(userPortVIA) userPortVIA->set_serial_line_state(line, (bool)level); if(userPortVIA) userPortVIA->set_serial_line_state(line, static_cast<bool>(level));
} }
/// Sets the user-port VIA with which this serial port communicates. /// Sets the user-port VIA with which this serial port communicates.

View File

@ -81,7 +81,7 @@ std::shared_ptr<Storage::Tape::Tape> TapePlayer::get_tape() {
} }
bool TapePlayer::has_tape() { bool TapePlayer::has_tape() {
return (bool)tape_; return static_cast<bool>(tape_);
} }
void TapePlayer::get_next_pulse() { void TapePlayer::get_next_pulse() {