Fix a type and some type mismatches.

This commit is contained in:
Jonathan Naylor 2019-03-24 12:19:05 +00:00
parent 5be7ff0ce8
commit 3b365f4ce0
4 changed files with 11 additions and 9 deletions

View file

@ -659,7 +659,7 @@ bool CDMRNetwork::writeInterrupt(unsigned int slotNo)
::sprintf((char*)buffer + 11U, ":%u", slotNo);
return write(buffer, ::strlen((char*)buffer));
return write(buffer, 13U);
}
bool CDMRNetwork::wantsBeacon()

View file

@ -159,7 +159,7 @@ bool CDStarNetwork::writePoll(const char* text)
buffer[4] = 0x0A; // Poll with text
unsigned int length = ::strlen(text);
unsigned int length = (unsigned int)::strlen(text);
// Include the nul at the end also
::memcpy(buffer + 5U, text, length + 1U);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2018 by Jonathan Naylor G4KLX
* Copyright (C) 2011-2019 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1274,7 +1274,7 @@ bool CModem::writePOCSAGInfo(unsigned int ric, const std::string& message)
{
assert(m_serial != NULL);
size_t length = message.size();
unsigned int length = (unsigned int)message.size();
unsigned char buffer[250U];
@ -1297,7 +1297,7 @@ bool CModem::writeIPInfo(const std::string& address)
{
assert(m_serial != NULL);
size_t length = address.size();
unsigned int length = (unsigned int)address.size();
unsigned char buffer[25U];
@ -1722,7 +1722,7 @@ bool CModem::sendCWId(const std::string& callsign)
{
assert(m_serial != NULL);
unsigned int length = callsign.length();
unsigned int length = (unsigned int)callsign.length();
if (length > 200U)
length = 200U;

View file

@ -90,7 +90,7 @@ REMOTE_COMMAND CRemoteControl::getCommand()
} else if (m_args.at(0U) == "page" && m_args.size() >= PAGE_ARGS) {
// Page command is in the form of "page <ric> <message>"
m_command = RCD_PAGE;
} else if (m_args.at(0U) == "dmr" && m_args.size() >= DMR_ARGS) {
} else if (m_args.at(0U) == "dmr" && m_args.size() >= DMR_INTERRUPT_ARGS) {
// DMR commands are in the form of "dmr interrupt <0|1|2>"
if (m_args.at(1U) == "interupt")
m_command = RCD_DMR_INTERRUPT;
@ -109,6 +109,8 @@ REMOTE_COMMAND CRemoteControl::getCommand()
unsigned int CRemoteControl::getArgCount() const
{
unsigned int argsSize = (unsigned int)m_args.size();
switch (m_command) {
case RCD_MODE_IDLE:
case RCD_MODE_LOCKOUT:
@ -117,10 +119,10 @@ unsigned int CRemoteControl::getArgCount() const
case RCD_MODE_YSF:
case RCD_MODE_P25:
case RCD_MODE_NXDN:
return m_args.size() - SET_MODE_ARGS;
return argsSize - SET_MODE_ARGS;
case RCD_PAGE:
case RCD_DMR_INTERRUPT:
return m_args.size() - 1U;
return argsSize - 1U;
default:
return 0U;
}