Fix warnings in ContikiMAC

../..//core/net/mac/contikimac/contikimac.c:503:11: warning: variable
‘seqno’ set but not used [-Wunused-but-set-variable]
../..//core/net/mac/contikimac/contikimac.c:496:7: warning: variable
‘len’ set but not used [-Wunused-but-set-variable]

Both of these variables are only used if RDC_CONF_HARDWARE_ACK is not
true.
Their definitions and use have been moved into #ifdef guards so they do
not appear if RDC_CONF_HARDWARE_ACK is set.
This commit is contained in:
Arthur Fabre 2015-07-16 13:42:25 +01:00
parent ca50a2c6df
commit 8739113308

View File

@ -493,14 +493,16 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
#endif
int strobes;
uint8_t got_strobe_ack = 0;
int len;
uint8_t is_broadcast = 0;
uint8_t is_known_receiver = 0;
uint8_t collisions;
int transmit_len;
int ret;
uint8_t contikimac_was_on;
#if !RDC_CONF_HARDWARE_ACK
int len;
uint8_t seqno;
#endif
/* Exit if RDC and radio were explicitly turned off */
if(!contikimac_is_on && !contikimac_keep_radio_on) {
@ -641,11 +643,11 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
or rx cycle */
on();
}
seqno = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO);
#endif
watchdog_periodic();
t0 = RTIMER_NOW();
seqno = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO);
for(strobes = 0, collisions = 0;
got_strobe_ack == 0 && collisions == 0 &&
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + STROBE_TIME); strobes++) {
@ -658,7 +660,9 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
break;
}
#if !RDC_CONF_HARDWARE_ACK
len = 0;
#endif
{
rtimer_clock_t wt;