Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin static + __dead
details: https://anonhg.NetBSD.org/src/rev/55506f987964
branches: trunk
changeset: 768829:55506f987964
user: joerg <joerg%NetBSD.org@localhost>
date: Sat Aug 27 18:57:50 2011 +0000
description:
static + __dead
diffstat:
sbin/swapctl/swapctl.c | 30 +++++++++++++++---------------
sbin/ttyflags/ttyflags.c | 22 +++++++++++-----------
sbin/wdogctl/wdogctl.c | 41 ++++++++++++++++++++---------------------
3 files changed, 46 insertions(+), 47 deletions(-)
diffs (276 lines):
diff -r 6cda0a6e5e05 -r 55506f987964 sbin/swapctl/swapctl.c
--- a/sbin/swapctl/swapctl.c Sat Aug 27 18:55:58 2011 +0000
+++ b/sbin/swapctl/swapctl.c Sat Aug 27 18:57:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: swapctl.c,v 1.35 2009/09/24 16:15:20 apb Exp $ */
+/* $NetBSD: swapctl.c,v 1.36 2011/08/27 18:57:50 joerg Exp $ */
/*
* Copyright (c) 1996, 1997, 1999 Matthew R. Green
@@ -64,7 +64,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: swapctl.c,v 1.35 2009/09/24 16:15:20 apb Exp $");
+__RCSID("$NetBSD: swapctl.c,v 1.36 2011/08/27 18:57:50 joerg Exp $");
#endif
@@ -88,7 +88,7 @@
#include "swapctl.h"
-int command;
+static int command;
/*
* Commands for swapctl(8). These are mutually exclusive.
@@ -121,45 +121,45 @@
/*
* Option flags, and the commands with which they are valid.
*/
-int kflag; /* display in 1K^x blocks */
+static int kflag; /* display in 1K^x blocks */
#define KFLAG_CMDS (CMD_l | CMD_s)
#define MFLAG_CMDS (CMD_l | CMD_s)
#define GFLAG_CMDS (CMD_l | CMD_s)
-int hflag; /* display with humanize_number */
+static int hflag; /* display with humanize_number */
#define HFLAG_CMDS (CMD_l | CMD_s)
-int pflag; /* priority was specified */
+static int pflag; /* priority was specified */
#define PFLAG_CMDS (CMD_A | CMD_a | CMD_c)
-char *tflag; /* swap device type (blk, noblk, auto) */
-int autoflag; /* 1, if tflag is "auto" */
+static char *tflag; /* swap device type (blk, noblk, auto) */
+static int autoflag; /* 1, if tflag is "auto" */
#define TFLAG_CMDS (CMD_A | CMD_U)
-int fflag; /* first swap becomes dump */
+static int fflag; /* first swap becomes dump */
#define FFLAG_CMDS (CMD_A)
-int oflag; /* only autoset dump device */
+static int oflag; /* only autoset dump device */
#define OFLAG_CMDS (CMD_A)
-int nflag; /* no execute, just print actions */
+static int nflag; /* no execute, just print actions */
#define NFLAG_CMDS (CMD_A | CMD_U)
-int pri; /* uses 0 as default pri */
+static int pri; /* uses 0 as default pri */
static void change_priority(char *);
static int add_swap(char *, int);
static int delete_swap(char *);
static void set_dumpdev(char *);
static int get_dumpdev(void);
-static void do_fstab(int);
+__dead static void do_fstab(int);
static int check_fstab(void);
static void do_localdevs(int);
static void do_localdisk(const char *, int);
static int do_wedgesofdisk(int fd, int);
static int do_partitionsofdisk(const char *, int fd, int);
-static void usage(void);
-static void swapon_command(int, char **);
+__dead static void usage(void);
+__dead static void swapon_command(int, char **);
#if 0
static void swapoff_command(int, char **);
#endif
diff -r 6cda0a6e5e05 -r 55506f987964 sbin/ttyflags/ttyflags.c
--- a/sbin/ttyflags/ttyflags.c Sat Aug 27 18:55:58 2011 +0000
+++ b/sbin/ttyflags/ttyflags.c Sat Aug 27 18:57:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttyflags.c,v 1.17 2008/07/20 01:20:23 lukem Exp $ */
+/* $NetBSD: ttyflags.c,v 1.18 2011/08/27 18:58:51 joerg Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -41,7 +41,7 @@
#endif /* not lint */
#ifndef lint
-__RCSID("$NetBSD: ttyflags.c,v 1.17 2008/07/20 01:20:23 lukem Exp $");
+__RCSID("$NetBSD: ttyflags.c,v 1.18 2011/08/27 18:58:51 joerg Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -58,12 +58,12 @@
#include <ttyent.h>
#include <unistd.h>
-int change_all(void);
-int change_ttyflags(struct ttyent *);
-int change_ttys(char **);
-void usage(void);
+static int change_all(void);
+static int change_ttyflags(struct ttyent *);
+static int change_ttys(char **);
+__dead static void usage(void);
-int nflag, vflag;
+static int nflag, vflag;
/*
* Ttyflags sets the device-specific tty flags, based on the contents
@@ -116,7 +116,7 @@
/*
* Change all /etc/ttys entries' flags.
*/
-int
+static int
change_all(void)
{
struct ttyent *tep;
@@ -132,7 +132,7 @@
/*
* Change the specified ttys' flags.
*/
-int
+static int
change_ttys(char **ttylist)
{
struct ttyent *tep;
@@ -159,7 +159,7 @@
* Actually do the work; find out what the new flags value should be,
* open the device, and change the flags.
*/
-int
+static int
change_ttyflags(struct ttyent *tep)
{
int fd, flags, rval, st, sep;
@@ -237,7 +237,7 @@
/*
* Print usage information when a bogus set of arguments is given.
*/
-void
+static void
usage(void)
{
(void)fprintf(stderr, "usage: ttyflags [-v] [-a | tty ... ]\n");
diff -r 6cda0a6e5e05 -r 55506f987964 sbin/wdogctl/wdogctl.c
--- a/sbin/wdogctl/wdogctl.c Sat Aug 27 18:55:58 2011 +0000
+++ b/sbin/wdogctl/wdogctl.c Sat Aug 27 18:57:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdogctl.c,v 1.19 2011/01/04 23:48:44 wiz Exp $ */
+/* $NetBSD: wdogctl.c,v 1.20 2011/08/27 19:00:35 joerg Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: wdogctl.c,v 1.19 2011/01/04 23:48:44 wiz Exp $");
+__RCSID("$NetBSD: wdogctl.c,v 1.20 2011/08/27 19:00:35 joerg Exp $");
#endif
@@ -56,17 +56,16 @@
#define _PATH_WATCHDOG "/dev/watchdog"
-int main(int, char *[]);
-void enable_kernel(const char *, u_int);
-void enable_user(const char *, u_int, int);
-void enable_ext(const char *, u_int);
-void tickle_ext(void);
-void disable(void);
-void prep_wmode(struct wdog_mode *, int, const char *, u_int);
-void list_timers(void);
-void usage(void);
+static void enable_kernel(const char *, u_int);
+static void enable_user(const char *, u_int, int);
+static void enable_ext(const char *, u_int);
+static void tickle_ext(void);
+static void disable(void);
+static void prep_wmode(struct wdog_mode *, int, const char *, u_int);
+static void list_timers(void);
+__dead static void usage(void);
-int Aflag;
+static int Aflag;
/* Caution -- ordered list; entries >= CMD_EXT_TICKLE set timers */
enum cmd {
@@ -173,7 +172,7 @@
exit(EXIT_SUCCESS);
}
-void
+static void
prep_wmode(struct wdog_mode *wp, int mode, const char *name, u_int period)
{
if (strlen(name) >= WDOG_NAMESIZE)
@@ -186,7 +185,7 @@
wp->wm_mode |= WDOG_FEATURE_ALARM;
}
-void
+static void
enable_kernel(const char *name, u_int period)
{
struct wdog_mode wm;
@@ -204,7 +203,7 @@
(void)close(fd);
}
-void
+static void
enable_ext(const char *name, u_int period)
{
struct wdog_mode wm;
@@ -226,7 +225,7 @@
return;
}
-void
+static void
enable_user(const char *name, u_int period, int cancel_on_close)
{
struct wdog_mode wm;
@@ -310,8 +309,8 @@
/* NOTREACHED */
}
-void
-tickle_ext()
+static void
+tickle_ext(void)
{
int fd;
@@ -324,7 +323,7 @@
(void)close(fd);
}
-void
+static void
disable(void)
{
struct wdog_mode wm;
@@ -362,7 +361,7 @@
}
}
-void
+static void
list_timers(void)
{
struct wdog_conf wc;
@@ -439,7 +438,7 @@
(void)close(fd);
}
-void
+static void
usage(void)
{
Home |
Main Index |
Thread Index |
Old Index