diff options
| author | joerg <joerg@NetBSD.org> | 2011-09-04 20:28:09 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2011-09-04 20:28:09 +0000 |
| commit | 8a6719cf4003b02fd071364d33df446000f56f4a (patch) | |
| tree | cb16179eede84b580bae2dc017c3dc9a0e683e0a /usr.bin | |
| parent | 7d747031d2354cfc27127a6dc0de0527842ce00a (diff) | |
ANSIfy + static + __dead
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/lam/lam.c | 42 | ||||
| -rw-r--r-- | usr.bin/locate/code/locate.code.c | 28 |
2 files changed, 30 insertions, 40 deletions
diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c index 802db86963e..662eefec950 100644 --- a/usr.bin/lam/lam.c +++ b/usr.bin/lam/lam.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ #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 @@ struct openfile { /* open file structure */ 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 @@ main(argc, argv) } } -void -getargs(av) - char *av[]; +static void +getargs(char *av[]) { struct openfile *ip = input; char *p, *c; @@ -177,9 +173,8 @@ getargs(av) ip->sepstring = ""; } -char * -pad(ip) - struct openfile *ip; +static char * +pad(struct openfile *ip) { char *lp = linep; @@ -192,9 +187,8 @@ pad(ip) return (lp); } -char * -gatherline(ip) - struct openfile *ip; +static char * +gatherline(struct openfile *ip) { char s[BUFSIZ]; int c; @@ -222,7 +216,7 @@ gatherline(ip) return (lp); } -void +static void error(const char *msg, const char *s) { warnx(msg, s); diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c index 15761734372..0a4254c28aa 100644 --- a/usr.bin/locate/code/locate.code.c +++ b/usr.bin/locate/code/locate.code.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\ #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 @@ __RCSID("$NetBSD: locate.code.c,v 1.10 2008/07/21 14:19:23 lukem Exp $"); #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 @@ main(argc, argv) 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 @@ bgindex(bg) /* Return location of bg in bigrams or -1. */ return (*p == '\0' ? -1 : p - bigrams); } -void -usage() +static void +usage(void) { (void)fprintf(stderr, "usage: locate.code common_bigrams < list > squozen_list\n"); |
