Networking: Fix some ARMC6 warnings

Some int-versus-long and signed-versus-unsigned format string
mismatches, and missing `class` keyword.
pull/10469/head
Kevin Bracey 2019-04-12 17:22:25 +03:00 committed by adbridge
parent 96c0d8fb64
commit c5bfb6afc2
8 changed files with 16 additions and 12 deletions

View File

@ -15,8 +15,12 @@
*/ */
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT) #if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT)
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <string.h> #include <string.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "ESP8266.h" #include "ESP8266.h"
@ -601,7 +605,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
set_timeout(ESP8266_SEND_TIMEOUT); set_timeout(ESP8266_SEND_TIMEOUT);
_busy = false; _busy = false;
_error = false; _error = false;
if (!_parser.send("AT+CIPSEND=%d,%lu", id, amount)) { if (!_parser.send("AT+CIPSEND=%d,%" PRIu32, id, amount)) {
tr_debug("ESP8266::send(): AT+CIPSEND failed"); tr_debug("ESP8266::send(): AT+CIPSEND failed");
goto END; goto END;
} }
@ -734,7 +738,7 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t
amount = amount > 2048 ? 2048 : amount; amount = amount > 2048 ? 2048 : amount;
// NOTE: documentation v3.0 says '+CIPRECVDATA:<data_len>,' but it's not how the FW responds... // NOTE: documentation v3.0 says '+CIPRECVDATA:<data_len>,' but it's not how the FW responds...
bool done = _parser.send("AT+CIPRECVDATA=%d,%lu", id, amount) bool done = _parser.send("AT+CIPRECVDATA=%d,%" PRIu32, id, amount)
&& _parser.recv("OK\n"); && _parser.recv("OK\n");
_sock_i[id].tcp_data = NULL; _sock_i[id].tcp_data = NULL;
@ -1052,7 +1056,7 @@ void ESP8266::_oob_tcp_data_hdlr()
MBED_ASSERT(_sock_active_id >= 0 && _sock_active_id < 5); MBED_ASSERT(_sock_active_id >= 0 && _sock_active_id < 5);
if (!_parser.recv("%ld:", &len)) { if (!_parser.recv("%" SCNd32 ":", &len)) {
return; return;
} }

View File

@ -126,7 +126,7 @@ public:
virtual char *get_gateway(char *buf, nsapi_size_t buflen); virtual char *get_gateway(char *buf, nsapi_size_t buflen);
private: private:
friend LWIP; friend class LWIP;
Interface(); Interface();

View File

@ -30,7 +30,7 @@ public:
virtual nsapi_error_t bringdown(); virtual nsapi_error_t bringdown();
private: private:
friend Nanostack; friend class Nanostack;
friend class NanostackEthernetInterface; friend class NanostackEthernetInterface;
EthernetInterface(NanostackEthernetPhy &phy) : Interface(phy) {} EthernetInterface(NanostackEthernetPhy &phy) : Interface(phy) {}
nsapi_error_t initialize(); nsapi_error_t initialize();

View File

@ -33,7 +33,7 @@ public:
virtual nsapi_error_t bringdown(); virtual nsapi_error_t bringdown();
virtual char *get_gateway(char *buf, nsapi_size_t buflen); virtual char *get_gateway(char *buf, nsapi_size_t buflen);
friend Nanostack; friend class Nanostack;
friend class ::LoWPANNDInterface; friend class ::LoWPANNDInterface;
private: private:
LoWPANNDInterface(NanostackRfPhy &phy) : MeshInterface(phy) { } LoWPANNDInterface(NanostackRfPhy &phy) : MeshInterface(phy) { }

View File

@ -30,7 +30,7 @@ public:
nsapi_ip_stack_t stack = IPV6_STACK, nsapi_ip_stack_t stack = IPV6_STACK,
bool blocking = true); bool blocking = true);
virtual nsapi_error_t bringdown(); virtual nsapi_error_t bringdown();
friend Nanostack; friend class Nanostack;
friend class ::ThreadInterface; friend class ::ThreadInterface;
private: private:
ThreadInterface(NanostackRfPhy &phy) : MeshInterface(phy), eui64_set(false) { } ThreadInterface(NanostackRfPhy &phy) : MeshInterface(phy), eui64_set(false) { }

View File

@ -33,7 +33,7 @@ public:
virtual nsapi_error_t bringdown(); virtual nsapi_error_t bringdown();
virtual char *get_gateway(char *buf, nsapi_size_t buflen); virtual char *get_gateway(char *buf, nsapi_size_t buflen);
friend Nanostack; friend class Nanostack;
friend class ::WisunInterface; friend class ::WisunInterface;
private: private:
WisunInterface(NanostackRfPhy &phy) : MeshInterface(phy) { } WisunInterface(NanostackRfPhy &phy) : MeshInterface(phy) { }

View File

@ -103,9 +103,9 @@ static void initialize_channel_list(void)
arm_nwk_set_channel_list(tasklet_data_ptr->network_interface_id, &tasklet_data_ptr->channel_list); arm_nwk_set_channel_list(tasklet_data_ptr->network_interface_id, &tasklet_data_ptr->channel_list);
tr_debug("Channel: %ld", channel); tr_debug("Channel: %" PRIu32, channel);
tr_debug("Channel page: %d", tasklet_data_ptr->channel_list.channel_page); tr_debug("Channel page: %d", tasklet_data_ptr->channel_list.channel_page);
tr_debug("Channel mask: 0x%.8lx", tasklet_data_ptr->channel_list.channel_mask[word_index]); tr_debug("Channel mask: 0x%.8" PRIx32, tasklet_data_ptr->channel_list.channel_mask[word_index]);
} }
/* /*

View File

@ -319,7 +319,7 @@ void thread_tasklet_configure_and_connect_to_network(void)
thread_tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK; thread_tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK;
TRACE_DETAIL("channel page: %d", thread_tasklet_data_ptr->channel_list.channel_page); TRACE_DETAIL("channel page: %d", thread_tasklet_data_ptr->channel_list.channel_page);
TRACE_DETAIL("channel mask: 0x%.8lx", thread_tasklet_data_ptr->channel_list.channel_mask[0]); TRACE_DETAIL("channel mask: 0x%.8" PRIx32, thread_tasklet_data_ptr->channel_list.channel_mask[0]);
// PSKd // PSKd
const char PSKd[] = MBED_CONF_MBED_MESH_API_THREAD_PSKD; const char PSKd[] = MBED_CONF_MBED_MESH_API_THREAD_PSKD;