Fixed a number of compiler warnings

This commit is contained in:
Simon Duquennoy 2015-05-06 16:56:19 +02:00
parent 2059be3a43
commit 4a93f5148d
8 changed files with 26 additions and 25 deletions

View File

@ -73,13 +73,13 @@ static unsigned char ascii2petscii[128] = {
};
static unsigned int i;
static unsigned char *ptr;
static char *ptr;
/*-----------------------------------------------------------------------------------*/
void
petsciiconv_toascii(char *buf, unsigned int len)
{
static char c;
char c;
ptr = buf;
for(i = len; i > 0; --i) {

View File

@ -787,7 +787,7 @@ newdata(void)
static int8_t i;
register struct namemap *namemapptr;
register struct namemap *namemapptr = NULL;
struct dns_answer *ans;

View File

@ -103,7 +103,7 @@ slipdev_send(void)
ptr = &uip_buf[UIP_LLH_LEN];
for(i = 0; i < uip_len; ++i) {
if(i == UIP_TCPIP_HLEN) {
ptr = (char *)uip_appdata;
ptr = (uint8_t *)uip_appdata;
}
c = *ptr++;
switch(c) {

View File

@ -56,8 +56,10 @@ typedef struct uip_nameserver_record {
uint32_t lifetime;
} uip_nameserver_record;
#if UIP_NAMESERVER_POOL_SIZE > 1
/** \brief Initialization flag */
static uint8_t initialized = 0;
#endif
/** \name List and memory block
* @{

View File

@ -116,17 +116,20 @@ void uip_log(char *msg);
#define UIP_ND6_OPT_RDNSS_BUF ((uip_nd6_opt_dns *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
/** @} */
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
static uint8_t nd6_opt_offset; /** Offset from the end of the icmpv6 header to the option in uip_buf*/
static uint8_t *nd6_opt_llao; /** Pointer to llao option in uip_buf */
static uip_ds6_nbr_t *nbr; /** Pointer to a nbr cache entry*/
static uip_ds6_defrt_t *defrt; /** Pointer to a router list entry */
static uip_ds6_addr_t *addr; /** Pointer to an interface address */
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
#if !UIP_CONF_ROUTER // TBD see if we move it to ra_input
static uip_nd6_opt_prefix_info *nd6_opt_prefix_info; /** Pointer to prefix information option in uip_buf */
static uip_ipaddr_t ipaddr;
static uip_ds6_prefix_t *prefix; /** Pointer to a prefix list entry */
#endif
static uip_ds6_nbr_t *nbr; /** Pointer to a nbr cache entry*/
static uip_ds6_defrt_t *defrt; /** Pointer to a router list entry */
static uip_ds6_addr_t *addr; /** Pointer to an interface address */
/*------------------------------------------------------------------*/
/* create a llao */
static void
@ -141,7 +144,7 @@ create_llao(uint8_t *llao, uint8_t type) {
/*------------------------------------------------------------------*/
#if UIP_ND6_SEND_NA
static void
ns_input(void)
{
@ -321,7 +324,7 @@ discard:
uip_len = 0;
return;
}
#endif /* UIP_ND6_SEND_NA */
/*------------------------------------------------------------------*/
@ -387,6 +390,7 @@ uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt)
PRINTF("\n");
return;
}
#if UIP_ND6_SEND_NA
/*------------------------------------------------------------------*/
/**
* Neighbor Advertisement Processing
@ -556,7 +560,7 @@ discard:
uip_len = 0;
return;
}
#endif /* UIP_ND6_SEND_NA */
#if UIP_CONF_ROUTER
#if UIP_ND6_SEND_RA
@ -859,7 +863,7 @@ ra_input(void)
(uip_lladdr_t *)&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
1, NBR_STALE);
} else {
uip_lladdr_t *lladdr = uip_ds6_nbr_get_ll(nbr);
uip_lladdr_t *lladdr = (uip_lladdr_t *)uip_ds6_nbr_get_ll(nbr);
if(nbr->state == NBR_INCOMPLETE) {
nbr->state = NBR_STALE;
}

View File

@ -341,7 +341,6 @@ powercycle(struct rtimer *t, void *ptr)
while(1) {
static uint8_t packet_seen;
static rtimer_clock_t t0;
static uint8_t count;
#if SYNC_CYCLE_STARTS
@ -365,7 +364,6 @@ powercycle(struct rtimer *t, void *ptr)
packet_seen = 0;
for(count = 0; count < CCA_COUNT_MAX; ++count) {
t0 = RTIMER_NOW();
if(we_are_sending == 0 && we_are_receiving_burst == 0) {
powercycle_turn_radio_on();
/* Check if a packet is seen in the air. If so, we keep the
@ -499,7 +497,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
uint8_t got_strobe_ack = 0;
int len;
uint8_t is_broadcast = 0;
uint8_t is_reliable = 0;
uint8_t is_known_receiver = 0;
uint8_t collisions;
int transmit_len;
@ -546,11 +543,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
#endif /* NETSTACK_CONF_WITH_IPV6 */
}
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE)
#if NETSTACK_CONF_WITH_RIME
|| packetbuf_attr(PACKETBUF_ATTR_ERELIABLE)
#endif /* NETSTACK_CONF_WITH_RIME */
;
if(!packetbuf_attr(PACKETBUF_ATTR_IS_CREATED_AND_SECURED)) {
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
@ -672,11 +664,12 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
{
rtimer_clock_t wt;
rtimer_clock_t txtime;
int ret;
txtime = RTIMER_NOW();
ret = NETSTACK_RADIO.transmit(transmit_len);
rtimer_clock_t txtime = RTIMER_NOW();
#if RDC_CONF_HARDWARE_ACK
int ret = NETSTACK_RADIO.transmit(transmit_len);
#else
NETSTACK_RADIO.transmit(transmit_len);
#endif
#if RDC_CONF_HARDWARE_ACK
/* For radios that block in the transmit routine and detect the

View File

@ -264,11 +264,13 @@ send_list(mac_callback_t sent, void *ptr, struct rdc_buf_list *buf_list)
static void
packet_input(void)
{
#if NULLRDC_SEND_802154_ACK
int original_datalen;
uint8_t *original_dataptr;
original_datalen = packetbuf_datalen();
original_dataptr = packetbuf_dataptr();
#endif
#if NULLRDC_802154_AUTOACK
if(packetbuf_datalen() == ACK_LEN) {

View File

@ -137,7 +137,7 @@ collect_common_send(void)
/* Use parts of the IPv6 address as the parent address, in reversed byte order. */
parent.u8[LINKADDR_SIZE - 1] = nbr->ipaddr.u8[sizeof(uip_ipaddr_t) - 2];
parent.u8[LINKADDR_SIZE - 2] = nbr->ipaddr.u8[sizeof(uip_ipaddr_t) - 1];
parent_etx = rpl_get_parent_rank((linkaddr_t *) uip_ds6_nbr_get_ll(nbr)) / 2;
parent_etx = rpl_get_parent_rank((uip_lladdr_t *) uip_ds6_nbr_get_ll(nbr)) / 2;
}
}
rtmetric = dag->rank;