Fix lots of compiler warnings
This commit is contained in:
parent
47d1c2a74d
commit
478d91ac53
9 changed files with 12 additions and 15 deletions
|
@ -81,7 +81,7 @@ petsciiconv_toascii(char *buf, unsigned int len)
|
||||||
{
|
{
|
||||||
static char c;
|
static char c;
|
||||||
|
|
||||||
ptr = buf;
|
ptr = (unsigned char*)buf;
|
||||||
for(i = len; i > 0; --i) {
|
for(i = len; i > 0; --i) {
|
||||||
c = *ptr;
|
c = *ptr;
|
||||||
if(c == 0x0a) {
|
if(c == 0x0a) {
|
||||||
|
@ -108,7 +108,7 @@ petsciiconv_toascii(char *buf, unsigned int len)
|
||||||
void
|
void
|
||||||
petsciiconv_topetscii(char *buf, unsigned int len)
|
petsciiconv_topetscii(char *buf, unsigned int len)
|
||||||
{
|
{
|
||||||
ptr = buf;
|
ptr = (unsigned char *)buf;
|
||||||
for(i = len; i > 0; --i) {
|
for(i = len; i > 0; --i) {
|
||||||
*ptr = ascii2petscii[*ptr & 0x7f];
|
*ptr = ascii2petscii[*ptr & 0x7f];
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
|
@ -506,7 +506,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 UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
@ -524,7 +523,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));
|
||||||
|
@ -546,6 +544,7 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* UIP_CONF_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);
|
||||||
|
@ -603,8 +602,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;
|
||||||
|
|
|
@ -103,7 +103,7 @@ slipdev_send(void)
|
||||||
ptr = &uip_buf[UIP_LLH_LEN];
|
ptr = &uip_buf[UIP_LLH_LEN];
|
||||||
for(i = 0; i < uip_len; ++i) {
|
for(i = 0; i < uip_len; ++i) {
|
||||||
if(i == UIP_TCPIP_HLEN) {
|
if(i == UIP_TCPIP_HLEN) {
|
||||||
ptr = (char *)uip_appdata;
|
ptr = uip_appdata;
|
||||||
}
|
}
|
||||||
c = *ptr++;
|
c = *ptr++;
|
||||||
switch(c) {
|
switch(c) {
|
||||||
|
|
|
@ -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
|
||||||
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
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
check_for_tcp_syn(void)
|
check_for_tcp_syn(void)
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include "net/ipv4/uaodv-rt.h"
|
#include "net/ipv4/uaodv-rt.h"
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
#include "net/ipv4/uaodv-def.h"
|
#include "net/ipv4/uaodv-def.h"
|
||||||
|
|
|
@ -372,7 +372,6 @@ powercycle(struct rtimer *t, void *ptr)
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
static uint8_t packet_seen;
|
static uint8_t packet_seen;
|
||||||
static rtimer_clock_t t0;
|
|
||||||
static uint8_t count;
|
static uint8_t count;
|
||||||
|
|
||||||
#if SYNC_CYCLE_STARTS
|
#if SYNC_CYCLE_STARTS
|
||||||
|
@ -396,7 +395,6 @@ powercycle(struct rtimer *t, void *ptr)
|
||||||
packet_seen = 0;
|
packet_seen = 0;
|
||||||
|
|
||||||
for(count = 0; count < CCA_COUNT_MAX; ++count) {
|
for(count = 0; count < CCA_COUNT_MAX; ++count) {
|
||||||
t0 = RTIMER_NOW();
|
|
||||||
if(we_are_sending == 0 && we_are_receiving_burst == 0) {
|
if(we_are_sending == 0 && we_are_receiving_burst == 0) {
|
||||||
powercycle_turn_radio_on();
|
powercycle_turn_radio_on();
|
||||||
/* Check if a packet is seen in the air. If so, we keep the
|
/* Check if a packet is seen in the air. If so, we keep the
|
||||||
|
@ -530,8 +528,9 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
||||||
uint8_t got_strobe_ack = 0;
|
uint8_t got_strobe_ack = 0;
|
||||||
int hdrlen, len;
|
int hdrlen, len;
|
||||||
uint8_t is_broadcast = 0;
|
uint8_t is_broadcast = 0;
|
||||||
uint8_t is_reliable = 0;
|
#if WITH_PHASE_OPTIMIZATION
|
||||||
uint8_t is_known_receiver = 0;
|
uint8_t is_known_receiver = 0;
|
||||||
|
#endif
|
||||||
uint8_t collisions;
|
uint8_t collisions;
|
||||||
int transmit_len;
|
int transmit_len;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -580,9 +579,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
}
|
}
|
||||||
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
|
||||||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
|
|
||||||
|
|
||||||
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
|
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
|
||||||
|
|
||||||
#if WITH_CONTIKIMAC_HEADER
|
#if WITH_CONTIKIMAC_HEADER
|
||||||
|
|
|
@ -270,11 +270,13 @@ send_list(mac_callback_t sent, void *ptr, struct rdc_buf_list *buf_list)
|
||||||
static void
|
static void
|
||||||
packet_input(void)
|
packet_input(void)
|
||||||
{
|
{
|
||||||
|
#if NULLRDC_SEND_802154_ACK
|
||||||
int original_datalen;
|
int original_datalen;
|
||||||
uint8_t *original_dataptr;
|
uint8_t *original_dataptr;
|
||||||
|
|
||||||
original_datalen = packetbuf_datalen();
|
original_datalen = packetbuf_datalen();
|
||||||
original_dataptr = packetbuf_dataptr();
|
original_dataptr = packetbuf_dataptr();
|
||||||
|
#endif
|
||||||
#ifdef NETSTACK_DECRYPT
|
#ifdef NETSTACK_DECRYPT
|
||||||
NETSTACK_DECRYPT();
|
NETSTACK_DECRYPT();
|
||||||
#endif /* NETSTACK_DECRYPT */
|
#endif /* NETSTACK_DECRYPT */
|
||||||
|
|
|
@ -254,13 +254,11 @@ collect_neighbor_list_remove(struct collect_neighbor_list *neighbors_list,
|
||||||
struct collect_neighbor *
|
struct collect_neighbor *
|
||||||
collect_neighbor_list_best(struct collect_neighbor_list *neighbors_list)
|
collect_neighbor_list_best(struct collect_neighbor_list *neighbors_list)
|
||||||
{
|
{
|
||||||
int found;
|
|
||||||
struct collect_neighbor *n, *best;
|
struct collect_neighbor *n, *best;
|
||||||
uint16_t rtmetric;
|
uint16_t rtmetric;
|
||||||
|
|
||||||
rtmetric = RTMETRIC_MAX;
|
rtmetric = RTMETRIC_MAX;
|
||||||
best = NULL;
|
best = NULL;
|
||||||
found = 0;
|
|
||||||
|
|
||||||
if(neighbors_list == NULL) {
|
if(neighbors_list == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue