Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet avoid "variable not initialized" warnings on som...
details: https://anonhg.NetBSD.org/src/rev/48b98ab6c2de
branches: trunk
changeset: 474261:48b98ab6c2de
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Jul 02 12:45:32 1999 +0000
description:
avoid "variable not initialized" warnings on some of the platforms.
diffstat:
sys/netinet/tcp_input.c | 7 ++++++-
sys/netinet/tcp_output.c | 13 ++++++++++++-
sys/netinet/tcp_subr.c | 11 ++++++++++-
sys/netinet/tcp_usrreq.c | 4 +++-
4 files changed, 31 insertions(+), 4 deletions(-)
diffs (126 lines):
diff -r d800904e2702 -r 48b98ab6c2de sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c Fri Jul 02 12:43:42 1999 +0000
+++ b/sys/netinet/tcp_input.c Fri Jul 02 12:45:32 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.83 1999/07/01 08:12:51 itojun Exp $ */
+/* $NetBSD: tcp_input.c,v 1.84 1999/07/02 12:45:32 itojun Exp $ */
/*
%%% portions-copyright-nrl-95
@@ -3215,6 +3215,8 @@
th->th_sport = sc->sc_dst.sin6.sin6_port;
break;
#endif
+ default:
+ th = NULL;
}
th->th_seq = htonl(sc->sc_iss);
@@ -3327,6 +3329,9 @@
0, NULL);
break;
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
return (error);
}
diff -r d800904e2702 -r 48b98ab6c2de sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c Fri Jul 02 12:43:42 1999 +0000
+++ b/sys/netinet/tcp_output.c Fri Jul 02 12:45:32 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_output.c,v 1.48 1999/07/01 08:12:51 itojun Exp $ */
+/* $NetBSD: tcp_output.c,v 1.49 1999/07/02 12:45:32 itojun Exp $ */
/*
%%% portions-copyright-nrl-95
@@ -584,6 +584,9 @@
iphdrlen = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
break;
#endif
+ default: /*pacify gcc*/
+ iphdrlen = 0;
+ break;
}
hdrlen = iphdrlen;
if (flags & TH_SYN) {
@@ -768,6 +771,11 @@
th = (struct tcphdr *)(ip6 + 1);
break;
#endif
+ default: /*pacify gcc*/
+ ip = NULL;
+ ip6 = NULL;
+ th = NULL;
+ break;
}
if (tp->t_template == 0)
panic("tcp_output");
@@ -1062,6 +1070,9 @@
break;
}
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
if (error) {
out:
diff -r d800904e2702 -r 48b98ab6c2de sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c Fri Jul 02 12:43:42 1999 +0000
+++ b/sys/netinet/tcp_subr.c Fri Jul 02 12:45:32 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_subr.c,v 1.67 1999/07/01 08:12:51 itojun Exp $ */
+/* $NetBSD: tcp_subr.c,v 1.68 1999/07/02 12:45:32 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -256,6 +256,7 @@
return NULL; /*EINVAL*/
#endif
default:
+ hlen = 0; /*pacify gcc*/
return NULL; /*EAFNOSUPPORT*/
}
if ((m = tp->t_template) == 0) {
@@ -444,6 +445,11 @@
th = (struct tcphdr *)(ip6 + 1);
break;
#endif
+ default: /*pacify gcc*/
+ ip = NULL;
+ ip6 = NULL;
+ th = NULL;
+ break;
}
flags = TH_ACK;
} else {
@@ -653,6 +659,9 @@
error = ip6_output(m, NULL, (struct route_in6 *)ro, 0, NULL);
break;
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
if (ro == (struct route *)&iproute) {
diff -r d800904e2702 -r 48b98ab6c2de sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c Fri Jul 02 12:43:42 1999 +0000
+++ b/sys/netinet/tcp_usrreq.c Fri Jul 02 12:45:32 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.40 1999/07/01 08:12:51 itojun Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.41 1999/07/02 12:45:32 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -746,6 +746,8 @@
else if (in6p)
tp = tcp_newtcpcb(family, (void *)in6p);
#endif
+ else
+ tp = NULL;
if (tp == 0) {
int nofd = so->so_state & SS_NOFDREF; /* XXX */
Home |
Main Index |
Thread Index |
Old Index