mirror of https://github.com/stella-emu/stella.git
Eliminate conversion to pointer when it's not necessary.
This commit is contained in:
parent
ab9f060c04
commit
91148d299a
|
@ -107,7 +107,7 @@ void AtariVox::clockDataIn(bool value)
|
|||
else
|
||||
{
|
||||
uInt8 data = ((myShiftRegister >> 1) & 0xff);
|
||||
mySerialPort->writeByte(&data);
|
||||
mySerialPort->writeByte(data);
|
||||
}
|
||||
myShiftRegister = 0;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class SerialPort
|
|||
@param data Destination for the byte read from the port
|
||||
@return True if a byte was read, else false
|
||||
*/
|
||||
virtual bool readByte(uInt8* data) { return false; }
|
||||
virtual bool readByte(uInt8& data) { return false; }
|
||||
|
||||
/**
|
||||
Write a byte to the serial port.
|
||||
|
@ -55,7 +55,7 @@ class SerialPort
|
|||
@param data The byte to write to the port
|
||||
@return True if a byte was written, else false
|
||||
*/
|
||||
virtual bool writeByte(const uInt8* data) { return false; }
|
||||
virtual bool writeByte(uInt8 data) { return false; }
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
|
@ -71,12 +71,12 @@ void SerialPortMACOS::closePort()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool SerialPortMACOS::writeByte(const uInt8* data)
|
||||
bool SerialPortMACOS::writeByte(uInt8 data)
|
||||
{
|
||||
if(myHandle)
|
||||
{
|
||||
// cerr << "SerialPortMACOS::writeByte " << (int)(*data) << endl;
|
||||
return write(myHandle, data, 1) == 1;
|
||||
// cerr << "SerialPortMACOS::writeByte " << int(data) << endl;
|
||||
return write(myHandle, &data, 1) == 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class SerialPortMACOS : public SerialPort
|
|||
@param data The byte to write to the port
|
||||
@return True if a byte was written, else false
|
||||
*/
|
||||
bool writeByte(const uInt8* data) override;
|
||||
bool writeByte(uInt8 data) override;
|
||||
|
||||
private:
|
||||
// File descriptor for serial connection
|
||||
|
|
|
@ -69,12 +69,12 @@ void SerialPortUNIX::closePort()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool SerialPortUNIX::writeByte(const uInt8* data)
|
||||
bool SerialPortUNIX::writeByte(uInt8 data)
|
||||
{
|
||||
if(myHandle)
|
||||
{
|
||||
// cerr << "SerialPortUNIX::writeByte " << (int)(*data) << endl;
|
||||
return write(myHandle, data, 1) == 1;
|
||||
// cerr << "SerialPortUNIX::writeByte " << int(data) << endl;
|
||||
return write(myHandle, &data, 1) == 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class SerialPortUNIX : public SerialPort
|
|||
@param data The byte to write to the port
|
||||
@return True if a byte was written, else false
|
||||
*/
|
||||
bool writeByte(const uInt8* data) override;
|
||||
bool writeByte(uInt8 data) override;
|
||||
|
||||
private:
|
||||
// File descriptor for serial connection
|
||||
|
|
|
@ -76,12 +76,12 @@ void SerialPortWINDOWS::closePort()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool SerialPortWINDOWS::writeByte(const uInt8* data)
|
||||
bool SerialPortWINDOWS::writeByte(uInt8 data)
|
||||
{
|
||||
if(myHandle)
|
||||
{
|
||||
DWORD written;
|
||||
return WriteFile(myHandle, data, 1, &written, 0) == TRUE;
|
||||
return WriteFile(myHandle, &data, 1, &written, 0) == TRUE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class SerialPortWINDOWS : public SerialPort
|
|||
@param data The byte to write to the port
|
||||
@return True if a byte was written, else false
|
||||
*/
|
||||
bool writeByte(const uInt8* data) override;
|
||||
bool writeByte(uInt8 data) override;
|
||||
|
||||
private:
|
||||
// Handle to serial port
|
||||
|
|
Loading…
Reference in New Issue