From a94e7e63e2e69cd21608f2df32031bc15c42e0ac Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sat, 1 Feb 2014 00:46:57 +0100
Subject: [PATCH] Avoid compiler warnings.
---
apps/webbrowser/www.c | 1 -
core/net/ip/resolv.c | 3 ++-
core/net/ipv4/uip_arp.c | 1 -
core/net/ipv6/uip-icmp6.c | 9 ++++----
cpu/6502/net/uip_arch.c | 46 ++++++++++++---------------------------
5 files changed, 21 insertions(+), 39 deletions(-)
diff --git a/apps/webbrowser/www.c b/apps/webbrowser/www.c
index e8bd7effe..8e1331c75 100644
--- a/apps/webbrowser/www.c
+++ b/apps/webbrowser/www.c
@@ -456,7 +456,6 @@ quit(void)
PROCESS_THREAD(www_process, ev, data)
{
static struct ctk_widget *w;
- static unsigned char i;
#if WWW_CONF_WITH_WGET
static char *argptr;
#endif /* WWW_CONF_WITH_WGET */
diff --git a/core/net/ip/resolv.c b/core/net/ip/resolv.c
index 1116d9996..b339b03d6 100644
--- a/core/net/ip/resolv.c
+++ b/core/net/ip/resolv.c
@@ -774,7 +774,7 @@ check_entries(void)
static void
newdata(void)
{
- static uint8_t nquestions, nanswers, nauthrr;
+ static uint8_t nquestions, nanswers;
static int8_t i;
@@ -863,6 +863,7 @@ newdata(void)
}
return;
} else {
+ static uint8_t nauthrr;
PRINTF("resolver: But we are still probing. Waiting...\n");
/* We are still probing. We need to do the mDNS
* probe race condition check here and make sure
diff --git a/core/net/ipv4/uip_arp.c b/core/net/ipv4/uip_arp.c
index 09cfb49cf..87145f598 100644
--- a/core/net/ipv4/uip_arp.c
+++ b/core/net/ipv4/uip_arp.c
@@ -102,7 +102,6 @@ struct arp_entry {
static const struct uip_eth_addr broadcast_ethaddr =
{{0xff,0xff,0xff,0xff,0xff,0xff}};
-static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff};
static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
static uip_ipaddr_t ipaddr;
diff --git a/core/net/ipv6/uip-icmp6.c b/core/net/ipv6/uip-icmp6.c
index a527ed5ed..1ad0c62fc 100644
--- a/core/net/ipv6/uip-icmp6.c
+++ b/core/net/ipv6/uip-icmp6.c
@@ -64,16 +64,17 @@
#define UIP_EXT_BUF ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_FIRST_EXT_BUF ((struct uip_ext_hdr *)&uip_buf[UIP_LLIPH_LEN])
-/** \brief temporary IP address */
-static uip_ipaddr_t tmp_ipaddr;
-
#if UIP_CONF_IPV6_RPL
#include "rpl/rpl.h"
#endif /* UIP_CONF_IPV6_RPL */
+#if UIP_CONF_IPV6
+
+/** \brief temporary IP address */
+static uip_ipaddr_t tmp_ipaddr;
+
LIST(echo_reply_callback_list);
-#if UIP_CONF_IPV6
/*---------------------------------------------------------------------------*/
void
uip_icmp6_echo_request_input(void)
diff --git a/cpu/6502/net/uip_arch.c b/cpu/6502/net/uip_arch.c
index 2176bd2c9..af245d1bd 100644
--- a/cpu/6502/net/uip_arch.c
+++ b/cpu/6502/net/uip_arch.c
@@ -86,11 +86,9 @@ chksum(void) {
asm("lda _chksum_ptr+1");
asm("sta ptr1+1");
-
asm("lda _chksum_len+1");
asm("beq chksumlast");
-
/* If checksum is > 256, do the first runs. */
asm("ldy #0");
asm("clc");
@@ -116,7 +114,7 @@ chksum(void) {
asm("adc #0");
asm("sta tmp1+1");
asm("bcs chksum_endloop_256");
-
+
asm("chksumlast:");
asm("lda _chksum_len");
asm("lsr");
@@ -156,7 +154,7 @@ chksum(void) {
asm("jmp chksum_loop1");
asm("chksum_loop1_end:");
asm("plp");
-
+
asm("chksum_endloop:");
asm("lda tmp1");
asm("adc #0");
@@ -165,9 +163,11 @@ chksum(void) {
asm("adc #0");
asm("sta tmp1+1");
asm("bcs chksum_endloop");
-
+
asm("lda tmp1");
asm("ldx tmp1+1");
+
+ return __AX__;
}
#pragma optimize(pop)
/*-----------------------------------------------------------------------------------*/
@@ -204,7 +204,7 @@ uip_chksum(uint16_t *buf, uint16_t len)
/*-----------------------------------------------------------------------------------*/
uint16_t
uip_ipchksum(void)
-{
+{
chksum_ptr = (uint16_t)uip_buf + UIP_LLH_LEN;
chksum_len = UIP_IPH_LEN;
return chksum();
@@ -241,7 +241,7 @@ transport_chksum(uint8_t protocol)
/* asm("bcc noinc");
asm("inc _chksum_tmp");
asm("noinc:");*/
-
+
asm("tcpchksum_loop1:");
asm("lda _chksum_tmp");
asm("adc #0");
@@ -251,7 +251,6 @@ transport_chksum(uint8_t protocol)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop1");
-
asm("lda _uip_aligned_buf+3+%b", UIP_LLH_LEN);
asm("sec");
asm("sbc #%b", UIP_IPH_LEN);
@@ -259,8 +258,7 @@ transport_chksum(uint8_t protocol)
asm("lda _uip_aligned_buf+2+%b", UIP_LLH_LEN);
asm("sbc #0");
asm("sta _chksum_len+1");
-
-
+
asm("ldy #$0c");
asm("clc");
asm("php");
@@ -279,7 +277,7 @@ transport_chksum(uint8_t protocol)
asm("bne tcpchksum_loop2");
asm("plp");
-
+
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
@@ -287,7 +285,6 @@ transport_chksum(uint8_t protocol)
asm("adc %v", chksum_protocol);
asm("sta _chksum_tmp+1");
-
asm("lda _chksum_tmp");
asm("adc _chksum_len+1");
asm("sta _chksum_tmp");
@@ -295,8 +292,6 @@ transport_chksum(uint8_t protocol)
asm("adc _chksum_len");
asm("sta _chksum_tmp+1");
-
-
asm("tcpchksum_loop3:");
asm("lda _chksum_tmp");
asm("adc #0");
@@ -306,7 +301,6 @@ transport_chksum(uint8_t protocol)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop3");
-
return chksum_tmp;
}
#pragma optimize(pop)
@@ -343,7 +337,7 @@ uip_tcpchksum(void)
/* asm("bcc noinc");
asm("inc _chksum_tmp");
asm("noinc:");*/
-
+
asm("tcpchksum_loop1:");
asm("lda _chksum_tmp");
asm("adc #0");
@@ -353,7 +347,6 @@ uip_tcpchksum(void)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop1");
-
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
asm("sec");
asm("sbc #%b", UIP_IPH_LEN);
@@ -361,8 +354,7 @@ uip_tcpchksum(void)
asm("lda _uip_buf+2+%b", UIP_LLH_LEN);
asm("sbc #0");
asm("sta _chksum_len+1");
-
-
+
asm("ldy #$0c");
asm("clc");
asm("php");
@@ -381,7 +373,7 @@ uip_tcpchksum(void)
asm("bne tcpchksum_loop2");
asm("plp");
-
+
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
@@ -389,7 +381,6 @@ uip_tcpchksum(void)
asm("adc #6"); /* IP_PROTO_TCP */
asm("sta _chksum_tmp+1");
-
asm("lda _chksum_tmp");
asm("adc _chksum_len+1");
asm("sta _chksum_tmp");
@@ -397,8 +388,6 @@ uip_tcpchksum(void)
asm("adc _chksum_len");
asm("sta _chksum_tmp+1");
-
-
asm("tcpchksum_loop3:");
asm("lda _chksum_tmp");
asm("adc #0");
@@ -408,7 +397,6 @@ uip_tcpchksum(void)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop3");
-
return chksum_tmp;
#endif
}
@@ -456,7 +444,6 @@ uip_udpchksum(void)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop1");
-
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
asm("sec");
asm("sbc #20");
@@ -464,8 +451,7 @@ uip_udpchksum(void)
asm("lda _uip_buf+2+%b", UIP_LLH_LEN);
asm("sbc #0");
asm("sta _chksum_len+1");
-
-
+
asm("ldy #$0c");
asm("clc");
asm("php");
@@ -484,7 +470,7 @@ uip_udpchksum(void)
asm("bne tcpchksum_loop2");
asm("plp");
-
+
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
@@ -492,7 +478,6 @@ uip_udpchksum(void)
asm("adc #17"); /* IP_PROTO_UDP */
asm("sta _chksum_tmp+1");
-
asm("lda _chksum_tmp");
asm("adc _chksum_len+1");
asm("sta _chksum_tmp");
@@ -500,8 +485,6 @@ uip_udpchksum(void)
asm("adc _chksum_len");
asm("sta _chksum_tmp+1");
-
-
asm("tcpchksum_loop3:");
asm("lda _chksum_tmp");
asm("adc #0");
@@ -511,7 +494,6 @@ uip_udpchksum(void)
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop3");
-
return chksum_tmp;
#endif
}