Module Name: src
Committed By: joerg
Date: Sun Sep 4 20:28:40 UTC 2011
Modified Files:
src/usr.bin/locate/code: locate.code.c
Log Message:
ANSIfy + static + __dead
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/locate/code/locate.code.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/locate/code/locate.code.c
diff -u src/usr.bin/locate/code/locate.code.c:1.10 src/usr.bin/locate/code/locate.code.c:1.11
--- src/usr.bin/locate/code/locate.code.c:1.10 Mon Jul 21 14:19:23 2008
+++ src/usr.bin/locate/code/locate.code.c Sun Sep 4 20:28:40 2011
@@ -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 };
-
-int bgindex __P((char *));
-int main __P((int, char **));
-void usage __P((void));
+static char buf1[MAXPATHLEN] = " ";
+static char buf2[MAXPATHLEN];
+static char bigrams[BGBUFSIZE + 1] = { 0 };
+
+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");