Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin static + __dead
details: https://anonhg.NetBSD.org/src/rev/d891beda9a69
branches: trunk
changeset: 769045:d891beda9a69
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Aug 30 18:57:38 2011 +0000
description:
static + __dead
diffstat:
usr.sbin/ifwatchd/ifwatchd.c | 6 ++--
usr.sbin/iopctl/iopctl.c | 64 +++++++++++++++++++++----------------------
2 files changed, 34 insertions(+), 36 deletions(-)
diffs (212 lines):
diff -r 089fa3516198 -r d891beda9a69 usr.sbin/ifwatchd/ifwatchd.c
--- a/usr.sbin/ifwatchd/ifwatchd.c Tue Aug 30 18:53:41 2011 +0000
+++ b/usr.sbin/ifwatchd/ifwatchd.c Tue Aug 30 18:57:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ifwatchd.c,v 1.25 2011/02/04 14:31:23 martin Exp $ */
+/* $NetBSD: ifwatchd.c,v 1.26 2011/08/30 18:57:38 joerg Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
enum event { ARRIVAL, DEPARTURE, UP, DOWN, CARRIER, NO_CARRIER };
/* local functions */
-static void usage(void);
+__dead static void usage(void);
static void dispatch(void*, size_t);
static void check_addrs(char *cp, int addrs, enum event ev);
static void invoke_script(struct sockaddr *sa, struct sockaddr *dst, enum event ev, int ifindex, const char *ifname_hint);
@@ -110,7 +110,7 @@
int last_carrier_status;
char * ifname;
};
-SLIST_HEAD(,interface_data) ifs = SLIST_HEAD_INITIALIZER(ifs);
+static SLIST_HEAD(,interface_data) ifs = SLIST_HEAD_INITIALIZER(ifs);
int
main(int argc, char **argv)
diff -r 089fa3516198 -r d891beda9a69 usr.sbin/iopctl/iopctl.c
--- a/usr.sbin/iopctl/iopctl.c Tue Aug 30 18:53:41 2011 +0000
+++ b/usr.sbin/iopctl/iopctl.c Tue Aug 30 18:57:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $ */
+/* $NetBSD: iopctl.c,v 1.22 2011/08/30 19:03:25 joerg Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#ifndef lint
#include <sys/cdefs.h>
-__RCSID("$NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $");
+__RCSID("$NetBSD: iopctl.c,v 1.22 2011/08/30 19:03:25 joerg Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -51,23 +51,21 @@
#include <dev/i2o/i2o.h>
#include <dev/i2o/iopio.h>
-const char *class2str(int);
-void getparam(int, int, void *, int);
-int gettid(char **);
-int main(int, char **);
-int show(const char *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
-void i2ostrvis(const u_char *, int, char *, int);
-void usage(void);
+static const char *class2str(int);
+static void getparam(int, int, void *, int);
+static int gettid(char **);
+static int show(const char *, const char *, ...) __printflike(2, 3);
+static void i2ostrvis(const u_char *, int, char *, int);
+static void usage(void) __dead;
-void reconfig(char **);
-void showdevid(char **);
-void showddmid(char **);
-void showlct(char **);
-void showstatus(char **);
-void showtidmap(char **);
+static void reconfig(char **);
+static void showdevid(char **);
+static void showddmid(char **);
+static void showlct(char **);
+static void showstatus(char **);
+static void showtidmap(char **);
-struct {
+static struct {
int class;
const char *caption;
} const i2oclass[] = {
@@ -87,7 +85,7 @@
{ I2O_CLASS_BUS_ADAPTER_PORT, "bus adapter port" },
};
-struct {
+static struct {
const char *label;
int takesargs;
void (*func)(char **);
@@ -100,9 +98,9 @@
{ "showtidmap", 0, showtidmap },
};
-int fd;
-char buf[32768];
-struct i2o_status status;
+static int fd;
+static char buf[32768];
+static struct i2o_status status;
int
main(int argc, char **argv)
@@ -153,7 +151,7 @@
/* NOTREACHED */
}
-void
+static void
usage(void)
{
@@ -163,7 +161,7 @@
/* NOTREACHED */
}
-int
+static int
show(const char *hdr, const char *fmt, ...)
{
int i;
@@ -178,7 +176,7 @@
return (i);
}
-const char *
+static const char *
class2str(int class)
{
size_t i;
@@ -190,7 +188,7 @@
return ("unknown");
}
-void
+static void
getparam(int tid, int group, void *pbuf, int pbufsize)
{
struct ioppt pt;
@@ -237,7 +235,7 @@
rf->reqstatus);
}
-void
+static void
showlct(char **argv)
{
struct iovec iov;
@@ -291,7 +289,7 @@
}
}
-void
+static void
showstatus(char **argv)
{
char ident[sizeof(status.productid) + 1];
@@ -333,7 +331,7 @@
le32toh(status.currentpriviobase));
}
-void
+static void
showddmid(char **argv)
{
struct {
@@ -358,7 +356,7 @@
show("serial #", "%08x%08x%08x", serial[0], serial[1], serial[2]);
}
-void
+static void
showdevid(char **argv)
{
struct {
@@ -392,7 +390,7 @@
show("revision level", "<%s>", ident);
}
-void
+static void
reconfig(char **argv)
{
@@ -400,7 +398,7 @@
err(EXIT_FAILURE, "IOPIOCRECONFIG");
}
-void
+static void
showtidmap(char **argv)
{
struct iovec iov;
@@ -421,7 +419,7 @@
printf("%s\ttid %d\n", it->it_dvname, it->it_tid);
}
-void
+static void
i2ostrvis(const u_char *src, int slen, char *dst, int dlen)
{
int hc, lc, i, nit;
@@ -455,7 +453,7 @@
dst[lc] = '\0';
}
-int
+static int
gettid(char **argv)
{
char *argp;
Home |
Main Index |
Thread Index |
Old Index