Fix compiler warnings

This commit is contained in:
Adam Dunkels 2015-10-04 22:32:12 +02:00 committed by Simon Duquennoy
parent 2d203cc713
commit 01996eb62a
2 changed files with 12 additions and 0 deletions

View file

@ -83,7 +83,9 @@ static uip_ipaddr_t loc_fipaddr;
/* Pointers used in this file */ /* Pointers used in this file */
static uip_ds6_addr_t *locaddr; static uip_ds6_addr_t *locaddr;
static uip_ds6_maddr_t *locmaddr; static uip_ds6_maddr_t *locmaddr;
#if UIP_DS6_AADDR_NB
static uip_ds6_aaddr_t *locaaddr; static uip_ds6_aaddr_t *locaaddr;
#endif /* UIP_DS6_AADDR_NB */
static uip_ds6_prefix_t *locprefix; static uip_ds6_prefix_t *locprefix;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -458,6 +460,7 @@ uip_ds6_maddr_lookup(const uip_ipaddr_t *ipaddr)
uip_ds6_aaddr_t * uip_ds6_aaddr_t *
uip_ds6_aaddr_add(uip_ipaddr_t *ipaddr) uip_ds6_aaddr_add(uip_ipaddr_t *ipaddr)
{ {
#if UIP_DS6_AADDR_NB
if(uip_ds6_list_loop if(uip_ds6_list_loop
((uip_ds6_element_t *)uip_ds6_if.aaddr_list, UIP_DS6_AADDR_NB, ((uip_ds6_element_t *)uip_ds6_if.aaddr_list, UIP_DS6_AADDR_NB,
sizeof(uip_ds6_aaddr_t), ipaddr, 128, sizeof(uip_ds6_aaddr_t), ipaddr, 128,
@ -466,6 +469,7 @@ uip_ds6_aaddr_add(uip_ipaddr_t *ipaddr)
uip_ipaddr_copy(&locaaddr->ipaddr, ipaddr); uip_ipaddr_copy(&locaaddr->ipaddr, ipaddr);
return locaaddr; return locaaddr;
} }
#endif /* UIP_DS6_AADDR_NB */
return NULL; return NULL;
} }
@ -483,11 +487,13 @@ uip_ds6_aaddr_rm(uip_ds6_aaddr_t *aaddr)
uip_ds6_aaddr_t * uip_ds6_aaddr_t *
uip_ds6_aaddr_lookup(uip_ipaddr_t *ipaddr) uip_ds6_aaddr_lookup(uip_ipaddr_t *ipaddr)
{ {
#if UIP_DS6_AADDR_NB
if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_if.aaddr_list, if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_if.aaddr_list,
UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128, UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128,
(uip_ds6_element_t **)&locaaddr) == FOUND) { (uip_ds6_element_t **)&locaaddr) == FOUND) {
return locaaddr; return locaaddr;
} }
#endif /* UIP_DS6_AADDR_NB */
return NULL; return NULL;
} }

View file

@ -216,9 +216,15 @@ typedef struct uip_ds6_netif {
uint32_t reachable_time; /* in msec */ uint32_t reachable_time; /* in msec */
uint32_t retrans_timer; /* in msec */ uint32_t retrans_timer; /* in msec */
uint8_t maxdadns; uint8_t maxdadns;
#if UIP_DS6_ADDR_NB
uip_ds6_addr_t addr_list[UIP_DS6_ADDR_NB]; uip_ds6_addr_t addr_list[UIP_DS6_ADDR_NB];
#endif /* UIP_DS6_ADDR_NB */
#if UIP_DS6_AADDR_NB
uip_ds6_aaddr_t aaddr_list[UIP_DS6_AADDR_NB]; uip_ds6_aaddr_t aaddr_list[UIP_DS6_AADDR_NB];
#endif /* UIP_DS6_AADDR_NB */
#if UIP_DS6_MADDR_NB
uip_ds6_maddr_t maddr_list[UIP_DS6_MADDR_NB]; uip_ds6_maddr_t maddr_list[UIP_DS6_MADDR_NB];
#endif /* UIP_DS6_MADDR_NB */
} uip_ds6_netif_t; } uip_ds6_netif_t;
/** \brief Generic type for a DS6, to use a common loop though all DS */ /** \brief Generic type for a DS6, to use a common loop though all DS */