From 56701628bc0683330d679147aa857f4b92403daa Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 30 Oct 2011 16:21:04 +0100 Subject: [PATCH] win32: fix build --- src/lib/AdapterCommunication.cpp | 6 +++--- src/lib/CECProcessor.cpp | 2 +- src/lib/implementations/CECCommandHandler.cpp | 2 +- src/lib/platform/windows/serialport.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index d3eecf4..7459766 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -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; } diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 38eb5cd..cd8176d 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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) diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 277f756..9320682 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -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); diff --git a/src/lib/platform/windows/serialport.cpp b/src/lib/platform/windows/serialport.cpp index d8f0abe..b028ff3 100644 --- a/src/lib/platform/windows/serialport.cpp +++ b/src/lib/platform/windows/serialport.cpp @@ -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); -- 2.34.1