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");
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to