From owner-svn-src-all@FreeBSD.ORG Mon Jun 28 12:04:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E6F106568C; Mon, 28 Jun 2010 12:04:56 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27D728FC15; Mon, 28 Jun 2010 12:04:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5SC4uoi097851; Mon, 28 Jun 2010 12:04:56 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5SC4ulS097848; Mon, 28 Jun 2010 12:04:56 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006281204.o5SC4ulS097848@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 28 Jun 2010 12:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209571 - in head/usr.bin/locate: bigram code X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2010 12:04:56 -0000 Author: gavin Date: Mon Jun 28 12:04:55 2010 New Revision: 209571 URL: http://svn.freebsd.org/changeset/base/209571 Log: 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 Modified: head/usr.bin/locate/bigram/locate.bigram.c head/usr.bin/locate/code/locate.code.c Modified: head/usr.bin/locate/bigram/locate.bigram.c ============================================================================== --- head/usr.bin/locate/bigram/locate.bigram.c Mon Jun 28 12:00:20 2010 (r209570) +++ head/usr.bin/locate/bigram/locate.bigram.c Mon Jun 28 12:04:55 2010 (r209571) @@ -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 + 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) { Modified: head/usr.bin/locate/code/locate.code.c ============================================================================== --- head/usr.bin/locate/code/locate.code.c Mon Jun 28 12:00:20 2010 (r209570) +++ head/usr.bin/locate/code/locate.code.c Mon Jun 28 12:04:55 2010 (r209571) @@ -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 i #endif /* !LOOKUP */ void -usage() +usage(void) { (void)fprintf(stderr, "usage: locate.code common_bigrams < list > squozen_list\n");