Merge pull request #1051 from simonduq/fix-warning

Fixed a number of compiler warnings
This commit is contained in:
George Oikonomou 2015-05-13 00:52:40 +01:00
commit 11a5e0a49a
8 changed files with 30 additions and 21 deletions

View file

@ -72,14 +72,13 @@ static unsigned char ascii2petscii[128] = {
0x58,0x59,0x5a,0xdb,0xdd,0xdd,0x5e,0xdf,
};
static unsigned int i;
static unsigned char *ptr;
/*-----------------------------------------------------------------------------------*/
void
petsciiconv_toascii(char *buf, unsigned int len)
{
static char c;
unsigned int i;
char *ptr;
char c;
ptr = buf;
for(i = len; i > 0; --i) {
@ -108,6 +107,9 @@ petsciiconv_toascii(char *buf, unsigned int len)
void
petsciiconv_topetscii(char *buf, unsigned int len)
{
unsigned int i;
char *ptr;
ptr = buf;
for(i = len; i > 0; --i) {
*ptr = ascii2petscii[*ptr & 0x7f];

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
@ -666,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;