Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Sprinkle couple of cosmetic changes - use 'extern' in he...
details: https://anonhg.NetBSD.org/src/rev/488f8709c1c5
branches: trunk
changeset: 511403:488f8709c1c5
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Jun 19 07:37:16 2001 +0000
description:
Sprinkle couple of cosmetic changes - use 'extern' in headers, make
some stuff static, const as appropriate, use static TAILQ_HEAD_INITIALIZER()
instead TAILQ_INIT() call.
diffstat:
sys/netccitt/pk_subr.c | 4 ++--
sys/netccitt/pk_var.h | 4 ++--
sys/netiso/clnp_input.c | 6 +++---
sys/netiso/iso_var.h | 6 +++---
sys/netns/ns_pcb.c | 6 +++---
sys/netns/ns_var.h | 4 ++--
sys/netns/spp_debug.c | 17 +++++++++++------
sys/netns/spp_debug.h | 6 ++----
sys/netns/spp_timer.h | 4 ++--
sys/netns/spp_usrreq.c | 3 ++-
10 files changed, 32 insertions(+), 28 deletions(-)
diffs (224 lines):
diff -r d71b6a14566e -r 488f8709c1c5 sys/netccitt/pk_subr.c
--- a/sys/netccitt/pk_subr.c Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netccitt/pk_subr.c Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pk_subr.c,v 1.20 2000/07/08 17:45:53 sommerfeld Exp $ */
+/* $NetBSD: pk_subr.c,v 1.21 2001/06/19 07:37:16 jdolecek Exp $ */
/*
* Copyright (c) 1984 University of British Columbia.
@@ -70,7 +70,7 @@
struct pklcd_q pklcd_q = {&pklcd_q, &pklcd_q};
-struct x25bitslice x25_bitslice[] = {
+const struct x25bitslice x25_bitslice[] = {
/* mask, shift value */
{0xf0, 0x4},
{0xf, 0x0},
diff -r d71b6a14566e -r 488f8709c1c5 sys/netccitt/pk_var.h
--- a/sys/netccitt/pk_var.h Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netccitt/pk_var.h Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pk_var.h,v 1.13 2001/05/30 11:42:13 mrg Exp $ */
+/* $NetBSD: pk_var.h,v 1.14 2001/06/19 07:37:16 jdolecek Exp $ */
/*
* Copyright (c) 1985 Computing Centre, University of British Columbia.
@@ -208,7 +208,7 @@
#define X25SBITS(Arg, Index, Val) (Arg) |= (((Val) << x25_bitslice[(Index)].bs_shift) & x25_bitslice[(Index)].bs_mask)
#define X25CSBITS(Arg, Index, Val) (Arg) = (((Val) << x25_bitslice[(Index)].bs_shift) & x25_bitslice[(Index)].bs_mask)
-extern struct x25bitslice x25_bitslice[];
+extern const struct x25bitslice x25_bitslice[];
#define ISOFIFTTYPE(i,t) ((i)->if_type == (t))
diff -r d71b6a14566e -r 488f8709c1c5 sys/netiso/clnp_input.c
--- a/sys/netiso/clnp_input.c Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netiso/clnp_input.c Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clnp_input.c,v 1.22 2001/04/13 23:30:27 thorpej Exp $ */
+/* $NetBSD: clnp_input.c,v 1.23 2001/06/19 07:37:17 jdolecek Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -105,6 +105,8 @@
void x25esis_input();
#endif
#endif /* ISO_X25ESIS */
+struct iso_ifaddrhead iso_ifaddr = TAILQ_HEAD_INITIALIZER(iso_ifaddr);
+struct ifqueue clnlintrq;
/*
* FUNCTION: clnp_init
@@ -142,8 +144,6 @@
clnl_protox[ISO8473_CLNP].clnl_input = clnp_input;
clnlintrq.ifq_maxlen = clnpqmaxlen;
-
- TAILQ_INIT(&iso_ifaddr);
}
/*
diff -r d71b6a14566e -r 488f8709c1c5 sys/netiso/iso_var.h
--- a/sys/netiso/iso_var.h Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netiso/iso_var.h Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iso_var.h,v 1.15 2001/01/17 04:05:45 itojun Exp $ */
+/* $NetBSD: iso_var.h,v 1.16 2001/06/19 07:37:17 jdolecek Exp $ */
/*-
* Copyright (c) 1988, 1991, 1993
@@ -132,8 +132,8 @@
};
#ifdef _KERNEL
TAILQ_HEAD(iso_ifaddrhead, iso_ifaddr);
-struct iso_ifaddrhead iso_ifaddr; /* linked list of iso address ifaces */
-struct ifqueue clnlintrq; /* clnl packet input queue */
+extern struct iso_ifaddrhead iso_ifaddr; /* linked list of iso address ifaces */
+extern struct ifqueue clnlintrq; /* clnl packet input queue */
struct afhash;
struct llinfo_llc;
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/ns_pcb.c
--- a/sys/netns/ns_pcb.c Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/ns_pcb.c Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ns_pcb.c,v 1.15 2001/04/13 23:30:29 thorpej Exp $ */
+/* $NetBSD: ns_pcb.c,v 1.16 2001/06/19 07:37:17 jdolecek Exp $ */
/*
* Copyright (c) 1984, 1985, 1986, 1987, 1993
@@ -52,7 +52,7 @@
#include <netns/ns_pcb.h>
#include <netns/ns_var.h>
-struct ns_addr zerons_addr;
+static const struct ns_addr zerons_addr;
int
ns_pcballoc(so, head)
@@ -337,7 +337,7 @@
struct nspcb *
ns_pcblookup(faddr, lport, wildp)
- struct ns_addr *faddr;
+ const struct ns_addr *faddr;
u_int16_t lport;
int wildp;
{
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/ns_var.h
--- a/sys/netns/ns_var.h Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/ns_var.h Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ns_var.h,v 1.11 2000/02/02 23:28:11 thorpej Exp $ */
+/* $NetBSD: ns_var.h,v 1.12 2001/06/19 07:37:17 jdolecek Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -105,6 +105,6 @@
void ns_setpeeraddr __P((struct nspcb *, struct mbuf *));
void ns_pcbnotify __P((struct ns_addr *, int, void (*)(struct nspcb *), long));
void ns_rtchange __P((struct nspcb *));
-struct nspcb *ns_pcblookup __P((struct ns_addr *, u_short, int));
+struct nspcb *ns_pcblookup __P((const struct ns_addr *, u_short, int));
#endif
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/spp_debug.c
--- a/sys/netns/spp_debug.c Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/spp_debug.c Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spp_debug.c,v 1.9 1998/07/05 00:51:29 jonathan Exp $ */
+/* $NetBSD: spp_debug.c,v 1.10 2001/06/19 07:37:17 jdolecek Exp $ */
/*
* Copyright (c) 1984, 1985, 1986, 1987, 1993
@@ -58,10 +58,19 @@
#define SPPTIMERS
#include <netns/spp_timer.h>
#include <netns/spp_var.h>
-#define SANAMES
+#define SANAMES
#include <netns/spp_debug.h>
+extern char *prurequests[];
+extern char *tcpstates[];
+extern const char * const sanames[];
+extern const char * const sppnames[];
+
int sppconsdebug = 0;
+
+struct spp_debug spp_debug[SPP_NDEBUG];
+int spp_debx;
+
/*
* spp debug routines
*/
@@ -79,10 +88,6 @@
unsigned long iptime();
int flags;
struct spp_debug *sd = &spp_debug[spp_debx++];
- extern char *prurequests[];
- extern char *sanames[];
- extern char *tcpstates[];
- extern char *spptimers[];
if (spp_debx == SPP_NDEBUG)
spp_debx = 0;
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/spp_debug.h
--- a/sys/netns/spp_debug.h Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/spp_debug.h Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spp_debug.h,v 1.5 1994/06/29 06:41:54 cgd Exp $ */
+/* $NetBSD: spp_debug.h,v 1.6 2001/06/19 07:37:17 jdolecek Exp $ */
/*
* Copyright (c) 1984, 1985, 1986, 1987, 1993
@@ -52,10 +52,8 @@
#define SA_DROP 4
#ifdef SANAMES
-char *sanames[] =
+const char * const sanames[] =
{ "input", "output", "user", "respond", "drop" };
#endif
#define SPP_NDEBUG 100
-struct spp_debug spp_debug[SPP_NDEBUG];
-int spp_debx;
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/spp_timer.h
--- a/sys/netns/spp_timer.h Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/spp_timer.h Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spp_timer.h,v 1.6 1995/03/26 20:36:22 jtc Exp $ */
+/* $NetBSD: spp_timer.h,v 1.7 2001/06/19 07:37:17 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@@ -104,7 +104,7 @@
#define SPP_MAXRXTSHIFT 12 /* maximum retransmits */
#ifdef SPPTIMERS
-char *spptimers[] =
+const char * const spptimers[] =
{ "REXMT", "PERSIST", "KEEP", "2MSL" };
#endif
diff -r d71b6a14566e -r 488f8709c1c5 sys/netns/spp_usrreq.c
--- a/sys/netns/spp_usrreq.c Tue Jun 19 07:19:35 2001 +0000
+++ b/sys/netns/spp_usrreq.c Tue Jun 19 07:37:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spp_usrreq.c,v 1.24 2000/03/30 13:02:59 augustss Exp $ */
+/* $NetBSD: spp_usrreq.c,v 1.25 2001/06/19 07:37:17 jdolecek Exp $ */
/*
* Copyright (c) 1984, 1985, 1986, 1987, 1993
@@ -71,6 +71,7 @@
spp_iss = 1; /* WRONG !! should fish it out of TODR */
}
+
struct spidp spp_savesi;
int traceallspps = 0;
extern int sppconsdebug;
Home |
Main Index |
Thread Index |
Old Index