Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin static + __dead



details:   https://anonhg.NetBSD.org/src/rev/fe6c51352004
branches:  trunk
changeset: 768964:fe6c51352004
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Aug 29 14:45:28 2011 +0000

description:
static + __dead

diffstat:

 bin/mkdir/mkdir.c |  13 ++++++-------
 bin/mt/mt.c       |  21 ++++++++++-----------
 bin/mv/mv.c       |  25 ++++++++++++-------------
 3 files changed, 28 insertions(+), 31 deletions(-)

diffs (200 lines):

diff -r b9bf9bbb9c73 -r fe6c51352004 bin/mkdir/mkdir.c
--- a/bin/mkdir/mkdir.c Mon Aug 29 14:44:21 2011 +0000
+++ b/bin/mkdir/mkdir.c Mon Aug 29 14:45:28 2011 +0000
@@ -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 @@
 #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 @@
 #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 @@
  *     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 @@
        return 0;
 }
 
-void
+static void
 usage(void)
 {
 
diff -r b9bf9bbb9c73 -r fe6c51352004 bin/mt/mt.c
--- a/bin/mt/mt.c       Mon Aug 29 14:44:21 2011 +0000
+++ b/bin/mt/mt.c       Mon Aug 29 14:45:28 2011 +0000
@@ -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 @@
 #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 @@
 };
 
 #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 @@
        { .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 @@
 #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 @@
 /*
  * Interpret the status buffer returned
  */
-void
+static void
 status(struct mtget *bp)
 {
        const struct tape_desc *mt;
@@ -287,7 +286,7 @@
 /*
  * 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 @@
        }
 }
 
-void
+static void
 usage(void)
 {
        (void)fprintf(stderr, "usage: %s [-f device] command [count]\n",
diff -r b9bf9bbb9c73 -r fe6c51352004 bin/mv/mv.c
--- a/bin/mv/mv.c       Mon Aug 29 14:44:21 2011 +0000
+++ b/bin/mv/mv.c       Mon Aug 29 14:45:28 2011 +0000
@@ -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 @@
 #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 @@
 
 #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 @@
        /* NOTREACHED */
 }
 
-int
+static int
 do_move(char *from, char *to)
 {
        struct stat sb;
@@ -253,7 +252,7 @@
            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 @@
        return (0);
 }
 
-int
+static int
 copy(char *from, char *to)
 {
        pid_t pid;
@@ -382,7 +381,7 @@
        return (0);
 }
 
-void
+static void
 usage(void)
 {
        (void)fprintf(stderr, "usage: %s [-fiv] source target\n"



Home | Main Index | Thread Index | Old Index