diff options
| author | joerg <joerg@NetBSD.org> | 2011-08-29 14:45:28 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2011-08-29 14:45:28 +0000 |
| commit | 4eeef0bfa2f4161663e912835990652caf22da9d (patch) | |
| tree | e494e812750a4e6e186fca6539d57693e78cef33 /bin | |
| parent | abbeacd94f5c45e246bba95821ef8bf3108c74e1 (diff) | |
static + __dead
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/mkdir/mkdir.c | 13 | ||||
| -rw-r--r-- | bin/mt/mt.c | 21 | ||||
| -rw-r--r-- | bin/mv/mv.c | 25 |
3 files changed, 28 insertions, 31 deletions
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 78d4c3b5e91..cb60b8806f2 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkdir.c,v 1.37 2008/07/20 00:52:40 lukem Exp $ */ +/* $NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1992, 1993\ #if 0 static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94"; #else -__RCSID("$NetBSD: mkdir.c,v 1.37 2008/07/20 00:52:40 lukem Exp $"); +__RCSID("$NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $"); #endif #endif /* not lint */ @@ -55,9 +55,8 @@ __RCSID("$NetBSD: mkdir.c,v 1.37 2008/07/20 00:52:40 lukem Exp $"); #include <string.h> #include <unistd.h> -int mkpath(char *, mode_t, mode_t); -void usage(void); -int main(int, char *[]); +static int mkpath(char *, mode_t, mode_t); +__dead static void usage(void); int main(int argc, char *argv[]) @@ -149,7 +148,7 @@ main(int argc, char *argv[]) * mode - file mode of terminal directory * dir_mode - file mode of intermediate directories */ -int +static int mkpath(char *path, mode_t mode, mode_t dir_mode) { struct stat sb; @@ -213,7 +212,7 @@ mkpath(char *path, mode_t mode, mode_t dir_mode) return 0; } -void +static void usage(void) { diff --git a/bin/mt/mt.c b/bin/mt/mt.c index 4006e878b47..bf0ee88f765 100644 --- a/bin/mt/mt.c +++ b/bin/mt/mt.c @@ -1,4 +1,4 @@ -/* $NetBSD: mt.c,v 1.46 2008/07/20 00:52:40 lukem Exp $ */ +/* $NetBSD: mt.c,v 1.47 2011/08/29 14:46:01 joerg Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mt.c,v 1.46 2008/07/20 00:52:40 lukem Exp $"); +__RCSID("$NetBSD: mt.c,v 1.47 2011/08/29 14:46:01 joerg Exp $"); #endif #endif /* not lint */ @@ -76,7 +76,7 @@ struct commands { }; #define CMD(a) a, sizeof(a) - 1 -const struct commands com[] = { +static const struct commands com[] = { { CMD("asf"), MTIOCTOP, MTASF, 1, 0 }, { CMD("blocksize"), MTIOCTOP, MTSETBSIZ, 1, 0 }, { CMD("bsf"), MTIOCTOP, MTBSF, 1, 1 }, @@ -104,10 +104,9 @@ const struct commands com[] = { { .c_name = NULL } }; -void printreg(const char *, u_int, const char *); -void status(struct mtget *); -void usage(void); -int main(int, char *[]); +static void printreg(const char *, u_int, const char *); +static void status(struct mtget *); +__dead static void usage(void); int main(int argc, char *argv[]) @@ -234,7 +233,7 @@ main(int argc, char *argv[]) #include <tahoe/vba/cyreg.h> #endif -const struct tape_desc { +static const struct tape_desc { short t_type; /* type of magtape device */ const char *t_name; /* printing name */ const char *t_dsbits; /* "drive status" register */ @@ -256,7 +255,7 @@ const struct tape_desc { /* * Interpret the status buffer returned */ -void +static void status(struct mtget *bp) { const struct tape_desc *mt; @@ -287,7 +286,7 @@ status(struct mtget *bp) /* * Print a register a la the %b format of the kernel's printf. */ -void +static void printreg(const char *s, u_int v, const char *bits) { int any, i; @@ -315,7 +314,7 @@ printreg(const char *s, u_int v, const char *bits) } } -void +static void usage(void) { (void)fprintf(stderr, "usage: %s [-f device] command [count]\n", diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 55703a74313..7af964f1eff 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -1,4 +1,4 @@ -/* $NetBSD: mv.c,v 1.42 2011/08/03 04:11:15 manu Exp $ */ +/* $NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\ #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: mv.c,v 1.42 2011/08/03 04:11:15 manu Exp $"); +__RCSID("$NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $"); #endif #endif /* not lint */ @@ -65,14 +65,13 @@ __RCSID("$NetBSD: mv.c,v 1.42 2011/08/03 04:11:15 manu Exp $"); #include "pathnames.h" -int fflg, iflg, vflg; -int stdin_ok; +static int fflg, iflg, vflg; +static int stdin_ok; -int copy(char *, char *); -int do_move(char *, char *); -int fastcopy(char *, char *, struct stat *); -void usage(void); -int main(int, char *[]); +static int copy(char *, char *); +static int do_move(char *, char *); +static int fastcopy(char *, char *, struct stat *); +__dead static void usage(void); int main(int argc, char *argv[]) @@ -151,7 +150,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -int +static int do_move(char *from, char *to) { struct stat sb; @@ -253,7 +252,7 @@ do_move(char *from, char *to) fastcopy(from, to, &sb) : copy(from, to)); } -int +static int fastcopy(char *from, char *to, struct stat *sbp) { struct timeval tval[2]; @@ -337,7 +336,7 @@ err: if (unlink(to)) return (0); } -int +static int copy(char *from, char *to) { pid_t pid; @@ -382,7 +381,7 @@ copy(char *from, char *to) return (0); } -void +static void usage(void) { (void)fprintf(stderr, "usage: %s [-fiv] source target\n" |
