From c7903c025a521e18ce9e33b17679d14640365eaa Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sat, 12 Nov 2011 01:33:15 +0100 Subject: [PATCH] cec: push_escaped should only accept uint8_t --- src/lib/AdapterCommunication.cpp | 6 +++--- src/lib/AdapterCommunication.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 9b4490b..1aaf3c8 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -227,15 +227,15 @@ bool CCECAdapterMessage::is_error(void) const code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE); } -void CCECAdapterMessage::push_escaped(int16_t byte) +void CCECAdapterMessage::push_escaped(uint8_t byte) { if (byte >= MSGESC && byte != MSGSTART) { push_back(MSGESC); - push_back((uint8_t) (byte - ESCOFFSET)); + push_back(byte - ESCOFFSET); } else - push_back((uint8_t) byte); + push_back(byte); } CAdapterCommunication::CAdapterCommunication(CLibCEC *controller) : diff --git a/src/lib/AdapterCommunication.h b/src/lib/AdapterCommunication.h index 31de379..d140a1b 100644 --- a/src/lib/AdapterCommunication.h +++ b/src/lib/AdapterCommunication.h @@ -71,7 +71,7 @@ namespace CEC cec_logical_address initiator(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) >> 4) : CECDEVICE_UNKNOWN; }; cec_logical_address destination(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) & 0xF) : CECDEVICE_UNKNOWN; }; bool is_error(void) const; - void push_escaped(int16_t byte); + void push_escaped(uint8_t byte); cec_datapacket packet; cec_adapter_message_state state; -- 2.34.1