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/f99bd41d2551
branches: trunk
changeset: 768966:f99bd41d2551
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Aug 29 14:47:47 2011 +0000
description:
static + __dead
diffstat:
bin/pax/extern.h | 6 +-----
bin/pax/options.c | 19 ++++++++++---------
bin/pax/pax.c | 6 +++---
bin/rm/rm.c | 31 +++++++++++++++----------------
bin/rmdir/rmdir.c | 13 ++++++-------
5 files changed, 35 insertions(+), 40 deletions(-)
diffs (274 lines):
diff -r 7d9f4c0066a3 -r f99bd41d2551 bin/pax/extern.h
--- a/bin/pax/extern.h Mon Aug 29 14:47:07 2011 +0000
+++ b/bin/pax/extern.h Mon Aug 29 14:47:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.57 2011/06/18 23:07:04 christos Exp $ */
+/* $NetBSD: extern.h,v 1.58 2011/08/29 14:47:47 joerg Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -204,7 +204,6 @@
extern int havechd;
void options(int, char **);
OPLIST * opt_next(void);
-int opt_add(const char *);
int bad_opt(void);
int mkpath(char *);
char *chdname;
@@ -265,9 +264,6 @@
extern char *tempfile;
extern char *tempbase;
-int main(int, char **);
-void sig_cleanup(int);
-
/*
* sel_subs.c
*/
diff -r 7d9f4c0066a3 -r f99bd41d2551 bin/pax/options.c
--- a/bin/pax/options.c Mon Aug 29 14:47:07 2011 +0000
+++ b/bin/pax/options.c Mon Aug 29 14:47:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.110 2011/06/18 23:07:04 christos Exp $ */
+/* $NetBSD: options.c,v 1.111 2011/08/29 14:47:47 joerg Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
-__RCSID("$NetBSD: options.c,v 1.110 2011/06/18 23:07:04 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.111 2011/08/29 14:47:47 joerg Exp $");
#endif
#endif /* not lint */
@@ -81,18 +81,19 @@
static OPLIST *ophead = NULL; /* head for format specific options -x */
static OPLIST *optail = NULL; /* option tail */
+static int opt_add(const char *);
static int no_op(void);
static void printflg(unsigned int);
static int c_frmt(const void *, const void *);
static off_t str_offt(char *);
static char *get_line(FILE *fp);
static void pax_options(int, char **);
-static void pax_usage(void);
+__dead static void pax_usage(void);
static void tar_options(int, char **);
-static void tar_usage(void);
+__dead static void tar_usage(void);
#ifndef NO_CPIO
static void cpio_options(int, char **);
-static void cpio_usage(void);
+__dead static void cpio_usage(void);
#endif
/* errors from get_line */
@@ -2054,7 +2055,7 @@
return num;
}
-char *
+static char *
get_line(FILE *f)
{
char *name, *temp;
@@ -2095,7 +2096,7 @@
* print the usage summary to the user
*/
-void
+static void
pax_usage(void)
{
fprintf(stderr,
@@ -2124,7 +2125,7 @@
* print the usage summary to the user
*/
-void
+static void
tar_usage(void)
{
(void)fputs("usage: tar [-]{crtux}[-befhjklmopqvwzHOPSXZ014578] [archive] "
@@ -2141,7 +2142,7 @@
* print the usage summary to the user
*/
-void
+static void
cpio_usage(void)
{
diff -r 7d9f4c0066a3 -r f99bd41d2551 bin/pax/pax.c
--- a/bin/pax/pax.c Mon Aug 29 14:47:07 2011 +0000
+++ b/bin/pax/pax.c Mon Aug 29 14:47:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pax.c,v 1.46 2011/06/18 23:07:04 christos Exp $ */
+/* $NetBSD: pax.c,v 1.47 2011/08/29 14:47:48 joerg Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -44,7 +44,7 @@
#if 0
static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#else
-__RCSID("$NetBSD: pax.c,v 1.46 2011/06/18 23:07:04 christos Exp $");
+__RCSID("$NetBSD: pax.c,v 1.47 2011/08/29 14:47:48 joerg Exp $");
#endif
#endif /* not lint */
@@ -337,7 +337,7 @@
* never....
*/
-void
+__dead static void
sig_cleanup(int which_sig)
{
/*
diff -r 7d9f4c0066a3 -r f99bd41d2551 bin/rm/rm.c
--- a/bin/rm/rm.c Mon Aug 29 14:47:07 2011 +0000
+++ b/bin/rm/rm.c Mon Aug 29 14:47:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rm.c,v 1.49 2009/02/14 08:05:04 lukem Exp $ */
+/* $NetBSD: rm.c,v 1.50 2011/08/29 14:48:46 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994, 2003
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)rm.c 8.8 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: rm.c,v 1.49 2009/02/14 08:05:04 lukem Exp $");
+__RCSID("$NetBSD: rm.c,v 1.50 2011/08/29 14:48:46 joerg Exp $");
#endif
#endif /* not lint */
@@ -59,15 +59,14 @@
#include <string.h>
#include <unistd.h>
-int dflag, eval, fflag, iflag, Pflag, stdin_ok, vflag, Wflag;
+static int dflag, eval, fflag, iflag, Pflag, stdin_ok, vflag, Wflag;
-int check(char *, char *, struct stat *);
-void checkdot(char **);
-void rm_file(char **);
-int rm_overwrite(char *, struct stat *);
-void rm_tree(char **);
-void usage(void);
-int main(int, char *[]);
+static int check(char *, char *, struct stat *);
+static void checkdot(char **);
+static void rm_file(char **);
+static int rm_overwrite(char *, struct stat *);
+static void rm_tree(char **);
+__dead static void usage(void);
/*
* For the sake of the `-f' flag, check whether an error number indicates the
@@ -147,7 +146,7 @@
/* NOTREACHED */
}
-void
+static void
rm_tree(char **argv)
{
FTS *fts;
@@ -261,7 +260,7 @@
fts_close(fts);
}
-void
+static void
rm_file(char **argv)
{
struct stat sb;
@@ -371,7 +370,7 @@
* rm_overwrite will return 0 on success.
*/
-int
+static int
rm_overwrite(char *file, struct stat *sbp)
{
struct stat sb;
@@ -492,7 +491,7 @@
return 1;
}
-int
+static int
check(char *path, char *name, struct stat *sp)
{
int ch, first;
@@ -540,7 +539,7 @@
* trailing slashes have been removed, we'll remove them here.
*/
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
-void
+static void
checkdot(char **argv)
{
char *p, **save, **t;
@@ -571,7 +570,7 @@
}
}
-void
+static void
usage(void)
{
diff -r 7d9f4c0066a3 -r f99bd41d2551 bin/rmdir/rmdir.c
--- a/bin/rmdir/rmdir.c Mon Aug 29 14:47:07 2011 +0000
+++ b/bin/rmdir/rmdir.c Mon Aug 29 14:47:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rmdir.c,v 1.25 2008/07/20 00:52:40 lukem Exp $ */
+/* $NetBSD: rmdir.c,v 1.26 2011/08/29 14:49:38 joerg Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
#else
-__RCSID("$NetBSD: rmdir.c,v 1.25 2008/07/20 00:52:40 lukem Exp $");
+__RCSID("$NetBSD: rmdir.c,v 1.26 2011/08/29 14:49:38 joerg Exp $");
#endif
#endif /* not lint */
@@ -52,9 +52,8 @@
#include <string.h>
#include <unistd.h>
-int rm_path(char *);
-void usage(void);
-int main(int, char *[]);
+static int rm_path(char *);
+__dead static void usage(void);
int
main(int argc, char *argv[])
@@ -93,7 +92,7 @@
/* NOTREACHED */
}
-int
+static int
rm_path(char *path)
{
char *p;
@@ -113,7 +112,7 @@
return (0);
}
-void
+static void
usage(void)
{
(void)fprintf(stderr, "usage: %s [-p] directory ...\n", getprogname());
Home |
Main Index |
Thread Index |
Old Index