avoid gcc optimization bug by extracting struct values

This commit is contained in:
Fredrik Osterlind 2012-05-30 17:58:45 +02:00
parent b22ced2ef0
commit 076c208b72

View File

@ -420,6 +420,7 @@ send_packet(void)
uint8_t strobe[MAX_STROBE_SIZE];
int strobe_len, len;
int is_broadcast = 0;
int is_dispatch, is_strobe_ack;
/*int is_reliable;*/
struct encounter *e;
struct queuebuf *packet;
@ -566,7 +567,9 @@ send_packet(void)
packetbuf_set_datalen(len);
if(NETSTACK_FRAMER.parse() >= 0) {
hdr = packetbuf_dataptr();
if(hdr->dispatch == DISPATCH && hdr->type == TYPE_STROBE_ACK) {
is_dispatch = hdr->dispatch == DISPATCH;
is_strobe_ack = hdr->type == TYPE_STROBE_ACK;
if(is_dispatch && is_strobe_ack) {
if(rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER),
&rimeaddr_node_addr)) {
/* We got an ACK from the receiver, so we can immediately send