From 27450f928887021c02a2b656ffc2d6ae0c43737b Mon Sep 17 00:00:00 2001 From: gavin Date: Mon, 28 Jun 2010 12:04:55 +0000 Subject: Various changes to make locate compilable with WARNS=6. Note that there is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents actually bumping this to WARNS=6 - I'm still considering the correct solution to this issue. Tested by: make universe --- usr.bin/locate/bigram/locate.bigram.c | 8 +++++--- usr.bin/locate/code/locate.code.c | 17 ++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c index 208824f..6fa2d31 100644 --- a/usr.bin/locate/bigram/locate.bigram.c +++ b/usr.bin/locate/bigram/locate.bigram.c @@ -37,6 +37,7 @@ * $FreeBSD$ */ +#if 0 #ifndef lint static char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ @@ -46,6 +47,7 @@ static char copyright[] = #ifndef lint static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ +#endif /* * bigram < sorted_file_names | sort -nr | @@ -67,9 +69,9 @@ u_int bigram[UCHAR_MAX + 1][UCHAR_MAX + 1]; int main(void) { - register u_char *cp; - register u_char *oldpath = buf1, *path = buf2; - register u_int i, j; + u_char *cp; + u_char *oldpath = buf1, *path = buf2; + u_int i, j; while (fgets(path, sizeof(buf2), stdin) != NULL) { diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c index 6290c67..9a87c16 100644 --- a/usr.bin/locate/code/locate.code.c +++ b/usr.bin/locate/code/locate.code.c @@ -37,6 +37,7 @@ * $FreeBSD$ */ +#if 0 #ifndef lint static char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ @@ -46,6 +47,7 @@ static char copyright[] = #ifndef lint static char sccsid[] = "@(#)locate.code.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ +#endif /* * PURPOSE: sorted list compressor (works with a modified 'find' @@ -122,14 +124,12 @@ int bgindex(char *); void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { - register u_char *cp, *oldpath, *path; + u_char *cp, *oldpath, *path; int ch, code, count, diffcount, oldcount; + u_int i, j; FILE *fp; - register int i, j; while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { @@ -256,10 +256,9 @@ main(argc, argv) #ifndef LOOKUP int -bgindex(bg) /* Return location of bg in bigrams or -1. */ - char *bg; +bgindex(char *bg) /* Return location of bg in bigrams or -1. */ { - register char bg0, bg1, *p; + char bg0, bg1, *p; bg0 = bg[0]; bg1 = bg[1]; @@ -271,7 +270,7 @@ bgindex(bg) /* Return location of bg in bigrams or -1. */ #endif /* !LOOKUP */ void -usage() +usage(void) { (void)fprintf(stderr, "usage: locate.code common_bigrams < list > squozen_list\n"); -- cgit v1.1