Avoid compiler warning about unused variable

This commit is contained in:
Adam Dunkels 2014-12-02 10:43:31 +01:00
parent 769a2f832e
commit 19c7ae0dcd

View file

@ -504,8 +504,6 @@ start_name_collision_check(clock_time_t after)
static unsigned char * static unsigned char *
mdns_write_announce_records(unsigned char *queryptr, uint8_t *count) mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
{ {
struct dns_answer *ans;
#if NETSTACK_CONF_WITH_IPV6 #if NETSTACK_CONF_WITH_IPV6
uint8_t i; uint8_t i;
@ -522,7 +520,6 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
*queryptr++ = 0xc0; *queryptr++ = 0xc0;
*queryptr++ = sizeof(struct dns_hdr); *queryptr++ = sizeof(struct dns_hdr);
} }
ans = (struct dns_answer *)queryptr;
*queryptr++ = (uint8_t) ((NATIVE_DNS_TYPE) >> 8); *queryptr++ = (uint8_t) ((NATIVE_DNS_TYPE) >> 8);
*queryptr++ = (uint8_t) ((NATIVE_DNS_TYPE)); *queryptr++ = (uint8_t) ((NATIVE_DNS_TYPE));
@ -544,6 +541,8 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
} }
} }
#else /* NETSTACK_CONF_WITH_IPV6 */ #else /* NETSTACK_CONF_WITH_IPV6 */
struct dns_answer *ans;
queryptr = encode_name(queryptr, resolv_hostname); queryptr = encode_name(queryptr, resolv_hostname);
ans = (struct dns_answer *)queryptr; ans = (struct dns_answer *)queryptr;
ans->type = UIP_HTONS(NATIVE_DNS_TYPE); ans->type = UIP_HTONS(NATIVE_DNS_TYPE);
@ -601,8 +600,6 @@ mdns_prep_host_announce_packet(void)
uint8_t total_answers = 0; uint8_t total_answers = 0;
struct dns_answer *ans;
/* Be aware that, unless `ARCH_DOESNT_NEED_ALIGNED_STRUCTS` is set, /* Be aware that, unless `ARCH_DOESNT_NEED_ALIGNED_STRUCTS` is set,
* writing directly to the uint16_t members of this struct is an error. */ * writing directly to the uint16_t members of this struct is an error. */
struct dns_hdr *hdr = (struct dns_hdr *)uip_appdata; struct dns_hdr *hdr = (struct dns_hdr *)uip_appdata;