Wsign-compare: Fixed all sign compare warnings in src

This commit addresses all warnings emitted from -Wunused-function
in the C++ src.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2016-11-02 22:26:41 -07:00
parent 1dd5cbb445
commit ae9b8fb13e
15 changed files with 28 additions and 27 deletions

View File

@ -84,7 +84,7 @@ string SM130::sendCommand(CMD_T cmd, string data)
// now the data if any
if (!data.empty())
{
for (int i=0; i<data.size(); i++)
for (size_t i=0; i<data.size(); i++)
{
command.push_back(data[i]);
cksum += (uint8_t)data[i];
@ -129,7 +129,7 @@ string SM130::sendCommand(CMD_T cmd, string data)
}
// check size - 2 header bytes + len + cksum.
if (resp.size() != ((uint8_t)resp[2] + 2 + 1 + 1))
if (resp.size() != static_cast<size_t>((uint8_t)resp[2] + 2 + 1 + 1))
{
cerr << __FUNCTION__ << ": invalid packet length, expected "
<< int((uint8_t)resp[2] + 2 + 1 + 1)
@ -139,7 +139,7 @@ string SM130::sendCommand(CMD_T cmd, string data)
// verify the cksum
cksum = 0;
for (int i=2; i<(resp.size() - 1); i++)
for (size_t i=2; i<(resp.size() - 1); i++)
cksum += (uint8_t)resp[i];
if (cksum != (uint8_t)resp[resp.size() - 1])