Source-Changes-HG archive

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

[src/trunk]: src/usr.bin ANSIfy + static + __dead



details:   https://anonhg.NetBSD.org/src/rev/e76c1929a2b5
branches:  trunk
changeset: 769244:e76c1929a2b5
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Sep 04 20:28:09 2011 +0000

description:
ANSIfy + static + __dead

diffstat:

 usr.bin/lam/lam.c                 |  42 ++++++++++++++++----------------------
 usr.bin/locate/code/locate.code.c |  28 +++++++++++--------------
 2 files changed, 30 insertions(+), 40 deletions(-)

diffs (160 lines):

diff -r 8bff379a3824 -r e76c1929a2b5 usr.bin/lam/lam.c
--- a/usr.bin/lam/lam.c Sun Sep 04 20:27:05 2011 +0000
+++ b/usr.bin/lam/lam.c Sun Sep 04 20:28:09 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lam.c,v 1.7 2009/04/12 13:01:55 lukem Exp $    */
+/*     $NetBSD: lam.c,v 1.8 2011/09/04 20:28:09 joerg Exp $    */
 
 /*-
  * Copyright (c) 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)lam.c      8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: lam.c,v 1.7 2009/04/12 13:01:55 lukem Exp $");
+__RCSID("$NetBSD: lam.c,v 1.8 2011/09/04 20:28:09 joerg Exp $");
 #endif /* not lint */
 
 /*
@@ -65,21 +65,18 @@
        const char *format;     /* printf(3) style string spec. */
 }      input[MAXOFILES];
 
-int    morefiles;              /* set by getargs(), changed by gatherline() */
-int    nofinalnl;              /* normally append \n to each output line */
-char   line[BIGBUFSIZ];
-char   *linep;
+static int     morefiles;              /* set by getargs(), changed by gatherline() */
+static int     nofinalnl;              /* normally append \n to each output line */
+static char    line[BIGBUFSIZ];
+static char    *linep;
 
-void    error __P((const char *, const char *));
-char   *gatherline __P((struct openfile *));
-void    getargs __P((char *[]));
-int     main __P((int, char **));
-char   *pad __P((struct openfile *));
+__dead static void      error(const char *, const char *);
+static char    *gatherline(struct openfile *);
+static void     getargs(char *[]);
+static char    *pad(struct openfile *);
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
        struct  openfile *ip;
 
@@ -99,9 +96,8 @@
        }
 }
 
-void
-getargs(av)
-       char *av[];
+static void
+getargs(char *av[])
 {
        struct openfile *ip = input;
        char *p, *c;
@@ -177,9 +173,8 @@
                ip->sepstring = "";
 }
 
-char *
-pad(ip)
-       struct openfile *ip;
+static char *
+pad(struct openfile *ip)
 {
        char *lp = linep;
 
@@ -192,9 +187,8 @@
        return (lp);
 }
 
-char *
-gatherline(ip)
-       struct openfile *ip;
+static char *
+gatherline(struct openfile *ip)
 {
        char s[BUFSIZ];
        int c;
@@ -222,7 +216,7 @@
        return (lp);
 }
 
-void
+static void
 error(const char *msg, const char *s)
 {
        warnx(msg, s);
diff -r 8bff379a3824 -r e76c1929a2b5 usr.bin/locate/code/locate.code.c
--- a/usr.bin/locate/code/locate.code.c Sun Sep 04 20:27:05 2011 +0000
+++ b/usr.bin/locate/code/locate.code.c Sun Sep 04 20:28:09 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locate.code.c,v 1.10 2008/07/21 14:19:23 lukem Exp $   */
+/*     $NetBSD: locate.code.c,v 1.11 2011/09/04 20:28:40 joerg Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)locate.code.c      8.4 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: locate.code.c,v 1.10 2008/07/21 14:19:23 lukem Exp $");
+__RCSID("$NetBSD: locate.code.c,v 1.11 2011/09/04 20:28:40 joerg Exp $");
 #endif /* not lint */
 
 /*
@@ -93,18 +93,15 @@
 
 #define        BGBUFSIZE       (NBG * 2)       /* size of bigram buffer */
 
-char buf1[MAXPATHLEN] = " ";   
-char buf2[MAXPATHLEN];
-char bigrams[BGBUFSIZE + 1] = { 0 };
+static char buf1[MAXPATHLEN] = " ";
+static char buf2[MAXPATHLEN];
+static char bigrams[BGBUFSIZE + 1] = { 0 };
 
-int    bgindex __P((char *));
-int    main __P((int, char **));
-void   usage __P((void));
+static int     bgindex(char *);
+__dead static void     usage(void);
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
        char *cp, *oldpath, *path;
        int ch, code, count, diffcount, oldcount;
@@ -188,9 +185,8 @@
        exit(0);
 }
 
-int
-bgindex(bg)                    /* Return location of bg in bigrams or -1. */
-       char *bg;
+static int
+bgindex(char *bg)                      /* Return location of bg in bigrams or -1. */
 {
        char bg0, bg1, *p;
 
@@ -202,8 +198,8 @@
        return (*p == '\0' ? -1 : p - bigrams);
 }
 
-void
-usage()
+static void
+usage(void)
 {
        (void)fprintf(stderr,
            "usage: locate.code common_bigrams < list > squozen_list\n");



Home | Main Index | Thread Index | Old Index