Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/bad144 static + __dead



details:   https://anonhg.NetBSD.org/src/rev/91339cb9f759
branches:  trunk
changeset: 771572:91339cb9f759
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Nov 25 13:13:33 2011 +0000

description:
static + __dead

diffstat:

 usr.sbin/bad144/bad144.c |  70 ++++++++++++++++++++++++------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diffs (185 lines):

diff -r 95dcf476f8e2 -r 91339cb9f759 usr.sbin/bad144/bad144.c
--- a/usr.sbin/bad144/bad144.c  Fri Nov 25 12:51:27 2011 +0000
+++ b/usr.sbin/bad144/bad144.c  Fri Nov 25 13:13:33 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bad144.c,v 1.28 2011/08/31 16:24:59 plunky Exp $       */
+/*     $NetBSD: bad144.c,v 1.29 2011/11/25 13:13:33 joerg Exp $        */
 
 /*
  * Copyright (c) 1980, 1986, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)bad144.c   8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: bad144.c,v 1.28 2011/08/31 16:24:59 plunky Exp $");
+__RCSID("$NetBSD: bad144.c,v 1.29 2011/11/25 13:13:33 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -76,29 +76,28 @@
 #define RETRIES        10              /* number of retries on reading old sectors */
 
 #ifdef __vax__
-int    fflag;
+static int     fflag;
 #endif
-int    add, copy, verbose, nflag;
-int    dups;
-int    badfile = -1;           /* copy of badsector table to use, -1 if any */
+static int     add, copy, verbose, nflag;
+static int     dups;
+static int     badfile = -1;           /* copy of badsector table to use, -1 if any */
 #define MAXSECSIZE     1024
-struct dkbad curbad, oldbad;
+static struct  dkbad curbad, oldbad;
 #define        DKBAD_MAGIC     0x4321
 
-daddr_t        size;
-struct disklabel *dp;
-struct disklabel label;
-char   diskname[MAXPATHLEN];
+static daddr_t size;
+static struct  disklabel *dp;
+static struct  disklabel label;
+static char    diskname[MAXPATHLEN];
 
-daddr_t        badsn(const struct bt_bad *);
-int    blkcopy(int, daddr_t, daddr_t);
-void   blkzero(int, daddr_t);
-int    checkold(void);
-int    compare(const void *, const void *);
-daddr_t        getold(int, struct dkbad *);
-int    main(int, char **);
-void   shift(int, int, int);
-void   usage(void);
+static daddr_t badsn(const struct bt_bad *);
+static int     blkcopy(int, daddr_t, daddr_t);
+static void    blkzero(int, daddr_t);
+static int     checkold(void);
+static int     compare(const void *, const void *);
+static daddr_t getold(int, struct dkbad *);
+static void    shift(int, int, int);
+__dead static void     usage(void);
 
 #ifdef __vax__
 #define OPTSTRING "01234acfvn"
@@ -318,7 +317,7 @@
        return (0);
 }
 
-daddr_t
+static daddr_t
 getold(int f, struct dkbad *bad)
 {
        int i;
@@ -345,7 +344,7 @@
        /*NOTREACHED*/
 }
 
-int
+static int
 checkold(void)
 {
        int i;
@@ -400,7 +399,7 @@
  * to make room for the new bad sectors.
  * new is the new number of bad sectors, old is the previous count.
  */
-void
+static void
 shift(int f, int new, int old)
 {
        daddr_t repl;
@@ -431,12 +430,12 @@
        }
 }
 
-char *buf;
+static char *buf;
 
 /*
  *  Copy disk sector s1 to s2.
  */
-int
+static int
 blkcopy(int f, daddr_t s1, daddr_t s2)
 {
        int tries, n;
@@ -470,7 +469,7 @@
        return(1);
 }
 
-void
+static void
 blkzero(int f, daddr_t sn)
 {
        char *zbuf;
@@ -490,7 +489,7 @@
        free(zbuf);
 }
 
-int
+static int
 compare(const void *v1, const void *v2)
 {
        const struct bt_bad *b1 = v1;
@@ -505,7 +504,7 @@
        return (b1->bt_trksec - b2->bt_trksec);
 }
 
-daddr_t
+static daddr_t
 badsn(const struct bt_bad *bt)
 {
 
@@ -537,10 +536,11 @@
 #define        HPUP_OKSECT     0xc000          /* this normally means sector is good */
 #define        HPUP_16BIT      0x1000          /* 1 == 16 bit format */
 };
-int rp06format(struct formats *, struct disklabel *, daddr_t, char *, int);
-int hpupformat(struct formats *, struct disklabel *, daddr_t, char *, int);
 
-struct formats {
+static int rp06format(struct formats *, struct disklabel *, daddr_t, char *, int);
+static int hpupformat(struct formats *, struct disklabel *, daddr_t, char *, int);
+
+static struct  formats {
        char    *f_name;                /* disk name */
        int     f_bufsize;              /* size of sector + header */
        int     f_bic;                  /* value to bic in hpup_cyl */
@@ -557,7 +557,7 @@
 };
 
 /*ARGSUSED*/
-int
+static int
 hpupformat(struct formats *fp, struct disklabel *dp, daddr_t blk, char *buf,
           int count)
 {
@@ -575,7 +575,7 @@
 }
 
 /*ARGSUSED*/
-int
+static int
 rp06format(struct formats *fp, struct disklabel *dp, daddr_t blk, char *buf,
           int count)
 {
@@ -587,7 +587,7 @@
        return (0);
 }
 
-void
+static void
 format(int fd, daddr_t blk)
 {
        struct formats *fp;
@@ -647,7 +647,7 @@
 }
 #endif
 
-void
+static void
 usage(void)
 {
 



Home | Main Index | Thread Index | Old Index