From: Lars Op den Kamp Date: Thu, 10 Nov 2011 19:34:16 +0000 (+0100) Subject: cec: fixed some int conversions that made the win32 build because it's configured... X-Git-Tag: upstream/2.2.0~1^2~65 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f2198ab5e1803596b15174da8dce022bae5d8282;p=deb_libcec.git cec: fixed some int conversions that made the win32 build because it's configured to stop building on compiler warnings --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 3b66cd5..3aef595 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -161,7 +161,7 @@ bool CCECProcessor::TryLogicalAddress(cec_logical_address address, unsigned int m_logicalAddresses.set(address); // TODO - m_busDevices[address]->SetPhysicalAddress(CEC_DEFAULT_PHYSICAL_ADDRESS + (iIndex * 0x100)); + m_busDevices[address]->SetPhysicalAddress((uint16_t)CEC_DEFAULT_PHYSICAL_ADDRESS + ((uint16_t)iIndex * 0x100)); return true; } @@ -268,7 +268,7 @@ void *CCECProcessor::Process(void) else if (m_communication->IsOpen() && m_communication->Read(msg, 50)) { m_controller->AddLog(msg.is_error() ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString()); - if ((bParseFrame = (ParseMessage(msg) && !IsStopped()))) + if ((bParseFrame = (ParseMessage(msg) && !IsStopped())) == true) command = m_currentframe; } } @@ -301,7 +301,7 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE if (type != CEC_DEVICE_TYPE_RESERVED) { - for (unsigned int iPtr = 0; iPtr < 16; iPtr++) + for (uint8_t iPtr = 0; iPtr < 16; iPtr++) { if (m_logicalAddresses[iPtr] && m_busDevices[iPtr]->m_type == type) { diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 5123ef0..d83ccb2 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -423,7 +423,7 @@ bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest) cec_command command; cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_CEC_VERSION); - command.parameters.push_back(m_cecVersion); + command.parameters.push_back((uint8_t)m_cecVersion); return m_processor->Transmit(command); } diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 94aaeaa..1725639 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -339,7 +339,7 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) { if (command.parameters.size >= 2) { - int streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); + uint16_t streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CStdString strLog; strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, streamaddr); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); @@ -421,7 +421,7 @@ unsigned int CCECCommandHandler::GetMyDevices(vector &devices) unsigned int iReturn(0); cec_logical_addresses addresses = m_busDevice->GetProcessor()->GetLogicalAddresses(); - for (unsigned int iPtr = 0; iPtr < 16; iPtr++) + for (uint8_t iPtr = 0; iPtr < 16; iPtr++) { if (addresses[iPtr]) {