Fixes for more complaints from cppcheck
This commit is contained in:
parent
6a756df3ed
commit
6d63658c46
examples
@ -431,8 +431,8 @@ static int bridge_net1_worker(int argc, char *argv[])
|
||||
(FAR struct sockaddr*)&fromaddr, &addrlen);
|
||||
|
||||
tmpaddr = ntohl(fromaddr.sin_addr.s_addr);
|
||||
printf("NET1: Received %d bytes from %d.%d.%d.%d:%d\n",
|
||||
nrecvd,
|
||||
printf("NET1: Received %ld bytes from %d.%d.%d.%d:%d\n",
|
||||
(long)nrecvd,
|
||||
tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
|
||||
(tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
|
||||
ntohs(fromaddr.sin_port));
|
||||
@ -460,8 +460,8 @@ static int bridge_net1_worker(int argc, char *argv[])
|
||||
|
||||
/* Send the newly received packet out network 2 */
|
||||
|
||||
printf("NET1: Sending %d bytes on network 2: %d.%d.%d.%d:%d\n",
|
||||
nrecvd,
|
||||
printf("NET1: Sending %ld bytes on network 2: %d.%d.%d.%d:%d\n",
|
||||
(long)nrecvd,
|
||||
CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 24,
|
||||
(CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 16) & 0xff,
|
||||
(CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 8) & 0xff,
|
||||
@ -484,8 +484,8 @@ static int bridge_net1_worker(int argc, char *argv[])
|
||||
}
|
||||
else if (nsent != nrecvd)
|
||||
{
|
||||
fprintf(stderr, "NET1 ERROR: Bad send length: %d Expected: %d\n",
|
||||
nsent, nrecvd);
|
||||
fprintf(stderr, "NET1 ERROR: Bad send length: %d Expected: %ld\n",
|
||||
nsent, (long)nrecvd);
|
||||
goto errout_with_sendsd;
|
||||
}
|
||||
}
|
||||
@ -606,8 +606,8 @@ static int bridge_net2_worker(int argc, char *argv[])
|
||||
(FAR struct sockaddr*)&fromaddr, &addrlen);
|
||||
|
||||
tmpaddr = ntohl(fromaddr.sin_addr.s_addr);
|
||||
printf("NET2: Received %d bytes from %d.%d.%d.%d:%d\n",
|
||||
nrecvd,
|
||||
printf("NET2: Received %ld bytes from %d.%d.%d.%d:%d\n",
|
||||
(long)nrecvd,
|
||||
tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
|
||||
(tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
|
||||
ntohs(fromaddr.sin_port));
|
||||
@ -635,8 +635,8 @@ static int bridge_net2_worker(int argc, char *argv[])
|
||||
|
||||
/* Send the newly received packet out network 1 */
|
||||
|
||||
printf("NET2: Sending %d bytes on network 1: %d.%d.%d.%d:%d\n",
|
||||
nrecvd,
|
||||
printf("NET2: Sending %ld bytes on network 1: %d.%d.%d.%d:%d\n",
|
||||
(long)nrecvd,
|
||||
CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 24,
|
||||
(CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 16) & 0xff,
|
||||
(CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 8) & 0xff,
|
||||
@ -659,8 +659,8 @@ static int bridge_net2_worker(int argc, char *argv[])
|
||||
}
|
||||
else if (nsent != nrecvd)
|
||||
{
|
||||
fprintf(stderr, "NET2 ERROR: Bad send length: %d Expected: %d\n",
|
||||
nsent, nrecvd);
|
||||
fprintf(stderr, "NET2 ERROR: Bad send length: %ld Expected: %ld\n",
|
||||
(long)nsent, (long)nrecvd);
|
||||
goto errout_with_sendsd;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,8 @@ int can_main(int argc, char *argv[])
|
||||
{
|
||||
nmsgs = strtol(argv[1], NULL, 10);
|
||||
}
|
||||
printf("can_main: nmsgs: %d\n", nmsgs);
|
||||
|
||||
printf("can_main: nmsgs: %ld\n", nmsgs);
|
||||
#elif defined(CONFIG_EXAMPLES_CAN_NMSGS)
|
||||
printf("can_main: nmsgs: %d\n", CONFIG_EXAMPLES_CAN_NMSGS);
|
||||
#endif
|
||||
@ -228,7 +229,7 @@ int can_main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_CAN_WRITEONLY
|
||||
printf(" ID: %4d DLC: %d\n", msgid, msgdlc);
|
||||
printf(" ID: %4u DLC: %d\n", msgid, msgdlc);
|
||||
#endif
|
||||
|
||||
/* Read the RX message */
|
||||
@ -245,7 +246,7 @@ int can_main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_EXAMPLES_CAN_READONLY
|
||||
printf(" ID: %4d DLC: %d\n", rxmsg.cm_hdr.ch_id, rxmsg.cm_hdr.ch_dlc);
|
||||
printf(" ID: %4u DLC: %u\n", rxmsg.cm_hdr.ch_id, rxmsg.cm_hdr.ch_dlc);
|
||||
#endif
|
||||
|
||||
/* Verify that the received messages are the same */
|
||||
@ -275,7 +276,7 @@ int can_main(int argc, char *argv[])
|
||||
|
||||
/* Report success */
|
||||
|
||||
printf(" ID: %4d DLC: %d -- OK\n", msgid, msgdlc);
|
||||
printf(" ID: %4u DLC: %d -- OK\n", msgid, msgdlc);
|
||||
#endif
|
||||
|
||||
/* Set up for the next pass */
|
||||
|
@ -12,7 +12,6 @@
|
||||
*
|
||||
* Don't sue me if my code blows up your board and burns down your house
|
||||
*
|
||||
*
|
||||
* This file is the main module for the Arduino CC3000 library.
|
||||
* Your program must call CC3000_Init() before any other API calls.
|
||||
*
|
||||
@ -29,11 +28,6 @@
|
||||
#define TEENSY3 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* I used the Teensy 3.0 to get the Arduino CC3000 library working but the
|
||||
Teensy's hardware SPI and the CC3000's SPI didn't like each other so I had
|
||||
to send the bits manually. For the Uno, Nano, etc. you can probably leave
|
||||
@ -46,14 +40,6 @@
|
||||
#define USE_HARDWARE_SPI true
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// These are the Arduino pins that connect to the CC3000
|
||||
// (in addition to standard SPI pins MOSI, MISO, and SCK)
|
||||
//
|
||||
@ -82,16 +68,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
The timing between setting the CS pin and reading the IRQ pin is very
|
||||
tight on the CC3000, and sometimes the default Arduino digitalRead()
|
||||
@ -135,39 +111,13 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MAC_ADDR_LEN 6
|
||||
|
||||
|
||||
|
||||
#define DISABLE (0)
|
||||
|
||||
#define ENABLE (1)
|
||||
|
||||
//AES key "smartconfigAES16"
|
||||
//const uint8_t smartconfigkey[] = {0x73,0x6d,0x61,0x72,0x74,0x63,0x6f,0x6e,0x66,0x69,0x67,0x41,0x45,0x53,0x31,0x36};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* If you uncomment the line below the library will leave out a lot of the
|
||||
higher level functions but use a lot less memory. From:
|
||||
|
||||
@ -195,23 +145,14 @@
|
||||
|
||||
//#define CC3000_TINY_DRIVER 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern uint8_t asyncNotificationWaiting;
|
||||
extern long lastAsyncEvent;
|
||||
extern uint8_t dhcpIPAddress[];
|
||||
|
||||
|
||||
|
||||
extern void CC3000_Init(void);
|
||||
|
||||
|
||||
extern volatile unsigned long ulSmartConfigFinished,
|
||||
ulCC3000Connected,
|
||||
ulCC3000DHCP,
|
||||
OkToDoShutDown,
|
||||
ulCC3000DHCP_configured;
|
||||
|
||||
extern volatile unsigned long ulSmartConfigFinished;
|
||||
extern volatile unsigned long ulCC3000Connected;
|
||||
extern volatile unsigned long ulCC3000DHCP;
|
||||
extern volatile unsigned long OkToDoShutDown;
|
||||
extern volatile unsigned long ulCC3000DHCP_configured;
|
||||
extern volatile uint8_t ucStopSmartConfig;
|
||||
|
||||
void CC3000_Init(void);
|
||||
|
@ -267,7 +267,7 @@ void stkmon_disp(void)
|
||||
void AsyncEventPrint(void)
|
||||
{
|
||||
printf("\n");
|
||||
switch(lastAsyncEvent)
|
||||
switch (lastAsyncEvent)
|
||||
{
|
||||
printf("CC3000 Async event: Simple config done\n");
|
||||
break;
|
||||
@ -305,7 +305,8 @@ void AsyncEventPrint(void)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("AsyncCallback called with unhandled event! (0x%X)\n", lastAsyncEvent);
|
||||
printf("AsyncCallback called with unhandled event! (0x%lx)\n", \
|
||||
(unsigned long)lastAsyncEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -443,7 +444,7 @@ void Initialize(void)
|
||||
{
|
||||
printf(":");
|
||||
}
|
||||
printf("%X", fancyBuffer[i]);
|
||||
printf("%x", fancyBuffer[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
@ -513,7 +514,8 @@ void StartSmartConfig(void)
|
||||
printf(" Disabling auto-connect policy...");
|
||||
if ((rval = wlan_ioctl_set_connection_policy(DISABLE, DISABLE, DISABLE)) !=0 )
|
||||
{
|
||||
printf(" Failed!\n Setting auto connection policy failed, error: %X\n", rval);
|
||||
printf(" Failed!\n Setting auto connection policy failed, error: %lx\n",
|
||||
(unsigned long)rval);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -523,7 +525,8 @@ void StartSmartConfig(void)
|
||||
|
||||
if ((rval = wlan_ioctl_del_profile(255)) !=0 )
|
||||
{
|
||||
printf(" Failed!\n Deleting all profiles failed, error: %X\n", rval);
|
||||
printf(" Failed!\n Deleting all profiles failed, error: %lx\n",
|
||||
(unsigned long)rval);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -535,7 +538,8 @@ void StartSmartConfig(void)
|
||||
|
||||
if ((rval = wlan_smart_config_set_prefix(simpleConfigPrefix)) !=0 )
|
||||
{
|
||||
printf(" Failed!\n Setting smart config prefix failed, error: %X", rval);
|
||||
printf(" Failed!\n Setting smart config prefix failed, error: %lx",
|
||||
(unsigned long)rval);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -545,7 +549,8 @@ void StartSmartConfig(void)
|
||||
|
||||
if ((rval = wlan_smart_config_start(0)) !=0 )
|
||||
{
|
||||
printf(" Failed!\n Starting smart config failed, error: %X\n", rval);
|
||||
printf(" Failed!\n Starting smart config failed, error: %lx\n",
|
||||
(unsigned long)rval);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -562,7 +567,7 @@ void StartSmartConfig(void)
|
||||
fflush(stdout);
|
||||
if ((rval=wlan_ioctl_set_connection_policy(DISABLE, DISABLE, ENABLE)) !=0 )
|
||||
{
|
||||
printf(" Failed!\n Setting auto connection policy failed, error: %X\n", rval);
|
||||
printf(" Failed!\n Setting auto connection policy failed, error: %x\n", rval);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -857,7 +862,7 @@ void ListAccessPoints(void)
|
||||
if (sr.isValid)
|
||||
{
|
||||
printf(" ");
|
||||
switch(sr.securityMode)
|
||||
switch (sr.securityMode)
|
||||
{
|
||||
case WLAN_SEC_UNSEC: /* 0 */
|
||||
printf("OPEN ");
|
||||
@ -873,7 +878,7 @@ void ListAccessPoints(void)
|
||||
break;
|
||||
}
|
||||
|
||||
sprintf(localB, "%3d ", sr.rssi);
|
||||
sprintf(localB, "%3u ", sr.rssi);
|
||||
printf("%s", localB);
|
||||
memset(localB, 0, 33);
|
||||
memcpy(localB, sr.ssid_name, sr.ssidLength);
|
||||
@ -946,7 +951,7 @@ void ShowInformation(void)
|
||||
{
|
||||
printf(":");
|
||||
}
|
||||
printf("%X", inf.uaMacAddr[i]);
|
||||
printf("%x", inf.uaMacAddr[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
@ -385,7 +385,7 @@ static inline int configdata_rdentry(FAR struct configdata_entrydesc_s *entry)
|
||||
crc = crc32(g_entryimage, entry->len);
|
||||
if (crc != entry->crc)
|
||||
{
|
||||
printf("ERROR: Bad CRC: %d vs %d\n", crc, entry->crc);
|
||||
printf("ERROR: Bad CRC: %u vs %u\n", crc, entry->crc);
|
||||
printf(" Entry id: %04X\n", entry->id);
|
||||
printf(" Entry size: %d\n", entry->len);
|
||||
return ERROR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user