win32: fix build
authorLars Op den Kamp <lars.opdenkamp@pulse-eight.com>
Sun, 30 Oct 2011 15:21:04 +0000 (16:21 +0100)
committerLars Op den Kamp <lars.opdenkamp@pulse-eight.com>
Sun, 30 Oct 2011 15:21:04 +0000 (16:21 +0100)
src/lib/AdapterCommunication.cpp
src/lib/CECProcessor.cpp
src/lib/implementations/CECCommandHandler.cpp
src/lib/platform/windows/serialport.cpp

index d3eecf45ea7f1045ef466ba38e1291f71f0186ca..74597665cfb98910423ea35f01562adce47c2dc6 100644 (file)
@@ -93,10 +93,10 @@ void CCECAdapterMessage::push_escaped(int16_t byte)
   if (byte >= MSGESC && byte != MSGSTART)
   {
     push_back(MSGESC);
-    push_back(byte - ESCOFFSET);
+    push_back((uint8_t) (byte - ESCOFFSET));
   }
   else
-    push_back(byte);
+    push_back((uint8_t) byte);
 }
 
 CAdapterCommunication::CAdapterCommunication(CLibCEC *controller) :
@@ -260,7 +260,7 @@ bool CAdapterCommunication::Read(CCECAdapterMessage &msg, uint32_t iTimeout)
     uint8_t buf = 0;
     if (!m_inBuffer.Pop(buf))
     {
-      if (!m_rcvCondition.Wait(&m_mutex, iTarget - iNow))
+      if (!m_rcvCondition.Wait(&m_mutex, (uint32_t) (iTarget - iNow)))
         return false;
     }
 
index 38eb5cdce7cd55631c2e44f7ef7487ae344b1e2a..cd8176df7a92551fe2f01b653539cd9eb20c34d9 100644 (file)
@@ -210,7 +210,7 @@ cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
 bool CCECProcessor::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
 {
   *language = m_busDevices[iAddress]->GetMenuLanguage();
-  return (strcmp(language->language, "???"));
+  return (strcmp(language->language, "???") == 0);
 }
 
 uint64_t CCECProcessor::GetDeviceVendorId(cec_logical_address iAddress)
index 277f75624674b55d74156bd339e40f2a6bc8a616..932068254acd71e8b6864646c58a7c05a3ca8c85 100644 (file)
@@ -281,7 +281,7 @@ bool CCECCommandHandler::HandleSetMenuLanguage(const cec_command &command)
     {
       cec_menu_language language;
       language.device = command.initiator;
-      for (unsigned int iPtr = 0; iPtr < 4; iPtr++)
+      for (uint8_t iPtr = 0; iPtr < 4; iPtr++)
         language.language[iPtr] = command.parameters[iPtr];
       language.language[3] = 0;
       device->SetMenuLanguage(language);
index d8f0abe63979f1b55254cbacfdd32c7f4f4a6a4e..b028ff32e5e8810f5bb01bcb70cf8aa2810722db 100644 (file)
@@ -166,14 +166,14 @@ void CSerialPort::Close(void)
   }
 }
 
-int8_t CSerialPort::Write(const CCECAdapterMessage &data)
+int8_t CSerialPort::Write(CCECAdapterMessagePtr data)
 {
   CLockObject lock(&m_mutex);
   DWORD iBytesWritten = 0;
   if (!m_bIsOpen)
     return -1;
 
-  if (!WriteFile(m_handle, data.packet.data, data.size(), &iBytesWritten, NULL))
+  if (!WriteFile(m_handle, data->packet.data, data->size(), &iBytesWritten, NULL))
   {
     m_error = "Error while writing to COM port";
     FormatWindowsError(GetLastError(), m_error);