Resolved various compiler warnings

This should make Jenkins happy.
This commit is contained in:
Patrick Fallberg
2015-08-09 10:06:09 +02:00
parent 7f9fd843de
commit af6e5d3019
41 changed files with 123 additions and 87 deletions
+5 -3
View File
@@ -61,6 +61,7 @@ void PN532::begin()
/**************************************************************************/
void PN532::PrintHex(const uint8_t *data, const uint32_t numBytes)
{
(void)data;
for (uint8_t i = 0; i < numBytes; i++) {
DMSG("0x");
DMSG_HEX(data[i]);
@@ -86,11 +87,11 @@ void PN532::PrintHexChar(const uint8_t *data, const uint32_t numBytes)
}
DMSG(" ");
for (uint8_t i = 0; i < numBytes; i++) {
char c = data[i];
uint8_t c = data[i];
if (c <= 0x1f || c > 0x7f) {
DMSG('.');
} else {
DMSG(c);
DMSG((char)c);
}
}
@@ -548,7 +549,7 @@ uint8_t PN532::mifareclassic_WriteNDEFURI (uint8_t sectorNumber, uint8_t uriIden
// in NDEF records
// Setup the sector buffer (w/pre-formatted TLV wrapper and NDEF message)
uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, len + 5, 0xD1, 0x01, len + 1, 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, (uint8_t)(len + 5), 0xD1, 0x01, (uint8_t)(len + 1), 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer2[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer3[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer4[16] = {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7, 0x7F, 0x07, 0x88, 0x40, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
@@ -653,6 +654,7 @@ uint8_t PN532::mifareultralight_ReadPage (uint8_t page, uint8_t *buffer)
bool PN532::inDataExchange(uint8_t *send, uint8_t sendLength, uint8_t *response, uint8_t *responseLength)
{
uint8_t i;
(void)i;
pn532_packetbuffer[0] = 0x40; // PN532_COMMAND_INDATAEXCHANGE;
pn532_packetbuffer[1] = inListedTag;
+4 -1
View File
@@ -37,6 +37,7 @@ int8_t LLCP::activate(uint16_t timeout)
int8_t LLCP::waitForConnection(uint16_t timeout)
{
uint8_t type;
(void)timeout;
sequence = 0;
@@ -76,6 +77,7 @@ int8_t LLCP::waitForConnection(uint16_t timeout)
int8_t LLCP::waitForDisconnection(uint16_t timeout)
{
uint8_t type;
(void)timeout;
// Get DISC PDU
DMSG("wait for a DISC PDU\n");
@@ -113,6 +115,7 @@ int8_t LLCP::waitForDisconnection(uint16_t timeout)
int8_t LLCP::connect(uint16_t timeout)
{
uint8_t type;
(void)timeout;
sequence = 0;
@@ -165,6 +168,7 @@ int8_t LLCP::connect(uint16_t timeout)
int8_t LLCP::disconnect(uint16_t timeout)
{
uint8_t type;
(void)timeout;
// try to get a SYMM PDU
if (2 > link.read(headerBuf, headerBufLen)) {
@@ -207,7 +211,6 @@ int8_t LLCP::disconnect(uint16_t timeout)
bool LLCP::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
{
uint8_t type;
uint8_t buf[3];
if (2 != link.read(buf, sizeof(buf))) {
+1 -1
View File
@@ -79,7 +79,7 @@ int16_t SNEP::read(uint8_t *buf, uint8_t len, uint16_t timeout)
}
// check message's length
uint32_t length = (buf[2] << 24) + (buf[3] << 16) + (buf[4] << 8) + buf[5];
uint32_t length = ((uint32_t)buf[2] << 24) + ((uint32_t)buf[3] << 16) + (buf[4] << 8) + buf[5];
// length should not be more than 244 (header + body < 255, header = 6 + 3 + 2)
if (length > (status - 6)) {
DMSG("The SNEP message is too large\n");