Fix lots of compiler warnings

This commit is contained in:
Ralf Schlatterbeck 2014-05-31 15:52:33 +02:00
parent 47d1c2a74d
commit 478d91ac53
9 changed files with 12 additions and 15 deletions

View file

@ -81,7 +81,7 @@ petsciiconv_toascii(char *buf, unsigned int len)
{
static char c;
ptr = buf;
ptr = (unsigned char*)buf;
for(i = len; i > 0; --i) {
c = *ptr;
if(c == 0x0a) {
@ -108,7 +108,7 @@ petsciiconv_toascii(char *buf, unsigned int len)
void
petsciiconv_topetscii(char *buf, unsigned int len)
{
ptr = buf;
ptr = (unsigned char *)buf;
for(i = len; i > 0; --i) {
*ptr = ascii2petscii[*ptr & 0x7f];
++ptr;

View file

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

View file

@ -103,7 +103,7 @@ slipdev_send(void)
ptr = &uip_buf[UIP_LLH_LEN];
for(i = 0; i < uip_len; ++i) {
if(i == UIP_TCPIP_HLEN) {
ptr = (char *)uip_appdata;
ptr = uip_appdata;
}
c = *ptr++;
switch(c) {

View file

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

View file

@ -38,6 +38,7 @@
*/
#include <string.h>
#include "net/ipv4/uaodv-rt.h"
#include "contiki-net.h"

View file

@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "contiki.h"
#include "net/ipv4/uaodv-def.h"

View file

@ -372,7 +372,6 @@ powercycle(struct rtimer *t, void *ptr)
while(1) {
static uint8_t packet_seen;
static rtimer_clock_t t0;
static uint8_t count;
#if SYNC_CYCLE_STARTS
@ -396,7 +395,6 @@ powercycle(struct rtimer *t, void *ptr)
packet_seen = 0;
for(count = 0; count < CCA_COUNT_MAX; ++count) {
t0 = RTIMER_NOW();
if(we_are_sending == 0 && we_are_receiving_burst == 0) {
powercycle_turn_radio_on();
/* 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;
int hdrlen, len;
uint8_t is_broadcast = 0;
uint8_t is_reliable = 0;
#if WITH_PHASE_OPTIMIZATION
uint8_t is_known_receiver = 0;
#endif
uint8_t collisions;
int transmit_len;
int ret;
@ -580,9 +579,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
#endif /* UIP_CONF_IPV6 */
}
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
#if WITH_CONTIKIMAC_HEADER

View file

@ -270,11 +270,13 @@ send_list(mac_callback_t sent, void *ptr, struct rdc_buf_list *buf_list)
static void
packet_input(void)
{
#if NULLRDC_SEND_802154_ACK
int original_datalen;
uint8_t *original_dataptr;
original_datalen = packetbuf_datalen();
original_dataptr = packetbuf_dataptr();
#endif
#ifdef NETSTACK_DECRYPT
NETSTACK_DECRYPT();
#endif /* NETSTACK_DECRYPT */

View file

@ -254,13 +254,11 @@ collect_neighbor_list_remove(struct collect_neighbor_list *neighbors_list,
struct collect_neighbor *
collect_neighbor_list_best(struct collect_neighbor_list *neighbors_list)
{
int found;
struct collect_neighbor *n, *best;
uint16_t rtmetric;
rtmetric = RTMETRIC_MAX;
best = NULL;
found = 0;
if(neighbors_list == NULL) {
return NULL;