Merge pull request #1169 from feshie/pr-warnings-fix

Fix multiple warnings (TCPIP, coap-observe, msp430, z1/tmp102, ContikiMAC)
This commit is contained in:
Simon Duquennoy 2015-09-08 09:05:44 +02:00
commit 63ddba93a9
3 changed files with 16 additions and 11 deletions

View File

@ -234,8 +234,6 @@ coap_observe_handler(resource_t *resource, void *request, void *response)
coap_packet_t *const coap_res = (coap_packet_t *)response; coap_packet_t *const coap_res = (coap_packet_t *)response;
coap_observer_t * obs; coap_observer_t * obs;
static char content[16];
if(coap_req->code == COAP_GET && coap_res->code < 128) { /* GET request and response without error code */ if(coap_req->code == COAP_GET && coap_res->code < 128) { /* GET request and response without error code */
if(IS_OPTION(coap_req, COAP_OPTION_OBSERVE)) { if(IS_OPTION(coap_req, COAP_OPTION_OBSERVE)) {
if(coap_req->observe == 0) { if(coap_req->observe == 0) {
@ -249,13 +247,14 @@ coap_observe_handler(resource_t *resource, void *request, void *response)
* A subscription should return the same representation as a normal GET. * A subscription should return the same representation as a normal GET.
* Uncomment if you want an information about the avaiable observers. * Uncomment if you want an information about the avaiable observers.
*/ */
/* #if 0
* coap_set_payload(coap_res, static char content[16];
* content, coap_set_payload(coap_res,
* snprintf(content, sizeof(content), "Added %u/%u", content,
* list_length(observers_list), snprintf(content, sizeof(content), "Added %u/%u",
* COAP_MAX_OBSERVERS)); list_length(observers_list),
*/ COAP_MAX_OBSERVERS));
#endif
} else { } else {
coap_res->code = SERVICE_UNAVAILABLE_5_03; coap_res->code = SERVICE_UNAVAILABLE_5_03;
coap_set_payload(coap_res, "TooManyObservers", 16); coap_set_payload(coap_res, "TooManyObservers", 16);

View File

@ -155,6 +155,7 @@ unsigned char tcpip_is_forwarding; /* Forwarding right now? */
PROCESS(tcpip_process, "TCP/IP stack"); PROCESS(tcpip_process, "TCP/IP stack");
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if UIP_TCP || UIP_CONF_IP_FORWARD
static void static void
start_periodic_tcp_timer(void) start_periodic_tcp_timer(void)
{ {
@ -162,6 +163,7 @@ start_periodic_tcp_timer(void)
etimer_restart(&periodic); etimer_restart(&periodic);
} }
} }
#endif /* UIP_TCP || UIP_CONF_IP_FORWARD */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
check_for_tcp_syn(void) check_for_tcp_syn(void)

View File

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