cec: push_escaped should only accept uint8_t
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 12 Nov 2011 00:33:15 +0000 (01:33 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 12 Nov 2011 00:35:52 +0000 (01:35 +0100)
src/lib/AdapterCommunication.cpp
src/lib/AdapterCommunication.h

index 9b4490b7316dbf4d386bc2ac0ce3b51e0054f3b9..1aaf3c8573c4efac9784650b28f939006036177b 100644 (file)
@@ -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) :
index 31de379e1350ac131529590e095ae2dd7bac2ee6..d140a1b5a0f0b8c563d3bdc91c832dc4488454f3 100644 (file)
@@ -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;